Linux Media Controller development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: kbuild@lists.01.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org, tfiga@chromium.org,
	senozhatsky@chromium.org, yunkec@google.com, lkp@intel.com,
	kbuild-all@lists.01.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v7 2/8] media: uvcvideo: Add support for per-device control mapping overrides
Date: Fri, 1 Jul 2022 10:26:25 +0300	[thread overview]
Message-ID: <20220701072625.GQ11460@kadam> (raw)
In-Reply-To: <CANiDSCu1+0C7mfmm20ERVdvbzyJmoifnp6tcjEcd7EJfUAijSQ@mail.gmail.com>

On Fri, Jul 01, 2022 at 01:16:23AM +0200, Ricardo Ribalda wrote:
> >
> > "mapping" uninitialized if chain->dev->info->mappings is NULL.
> >
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c   Ricardo Ribalda  2022-06-17  2457
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c   Ricardo Ribalda  2022-06-17  2458     /* Process common mappings next. */
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c   Ricardo Ribalda  2022-06-17 @2459     mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings);
> >                                                                                                ^^^^^^^
> >
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c   Ricardo Ribalda  2022-06-17  2460     for (mapping = uvc_ctrl_mappings; mapping < mend; ++mapping) {
> >
> > I'm surprised this made it through testing...  Anyway, the easier way to
> > to iterate through an array of structs is just say:
> 
> There is already a new version under review that fixes this:
> 
> https://patchwork.linuxtv.org/project/linux-media/patch/20220617235610.321917-3-ribalda@chromium.org/ 
> 
> 
> >
> >         for (i = 0; i < ARRAY_SIZE(uvc_ctrl_mappings); i++) {
> >                 mapping = &uvc_ctrl_mappings[i];
> >
> 
> I agree, and that is what I normally used, but that driver iterate this way...

That's not really an excuse.  Imagine you were a lemming and Disney
employees were trying to chase you off a cliff!

> 
> Thanks again!
> 
> PS: Any idea why the test was triggered 14+ days after the patch was sent?

I don't know how kbuild works.  I run Smatch on linux-next so I would
have caught it eventually.  Plus the clang people would have caught it.

regards,
dan carpenter


  parent reply	other threads:[~2022-07-01  7:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 10:36 [PATCH v7 0/8] uvcvideo: Fix handling of power_line_frequency Ricardo Ribalda
2022-06-17 10:36 ` [PATCH v7 1/8] media: uvcvideo: Add missing value for power_line_frequency Ricardo Ribalda
2022-06-17 10:36 ` [PATCH v7 2/8] media: uvcvideo: Add support for per-device control mapping overrides Ricardo Ribalda
2022-06-17 13:44   ` Laurent Pinchart
2022-06-17 14:07     ` Ricardo Ribalda
2022-06-17 14:40   ` kernel test robot
2022-06-30 11:07   ` Dan Carpenter
2022-06-30 23:16     ` Ricardo Ribalda
2022-07-01  2:31       ` [kbuild-all] " Philip Li
2022-07-01  7:26       ` Dan Carpenter [this message]
2022-06-17 10:36 ` [PATCH v7 3/8] media: uvcvideo: Support minimum for V4L2_CTRL_TYPE_MENU Ricardo Ribalda
2022-06-17 13:49   ` Laurent Pinchart
2022-06-17 13:55     ` Ricardo Ribalda
2022-06-17 14:11       ` Laurent Pinchart
2022-06-17 14:15         ` Ricardo Ribalda
2022-06-17 10:36 ` [PATCH v7 4/8] media: uvcvideo: Limit power line control for Quanta UVC Webcam Ricardo Ribalda
2022-06-17 14:01   ` Laurent Pinchart
2022-06-17 14:18     ` Ricardo Ribalda
2022-06-17 10:36 ` [PATCH v7 5/8] media: uvcvideo: Limit power line control for Chicony Easycamera Ricardo Ribalda
2022-06-17 10:36 ` [PATCH v7 6/8] " Ricardo Ribalda
2022-06-17 10:36 ` [PATCH v7 7/8] media: uvcvideo: Limit power line control for Quanta cameras Ricardo Ribalda
2022-06-17 10:36 ` [PATCH v7 8/8] media: uvcvideo: Limit power line control for Acer EasyCamera Ricardo Ribalda

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=20220701072625.GQ11460@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    --cc=senozhatsky@chromium.org \
    --cc=tfiga@chromium.org \
    --cc=yunkec@google.com \
    /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