From: jacopo mondi <jacopo@jmondi.org>
To: Riccardo Schirone <sirmy15@gmail.com>
Cc: alan@linux.intel.com, gregkh@linuxfoundation.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH 3/4] staging: improves comparisons readability in atomisp-ov5693
Date: Tue, 28 Nov 2017 10:51:39 +0100 [thread overview]
Message-ID: <20171128095139.GD675@w540> (raw)
In-Reply-To: <20171127214413.10749-4-sirmy15@gmail.com>
Hi Riccardo,
thanks for the patch
On Mon, Nov 27, 2017 at 10:44:12PM +0100, Riccardo Schirone wrote:
> Fix "Comparisons should place the constant on the right side of the
> test" issue.
>
> Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
> ---
> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
> index ecd607b7b005..4eeb478ae84b 100644
> --- a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
> +++ b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
> @@ -764,7 +764,7 @@ static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf)
> //pr_debug("BANK[%2d] %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", i, *b, *(b+1), *(b+2), *(b+3), *(b+4), *(b+5), *(b+6), *(b+7), *(b+8), *(b+9), *(b+10), *(b+11), *(b+12), *(b+13), *(b+14), *(b+15));
>
> //Intel OTP map, try to read 320byts first.
> - if (21 == i) {
> + if (i == 21) {
> if ((*b) == 0) {
> dev->otp_size = 320;
> break;
> @@ -772,7 +772,7 @@ static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf)
> b = buf;
> continue;
> }
> - } else if (24 == i) { //if the first 320bytes data doesn't not exist, try to read the next 32bytes data.
> + } else if (i == 24) { //if the first 320bytes data doesn't not exist, try to read the next 32bytes data.
> if ((*b) == 0) {
> dev->otp_size = 32;
> break;
> @@ -780,7 +780,7 @@ static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf)
> b = buf;
> continue;
> }
> - } else if (27 == i) { //if the prvious 32bytes data doesn't exist, try to read the next 32bytes data again.
> + } else if (i == 27) { //if the prvious 32bytes data doesn't exist, try to read the next 32bytes data again.
I wonder why checkpatch does not complain about these C++ style
comments clearly exceeding 80 columns...
> if ((*b) == 0) {
> dev->otp_size = 32;
> break;
> @@ -1351,7 +1351,7 @@ static int __power_up(struct v4l2_subdev *sd)
> struct i2c_client *client = v4l2_get_subdevdata(sd);
> int ret;
>
> - if (NULL == dev->platform_data) {
> + if (!dev->platform_data) {
Please mention in changelog that you're also substituting a comparison to
NULL with this.
Checkpatch points this out, didn't it?
Thanks
j
> dev_err(&client->dev,
> "no camera_sensor_platform_data");
> return -ENODEV;
> @@ -1399,7 +1399,7 @@ static int power_down(struct v4l2_subdev *sd)
> int ret = 0;
>
> dev->focus = OV5693_INVALID_CONFIG;
> - if (NULL == dev->platform_data) {
> + if (!dev->platform_data) {
> dev_err(&client->dev,
> "no camera_sensor_platform_data");
> return -ENODEV;
> --
> 2.14.3
>
next prev parent reply other threads:[~2017-11-28 9:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 21:44 [PATCH 0/4] fix some checkpatch style issues in atomisp driver Riccardo Schirone
2017-11-27 21:44 ` [PATCH 1/4] staging: add missing blank line after declarations in atomisp-ov5693 Riccardo Schirone
2017-11-28 9:53 ` jacopo mondi
2017-11-28 10:36 ` Riccardo S.
2017-11-27 21:44 ` [PATCH 2/4] staging: improve comments usage " Riccardo Schirone
2017-11-27 21:44 ` [PATCH 3/4] staging: improves comparisons readability " Riccardo Schirone
2017-11-28 9:51 ` jacopo mondi [this message]
2017-11-27 21:44 ` [PATCH 4/4] staging: fix indentation " Riccardo Schirone
2017-11-28 20:40 ` [PATCHv2 0/4] fix some checkpatch style issues in atomisp driver Riccardo Schirone
2017-11-28 20:40 ` [PATCHv2 1/4] staging: add missing blank line after declarations in atomisp-ov5693 Riccardo Schirone
2017-11-28 20:40 ` [PATCHv2 2/4] staging: improve comments usage " Riccardo Schirone
2017-11-28 20:40 ` [PATCHv2 3/4] staging: improves comparisons readability " Riccardo Schirone
2017-11-28 20:40 ` [PATCHv2 4/4] staging: fix indentation " Riccardo Schirone
2017-11-29 8:40 ` [PATCHv2 0/4] fix some checkpatch style issues in atomisp driver Sakari Ailus
2017-11-29 9:07 ` Riccardo S.
2017-11-29 9:31 ` [PATCH " Riccardo S.
2017-11-29 10:09 ` jacopo mondi
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=20171128095139.GD675@w540 \
--to=jacopo@jmondi.org \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-media@vger.kernel.org \
--cc=sirmy15@gmail.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