Re: [xhci:for-usb-linus 1/1] drivers/usb/host/xhci-ring.c:3014:33: sparse: incorrect type in assignment (different base types)

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

 



Hi David,

It looks the commit I merged from you added a sparse warning because
nop_cmd should have been declared as __le32 instead of u32.  You did
correctly convert the TRB field from cpu to le32, so the warning is
harmless.  I'll fix it for 3.14, after Greg merges the patch into
usb-next.

Sarah Sharp

On Tue, Dec 03, 2013 at 08:58:17AM +0800, kbuild test robot wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci.git for-usb-linus
> head:   35773dac5f862cb1c82ea151eba3e2f6de51ec3e
> commit: 35773dac5f862cb1c82ea151eba3e2f6de51ec3e [1/1] usb: xhci: Link TRB must not occur within a USB payload burst
> reproduce: make C=1 CF=-D__CHECK_ENDIAN__
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>    drivers/usb/host/xhci-ring.c:1658:19: sparse: restricted __le32 degrades to integer
> >> drivers/usb/host/xhci-ring.c:3014:33: sparse: incorrect type in assignment (different base types)
>    drivers/usb/host/xhci-ring.c:3014:33:    expected unsigned int [unsigned] [usertype] nop_cmd
>    drivers/usb/host/xhci-ring.c:3014:33:    got restricted __le32 [usertype] <noident>
> >> drivers/usb/host/xhci-ring.c:3021:55: sparse: incorrect type in assignment (different base types)
>    drivers/usb/host/xhci-ring.c:3021:55:    expected restricted __le32 <noident>
>    drivers/usb/host/xhci-ring.c:3021:55:    got unsigned int [unsigned] [usertype] nop_cmd
> 
> vim +3014 drivers/usb/host/xhci-ring.c
> 
>   3008				if (num_trbs >= TRBS_PER_SEGMENT) {
>   3009					xhci_err(xhci, "Too many fragments %d, max %d\n",
>   3010							num_trbs, TRBS_PER_SEGMENT - 1);
>   3011					return -ENOMEM;
>   3012				}
>   3013	
> > 3014				nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) |
>   3015						ep_ring->cycle_state);
>   3016				ep_ring->num_trbs_free -= usable;
>   3017				do {
>   3018					trb->generic.field[0] = 0;
>   3019					trb->generic.field[1] = 0;
>   3020					trb->generic.field[2] = 0;
> > 3021					trb->generic.field[3] = nop_cmd;
>   3022					trb++;
>   3023				} while (--usable);
>   3024				ep_ring->enqueue = trb;
> 
> ---
> 0-DAY kernel build testing backend              Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux