lkml.org 
[lkml]   [2015]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] s390: include: timex: Use macro CLOCK_STORE_SIZE instead of hard code number
On Wed, 07 Jan 2015 22:45:11 +0800
Chen Gang S <gang.chen@sunrus.com.cn> wrote:

> On 01/05/2015 04:59 PM, Martin Schwidefsky wrote:
> > On Sat, 03 Jan 2015 11:44:04 +0800
> > Chen Gang <gang.chen@sunrus.com.cn> wrote:
> >
> >>
> >> Thank you for your work.
> >>
> >> In honest, originally, I was not sure whether it would cause bug (do not
> >> know gcc would generic incorrect code for it). :-)
> >
> > Even if the code happened to be correct it does not matter. The intention
> > of the sizeof() has been to get to the correct 16, not 8. The fix is
> > fine as it is.
> >
>
> Excuse me, my English is not quite well, I am not quite sure about what
> you said (might misunderstand what you said), so I provide the related
> information below for confirmation, please check, thanks.
>
> sizeof(clk) is for a pointer, not for an array (for C language, it
> treats array parameter as a pointer), the related demo is below:

And your patch fixes this problem. My comment was in regard to the
impact of the original bug. As the typeof construct is used to
prevent the compiler from over-optimizing, the code can come out
correct even if the bug is present.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.



\
 
 \ /
  Last update: 2015-01-07 17:01    [W:0.161 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site