Re: [PATCH] s390: include: timex: Use macro CLOCK_STORE_SIZE instead of hard code number

From: Heiko Carstens
Date: Fri Jan 02 2015 - 04:46:38 EST


On Thu, Jan 01, 2015 at 10:27:32PM +0800, Chen Gang wrote:
> For C language, it treats array parameter as a pointer, so sizeof for an
> array parameter is equal to sizeof for a pointer, which causes compiler
> warning (with allmodconfig by gcc 5):
>
> CC arch/s390/kernel/asm-offsets.s
> In file included from include/linux/timex.h:65:0,
> from include/linux/sched.h:19,
> from include/linux/kvm_host.h:15,
> from arch/s390/kernel/asm-offsets.c:10:
> ./arch/s390/include/asm/timex.h: In function 'get_tod_clock_ext':
> ./arch/s390/include/asm/timex.h:76:32: warning: 'sizeof' on array function parameter 'clk' will return size of 'char *' [-Wsizeof-array-argument]
> typedef struct { char _[sizeof(clk)]; } addrtype;
> ^
>
> Can use macro CLOCK_STORE_SIZE instead of all related hard code numbers,
> which also can avoid this warning. And also add a tab to CLOCK_TICK_RATE
> definition to match coding styles.
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx>

Thanks. I applied the slightly changed version below.