All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: "Zhi, Yong" <yong.zhi@intel.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
	"hans.verkuil@cisco.com" <hans.verkuil@cisco.com>,
	"Zheng, Jian Xu" <jian.xu.zheng@intel.com>,
	"Mani, Rajmohan" <rajmohan.mani@intel.com>,
	"Toivonen, Tuukka" <tuukka.toivonen@intel.com>,
	"Yang, Hyungwoo" <hyungwoo.yang@intel.com>,
	"Vijaykumar, Ramya" <ramya.vijaykumar@intel.com>
Subject: Re: [PATCH v4 3/3] intel-ipu3: cio2: Add new MIPI-CSI2 driver
Date: Thu, 13 Jul 2017 13:51:18 +0900	[thread overview]
Message-ID: <CAAFQd5CKwWoiEZo9rBy1P3ioGJyScr8iG5iDpq_M+Wem6YAS9g@mail.gmail.com> (raw)
In-Reply-To: <C193D76D23A22742993887E6D207B54D1ADD7EFB@ORSMSX106.amr.corp.intel.com>

Hi Yong,

On Thu, Jul 13, 2017 at 8:20 AM, Zhi, Yong <yong.zhi@intel.com> wrote:
> Hi, Sakari,
>
> Thanks for the time spent on code review, acks to all the comments, except two places:
>
>> +/* .complete() is called after all subdevices have been located */
>> +static int cio2_notifier_complete(struct v4l2_async_notifier *notifier)
>> +{
>> +     struct cio2_device *cio2 = container_of(notifier, struct cio2_device,
>> +                                             notifier);
>> +     struct sensor_async_subdev *s_asd;
>> +     struct fwnode_handle *fwn_remote, *fwn_endpt, *fwn_remote_endpt;
>> +     struct cio2_queue *q;
>> +     struct fwnode_endpoint remote_endpt;
>> +     unsigned int i, pad;
>> +     int ret;
>> +
>> +     for (i = 0; i < notifier->num_subdevs; i++) {
>> +             s_asd = container_of(cio2->notifier.subdevs[i],
>> +                                     struct sensor_async_subdev,
>> +                                     asd);
>> +
>> +             fwn_remote = s_asd->asd.match.fwnode.fwnode;
>> +             fwn_endpt = (struct fwnode_handle *)
>> +                                     s_asd->vfwn_endpt.base.local_fwnode;
>
> Why do you need a cast?
>
> [YZ] With a cast results in compilation warning:

(I think you mean "without".)

>
> drivers/media/pci/ipu3/ipu3-cio2.c:1298:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
>    fwn_endpt = /*(struct fwnode_handle *)*/

This is a sign that the code is doing something wrong (in this case
probably trying to write to a const pointer), so casting just silences
the unfixed error.

>
>> +     ret = v4l2_async_notifier_register(&cio2->v4l2_dev, &cio2->notifier);
>> +     if (ret) {
>> +             cio2->notifier.num_subdevs = 0;
>
> No need to assign num_subdevs as 0.
>
> [YZ] _notifier_exit() will call _unregister() if this is not 0.

You shouldn't call _exit() if _init() failed. I noticed that many
error paths in your code does this. Please fix it.

Best regards,
Tomasz

  reply	other threads:[~2017-07-13  4:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 23:43 [PATCH v4 0/3] [media] add IPU3 CIO2 CSI2 driver Yong Zhi
2017-07-10 23:43 ` [PATCH v4 1/3] videodev2.h, v4l2-ioctl: add IPU3 raw10 color format Yong Zhi
2017-07-10 23:43 ` [PATCH v4 2/3] doc-rst: add IPU3 raw10 bayer pixel format definitions Yong Zhi
2017-07-10 23:43 ` [PATCH v4 3/3] intel-ipu3: cio2: Add new MIPI-CSI2 driver Yong Zhi
2017-07-11 10:33   ` Sakari Ailus
2017-07-12 23:20     ` Zhi, Yong
2017-07-13  4:51       ` Tomasz Figa [this message]
2017-07-13  8:21         ` Sakari Ailus
2017-07-13  8:31           ` Tomasz Figa
2017-07-13  8:47             ` Sakari Ailus
2017-10-06 17:17     ` Zhi, Yong

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=CAAFQd5CKwWoiEZo9rBy1P3ioGJyScr8iG5iDpq_M+Wem6YAS9g@mail.gmail.com \
    --to=tfiga@chromium.org \
    --cc=hans.verkuil@cisco.com \
    --cc=hyungwoo.yang@intel.com \
    --cc=jian.xu.zheng@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=rajmohan.mani@intel.com \
    --cc=ramya.vijaykumar@intel.com \
    --cc=sakari.ailus@iki.fi \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tuukka.toivonen@intel.com \
    --cc=yong.zhi@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.