Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730692 > unrolled thread

Re: [PATCH] iio: adc: dln2-adc: initialize local struct before using it

Started byMartin Kepplinger <martink@posteo.de>
First post2017-09-12 09:10 +0200
Last post2017-09-13 19:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] iio: adc: dln2-adc: initialize local struct before  using it Martin Kepplinger <martink@posteo.de> - 2017-09-12 09:10 +0200
    Re: [PATCH] iio: adc: dln2-adc: initialize local struct before  using it Jonathan Cameron <jic23@kernel.org> - 2017-09-13 19:00 +0200

#1730692 — Re: [PATCH] iio: adc: dln2-adc: initialize local struct before using it

FromMartin Kepplinger <martink@posteo.de>
Date2017-09-12 09:10 +0200
SubjectRe: [PATCH] iio: adc: dln2-adc: initialize local struct before using it
Message-ID<uoNuz-6Cp-17@gated-at.bofh.it>
Am 12.09.2017 03:32 schrieb kbuild test robot:
> Hi Martin,
> 
> [auto build test WARNING on iio/togreg]
> [also build test WARNING on next-20170911]
> [cannot apply to v4.13]
> [if your patch is applied to the wrong git tree, please drop us a note
> to help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Martin-Kepplinger/iio-adc-dln2-adc-initialize-local-struct-before-using-it/20170912-064250
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git 
> togreg
> config: tile-allyesconfig (attached as .config)
> compiler: tilegx-linux-gcc (GCC) 4.6.2
> reproduce:
>         wget
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross
> -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=tile
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/iio/adc/dln2-adc.c: In function 'dln2_adc_trigger_h':
>>> drivers/iio/adc/dln2-adc.c:492:2: warning: missing braces around 
>>> initializer [-Wmissing-braces]
>    drivers/iio/adc/dln2-adc.c:492:2: warning: (near initialization for
> 'data.values') [-Wmissing-braces]
> 
> vim +492 drivers/iio/adc/dln2-adc.c
> 
>    484
>    485	static irqreturn_t dln2_adc_trigger_h(int irq, void *p)
>    486	{
>    487		struct iio_poll_func *pf = p;
>    488		struct iio_dev *indio_dev = pf->indio_dev;
>    489		struct {
>    490			__le16 values[DLN2_ADC_MAX_CHANNELS];
>    491			int64_t timestamp_space;
>  > 492		} data = { 0 };


ok :) I guess

    } data = {{ 0 }};

would be ok for gcc in this case. How far has this patch gone? Do you 
want a fix
on top or the patch re-done? Or do you just do it yourself?

thanks,

                   martin

[toc] | [next] | [standalone]


#1731716

FromJonathan Cameron <jic23@kernel.org>
Date2017-09-13 19:00 +0200
Message-ID<upjb3-1qQ-1@gated-at.bofh.it>
In reply to#1730692
On Tue, 12 Sep 2017 09:01:27 +0200
Martin Kepplinger <martink@posteo.de> wrote:

> Am 12.09.2017 03:32 schrieb kbuild test robot:
> > Hi Martin,
> > 
> > [auto build test WARNING on iio/togreg]
> > [also build test WARNING on next-20170911]
> > [cannot apply to v4.13]
> > [if your patch is applied to the wrong git tree, please drop us a note
> > to help improve the system]
> > 
> > url:
> > https://github.com/0day-ci/linux/commits/Martin-Kepplinger/iio-adc-dln2-adc-initialize-local-struct-before-using-it/20170912-064250
> > base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git 
> > togreg
> > config: tile-allyesconfig (attached as .config)
> > compiler: tilegx-linux-gcc (GCC) 4.6.2
> > reproduce:
> >         wget
> > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross
> > -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         # save the attached .config to linux build tree
> >         make.cross ARCH=tile
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >    drivers/iio/adc/dln2-adc.c: In function 'dln2_adc_trigger_h':  
> >>> drivers/iio/adc/dln2-adc.c:492:2: warning: missing braces around 
> >>> initializer [-Wmissing-braces]  
> >    drivers/iio/adc/dln2-adc.c:492:2: warning: (near initialization for
> > 'data.values') [-Wmissing-braces]
> > 
> > vim +492 drivers/iio/adc/dln2-adc.c
> > 
> >    484
> >    485	static irqreturn_t dln2_adc_trigger_h(int irq, void *p)
> >    486	{
> >    487		struct iio_poll_func *pf = p;
> >    488		struct iio_dev *indio_dev = pf->indio_dev;
> >    489		struct {
> >    490			__le16 values[DLN2_ADC_MAX_CHANNELS];
> >    491			int64_t timestamp_space;  
> >  > 492		} data = { 0 };  
> 
> 
> ok :) I guess
> 
>     } data = {{ 0 }};
> 
> would be ok for gcc in this case. How far has this patch gone? Do you 
> want a fix
> on top or the patch re-done? Or do you just do it yourself?
>
I'm  unconvinced the patch is necessary as I think all elements of
that structure are initialized anyway before they are used.

I might be missing a code path where that isn't true though so
feel free to point one out!

Jonathan
 
> thanks,
> 
>                    martin

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web