Re: [balbi-usb:testing/next 50/50] drivers/usb/dwc3/./trace.h:216:449: warning: 's' may be used uninitialized in this function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

kbuild test robot <lkp@xxxxxxxxx> writes:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next
> head:   ad7b607f82731eec3ed17d9d22764eb6f09609f9
> commit: ad7b607f82731eec3ed17d9d22764eb6f09609f9 [50/50] usb: dwc3: trace: add missing break statement to make compiler happy
> config: i386-allyesconfig (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         git checkout ad7b607f82731eec3ed17d9d22764eb6f09609f9
>         # save the attached .config to linux build tree
>         make ARCH=i386 
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
>    In file included from include/trace/trace_events.h:394:0,
>                     from include/trace/define_trace.h:96,
>                     from drivers/usb/dwc3/trace.h:342,
>                     from drivers/usb/dwc3/trace.c:11:
>    drivers/usb/dwc3/./trace.h: In function 'trace_raw_output_dwc3_log_trb':
>>> drivers/usb/dwc3/./trace.h:216:449: warning: 's' may be used uninitialized in this function [-Wmaybe-uninitialized]
>     DECLARE_EVENT_CLASS(dwc3_log_trb,
>
>    drivers/usb/dwc3/./trace.h:216:647: note: 's' was declared here
>     DECLARE_EVENT_CLASS(dwc3_log_trb,
>
>
> vim +/s +216 drivers/usb/dwc3/./trace.h
>
> 2c4cbe6e5a Felipe Balbi    2014-04-30  215  
> 2c4cbe6e5a Felipe Balbi    2014-04-30 @216  DECLARE_EVENT_CLASS(dwc3_log_trb,
> 2c4cbe6e5a Felipe Balbi    2014-04-30  217  	TP_PROTO(struct dwc3_ep *dep, struct dwc3_trb *trb),
> 2c4cbe6e5a Felipe Balbi    2014-04-30  218  	TP_ARGS(dep, trb),
> 2c4cbe6e5a Felipe Balbi    2014-04-30  219  	TP_STRUCT__entry(
> e42f09b85f Felipe Balbi    2017-04-28  220  		__string(name, dep->name)
> 2c4cbe6e5a Felipe Balbi    2014-04-30  221  		__field(struct dwc3_trb *, trb)
> 68d34c8a74 Felipe Balbi    2016-05-30  222  		__field(u32, allocated)
> 68d34c8a74 Felipe Balbi    2016-05-30  223  		__field(u32, queued)
> 4ac4fc9322 Felipe Balbi    2014-09-17  224  		__field(u32, bpl)
> 4ac4fc9322 Felipe Balbi    2014-09-17  225  		__field(u32, bph)
> 4ac4fc9322 Felipe Balbi    2014-09-17  226  		__field(u32, size)
> 4ac4fc9322 Felipe Balbi    2014-09-17  227  		__field(u32, ctrl)
> fa8d965d73 Felipe Balbi    2016-09-28  228  		__field(u32, type)
> 2c4cbe6e5a Felipe Balbi    2014-04-30  229  	),
> 2c4cbe6e5a Felipe Balbi    2014-04-30  230  	TP_fast_assign(
> e42f09b85f Felipe Balbi    2017-04-28  231  		__assign_str(name, dep->name);
> 2c4cbe6e5a Felipe Balbi    2014-04-30  232  		__entry->trb = trb;
> 4ac4fc9322 Felipe Balbi    2014-09-17  233  		__entry->bpl = trb->bpl;
> 4ac4fc9322 Felipe Balbi    2014-09-17  234  		__entry->bph = trb->bph;
> 4ac4fc9322 Felipe Balbi    2014-09-17  235  		__entry->size = trb->size;
> 4ac4fc9322 Felipe Balbi    2014-09-17  236  		__entry->ctrl = trb->ctrl;
> fa8d965d73 Felipe Balbi    2016-09-28  237  		__entry->type = usb_endpoint_type(dep->endpoint.desc);
> 2c4cbe6e5a Felipe Balbi    2014-04-30  238  	),
> 0bd0f6d201 Felipe Balbi    2018-03-26  239  	TP_printk("%s: trb %p buf %08x%08x size %s%d ctrl %08x (%c%c%c%c:%c%c:%s)",
> 0bd0f6d201 Felipe Balbi    2018-03-26  240  		__get_str(name), __entry->trb, __entry->bph, __entry->bpl,
> fa8d965d73 Felipe Balbi    2016-09-28  241  		({char *s;
> fa8d965d73 Felipe Balbi    2016-09-28  242  		int pcm = ((__entry->size >> 24) & 3) + 1;
> fa8d965d73 Felipe Balbi    2016-09-28  243  		switch (__entry->type) {
> fa8d965d73 Felipe Balbi    2016-09-28  244  		case USB_ENDPOINT_XFER_INT:
> fa8d965d73 Felipe Balbi    2016-09-28  245  		case USB_ENDPOINT_XFER_ISOC:
> fa8d965d73 Felipe Balbi    2016-09-28  246  			switch (pcm) {
> fa8d965d73 Felipe Balbi    2016-09-28  247  			case 1:
> fa8d965d73 Felipe Balbi    2016-09-28  248  				s = "1x ";
> fa8d965d73 Felipe Balbi    2016-09-28  249  				break;
> fa8d965d73 Felipe Balbi    2016-09-28  250  			case 2:
> fa8d965d73 Felipe Balbi    2016-09-28  251  				s = "2x ";
> fa8d965d73 Felipe Balbi    2016-09-28  252  				break;
> fa8d965d73 Felipe Balbi    2016-09-28  253  			case 3:

false positive. PCM can only be 1 2 or 3. I'll just add a default line
here after case 3 to license the warning.

-- 
balbi



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux