From: Maninder Singh <maninder1.s@samsung.com>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"patches@opensource.wolfsonmicro.com"
<patches@opensource.wolfsonmicro.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
PANKAJ MISHRA <pankaj.m@samsung.com>
Subject: Re: [PATCH v2] regulator: wm831x-dcdc: Use pointer after NULL check
Date: Thu, 02 Jul 2015 11:02:56 +0000 (GMT) [thread overview]
Message-ID: <1041654268.190401435834974293.JavaMail.weblogic@ep2mlwas01a> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 914 bytes --]
Hello charles,
>> pdata is used before NULL check, so it looks misleading.
>> If pdata validation is required then we have to
>> first check for pdata validation, then calculate id,
>> and then second check for pdata->dcdc[id].
>>
>> and it is better to use !pointer than (pointer == NULL)
>>
>> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
>> ---
>The patch basically looks fine, but it feels a bit like needless
>churn. The current code is perfectly correct and feels clear
>enough to me.
Reason for patch is we are checking a pointer which is already dereferenced
before NULL check, which looks misleading.
If we know code is working correctly, Then we may simply drop NULL check,
rather than these changes.
Thanks,
Maninder
........ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next reply other threads:[~2015-07-02 11:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-02 11:02 Maninder Singh [this message]
2015-07-02 11:12 ` [PATCH v2] regulator: wm831x-dcdc: Use pointer after NULL check Charles Keepax
-- strict thread matches above, loose matches on Subject: below --
2015-07-02 7:57 Maninder Singh
2015-07-02 10:18 ` Charles Keepax
2015-07-02 11:14 ` Mark Brown
2015-07-02 11:19 ` Charles Keepax
2015-07-02 11:33 ` Mark Brown
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=1041654268.190401435834974293.JavaMail.weblogic@ep2mlwas01a \
--to=maninder1.s@samsung.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pankaj.m@samsung.com \
--cc=patches@opensource.wolfsonmicro.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.