From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Dan Carpenter <dan.carpenter@oracle.com>,
dri-devel@lists.freedesktop.org
Cc: Andrzej Hajda <a.hajda@samsung.com>,
Archit Taneja <architt@codeaurora.org>,
David Airlie <airlied@linux.ie>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Maciej Purski <m.purski@samsung.com>,
Rob Herring <robh@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] gpu/drm/bridge/sii9234: Use common error handling code in sii9234_writebm()
Date: Mon, 23 Oct 2017 08:45:27 +0000 [thread overview]
Message-ID: <54f4eff0-e7bb-214b-980e-208587850037@users.sourceforge.net> (raw)
In-Reply-To: <20171023071859.m55dgxzooje4i35e@mwanda>
>> ret = i2c_smbus_write_byte_data(client, offset, value);
>> - if (ret < 0) {
>> - dev_err(ctx->dev, "writebm: %4s[0x%02x] <- 0x%02x\n",
>> - sii9234_client_name[id], offset, value);
>> - ctx->i2c_error = ret;
>> - }
>> + if (!ret)
>> + return 0;
>
> Ugh. No. Don't do success handling on the last if statement.
I find my approach useful in this case.
> Also while I personally prefer testing for non-zero,
I got used to this checking style to some degree.
> the ALSA people got annoyed at you for changing tests for < 0
It seems that involved software developers have got special preferences there.
> but you're doing it again.
I dared to propose such an adjustment once more.
Would you like discuss corresponding reasons any further?
> And it introduces a bug,
Unfortunately, a hiccup in my software development attention …
> although I see now that you fixed it in v2.
Thanks that you noticed also this small update.
https://patchwork.kernel.org/patch/10021767/
https://lkml.kernel.org/r/<2ecf0bb7-7129-40e4-cefc-0bc2d0f7ee8b@users.sourceforge.net>
> I can't get excited about these sort of risky low value patches.
I try again to point special software improvement opportunities out.
>> +report_failure:
>> + dev_err(ctx->dev, "writebm: %4s[0x%02x] <- 0x%02x\n",
>> + sii9234_client_name[id], offset, value);
>> + ctx->i2c_error = ret;
>> return ret;
>> }
How do you think about to move this source code to the end of
this function implementation?
Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-10-23 8:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-22 19:32 [PATCH] gpu/drm/bridge/sii9234: Use common error handling code in sii9234_writebm() SF Markus Elfring
2017-10-22 20:00 ` [PATCH v2] " SF Markus Elfring
2017-10-23 7:18 ` [PATCH] " Dan Carpenter
2017-10-23 8:45 ` SF Markus Elfring [this message]
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=54f4eff0-e7bb-214b-980e-208587850037@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=architt@codeaurora.org \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.purski@samsung.com \
--cc=robh@kernel.org \
/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