tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing head: 465d4dd073f72a6348577ed0f7aa4aa00c9264bc commit: a6f523ee41bfe7ef71110d4ae556339d0520efdd [2/23] usb: gadget: uvc: add validate and fix function for uvc response config: hexagon-buildonly-randconfig-r006-20221128 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 6e4cea55f0d1104408b26ac574566a0e4de48036) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?id=a6f523ee41bfe7ef71110d4ae556339d0520efdd git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git git fetch --no-tags usb usb-testing git checkout a6f523ee41bfe7ef71110d4ae556339d0520efdd # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/usb/gadget/function/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/usb/gadget/function/uvc_v4l2.c:24: In file included from drivers/usb/gadget/function/uvc.h:15: In file included from include/linux/usb/composite.h:27: In file included from include/linux/usb/gadget.h:23: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from drivers/usb/gadget/function/uvc_v4l2.c:24: In file included from drivers/usb/gadget/function/uvc.h:15: In file included from include/linux/usb/composite.h:27: In file included from include/linux/usb/gadget.h:23: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from drivers/usb/gadget/function/uvc_v4l2.c:24: In file included from drivers/usb/gadget/function/uvc.h:15: In file included from include/linux/usb/composite.h:27: In file included from include/linux/usb/gadget.h:23: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ >> drivers/usb/gadget/function/uvc_v4l2.c:266:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] default: ^ drivers/usb/gadget/function/uvc_v4l2.c:266:3: note: insert 'break;' to avoid fall-through default: ^ break; 7 warnings generated. vim +266 drivers/usb/gadget/function/uvc_v4l2.c 241 242 static int 243 uvc_send_response(struct uvc_device *uvc, struct uvc_request_data *data) 244 { 245 struct usb_composite_dev *cdev = uvc->func.config->cdev; 246 struct usb_request *req = uvc->control_req; 247 248 if (data->length < 0) 249 return usb_ep_set_halt(cdev->gadget->ep0); 250 251 req->length = min_t(unsigned int, uvc->event_length, data->length); 252 req->zero = data->length < uvc->event_length; 253 254 memcpy(req->buf, data->data, req->length); 255 256 /* validate the ctrl content and fixup */ 257 if (!uvc->event_setup_out) { 258 struct uvc_streaming_control *ctrl = req->buf; 259 260 switch (uvc->streaming_request) { 261 case UVC_GET_CUR: 262 case UVC_GET_MIN: 263 case UVC_GET_MAX: 264 case UVC_GET_DEF: 265 uvc_validate_streaming_ctrl(uvc, ctrl); > 266 default: 267 break; 268 } 269 } 270 271 return usb_ep_queue(cdev->gadget->ep0, req, GFP_KERNEL); 272 } 273 -- 0-DAY CI Kernel Test Service https://01.org/lkp