From: kernel test robot <lkp@intel.com>
To: Michael Tretter <m.tretter@pengutronix.de>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Daniel Scally <dan.scally@ideasonboard.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Michael Grzeschik <m.grzeschik@pengutronix.de>,
linux-usb@vger.kernel.org, linux-media@vger.kernel.org,
kernel@pengutronix.de, Michael Tretter <m.tretter@pengutronix.de>
Subject: Re: [PATCH 8/8] usb: gadget: uvc: implement s/g_parm
Date: Fri, 24 Mar 2023 02:02:56 +0800 [thread overview]
Message-ID: <202303240129.Efnw3p6C-lkp@intel.com> (raw)
In-Reply-To: <20230323-uvc-gadget-cleanup-v1-8-e41f0c5d9d8e@pengutronix.de>
Hi Michael,
I love your patch! Yet something to improve:
[auto build test ERROR on 8be174835f07b2c106b9961c0775486d06112a3c]
url: https://github.com/intel-lab-lkp/linux/commits/Michael-Tretter/usb-gadget-uvc-use-fourcc-printk-helper/20230323-194359
base: 8be174835f07b2c106b9961c0775486d06112a3c
patch link: https://lore.kernel.org/r/20230323-uvc-gadget-cleanup-v1-8-e41f0c5d9d8e%40pengutronix.de
patch subject: [PATCH 8/8] usb: gadget: uvc: implement s/g_parm
config: hexagon-randconfig-r041-20230322 (https://download.01.org/0day-ci/archive/20230324/202303240129.Efnw3p6C-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
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://github.com/intel-lab-lkp/linux/commit/f6fdbbf392bbaa79e8553af32337c54a663760db
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Michael-Tretter/usb-gadget-uvc-use-fourcc-printk-helper/20230323-194359
git checkout f6fdbbf392bbaa79e8553af32337c54a663760db
# 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 olddefconfig
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 <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303240129.Efnw3p6C-lkp@intel.com/
All error/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:24:
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:24:
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:24:
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:289:2: warning: comparison of distinct pointer types ('typeof ((interval)) *' (aka 'unsigned long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Wcompare-distinct-pointer-types]
do_div(interval, timeperframe->denominator);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div'
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
>> drivers/usb/gadget/function/uvc_v4l2.c:289:2: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
do_div(interval, timeperframe->denominator);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
__rem = __div64_32(&(n), __base); \
^~~~
include/asm-generic/div64.h:213:38: note: passing argument to parameter 'dividend' here
extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
^
>> drivers/usb/gadget/function/uvc_v4l2.c:289:2: warning: shift count >= width of type [-Wshift-count-overflow]
do_div(interval, timeperframe->denominator);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:234:25: note: expanded from macro 'do_div'
} else if (likely(((n) >> 32) == 0)) { \
^ ~~
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
8 warnings and 1 error generated.
vim +289 drivers/usb/gadget/function/uvc_v4l2.c
265
266 static void find_closest_timeperframe(struct uvc_device *uvc,
267 struct v4l2_fract *timeperframe)
268 {
269 struct uvc_video *video = &uvc->video;
270 struct uvcg_format *uformat;
271 struct uvcg_frame *uframe;
272 unsigned long interval;
273 unsigned int best_interval;
274 unsigned int curr;
275 unsigned int dist;
276 unsigned int best_dist = UINT_MAX;
277 int i;
278
279 if (timeperframe->denominator == 0)
280 timeperframe->denominator = video->timeperframe.denominator;
281 if (timeperframe->numerator == 0)
282 timeperframe->numerator = video->timeperframe.numerator;
283
284 uformat = find_format_by_pix(uvc, video->fcc);
285 uframe = find_closest_frame_by_size(uvc, uformat,
286 video->width, video->height);
287
288 interval = timeperframe->numerator * 10000000;
> 289 do_div(interval, timeperframe->denominator);
290
291 for (i = 0; i < uframe->frame.b_frame_interval_type; i++) {
292 curr = uframe->dw_frame_interval[i];
293 dist = interval > curr ? interval - curr : curr - interval;
294 if (dist < best_dist) {
295 best_dist = dist;
296 best_interval = curr;
297 }
298 }
299
300 timeperframe->numerator = best_interval;
301 timeperframe->denominator = 10000000;
302 v4l2_simplify_fraction(&timeperframe->numerator,
303 &timeperframe->denominator, 8, 333);
304 }
305
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-03-23 18:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 11:41 [PATCH 0/8] usb: gadget: uvc: fix errors reported by v4l2-compliance Michael Tretter
2023-03-23 11:41 ` [PATCH 1/8] usb: gadget: uvc: use fourcc printk helper Michael Tretter
2023-03-24 7:44 ` Dan Scally
2023-03-24 9:21 ` Laurent Pinchart
2023-03-23 11:41 ` [PATCH 2/8] usb: gadget: uvc: fix return code of REQBUFS Michael Tretter
2023-03-24 7:50 ` Dan Scally
2023-03-24 9:25 ` Laurent Pinchart
2023-03-23 11:41 ` [PATCH 3/8] usb: gadget: uvc: implement s/g_output ioctl Michael Tretter
2023-03-24 9:20 ` Laurent Pinchart
2023-03-24 9:21 ` Dan Scally
2023-03-24 9:39 ` Hans Verkuil
2023-03-24 9:49 ` Laurent Pinchart
2023-03-23 11:41 ` [PATCH 4/8] usb: gadget: uvc: move video format initialization to uvc_v4l2 Michael Tretter
2023-03-24 9:31 ` Laurent Pinchart
2023-03-23 11:41 ` [PATCH 5/8] usb: gadget: uvc: initialize video format using configfs Michael Tretter
2023-03-23 11:41 ` [PATCH 6/8] usb: gadget: uvc: try harder to find a valid format Michael Tretter
2023-03-24 9:35 ` Laurent Pinchart
2023-03-23 11:41 ` [PATCH 7/8] usb: gadget: uvc: add colorspace handling Michael Tretter
2023-03-24 9:33 ` Laurent Pinchart
2023-03-23 11:41 ` [PATCH 8/8] usb: gadget: uvc: implement s/g_parm Michael Tretter
2023-03-23 18:02 ` kernel test robot [this message]
2023-03-24 9:32 ` Laurent Pinchart
2023-03-24 9:38 ` [PATCH 0/8] usb: gadget: uvc: fix errors reported by v4l2-compliance Laurent Pinchart
2023-03-27 12:26 ` Michael Tretter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202303240129.Efnw3p6C-lkp@intel.com \
--to=lkp@intel.com \
--cc=dan.scally@ideasonboard.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel@pengutronix.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=m.grzeschik@pengutronix.de \
--cc=m.tretter@pengutronix.de \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox