From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
"wangkailong@jari.cn" <wangkailong@jari.cn>,
"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"sohu0106@126.com" <sohu0106@126.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] macintosh/adb: Fix warning comparing pointer to 0
Date: Sun, 6 Nov 2022 17:13:21 +0000 [thread overview]
Message-ID: <7ad9268e-5c77-84e4-fd30-9a4bc7ad3d27@csgroup.eu> (raw)
In-Reply-To: <7924fc05-02d7-a2b3-85e3-d30dfe081da3@wanadoo.fr>
Le 06/11/2022 à 17:12, Christophe JAILLET a écrit :
> Le 06/11/2022 à 16:28, wangkailong@jari.cn a écrit :
>> Fix the following coccicheck warning:
>>
>> drivers/macintosh/adb.c:676:14-15: WARNING comparing pointer to 0.
>>
>> Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
We already have such patches awaiting for application, see
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?submitter=83647
Please check patchwork before submitting such fixes as they may already
exist.
Thanks
Christophe
>> ---
>> drivers/macintosh/adb.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
>> index 1bbb9ca08d40..076253599bd4 100644
>> --- a/drivers/macintosh/adb.c
>> +++ b/drivers/macintosh/adb.c
>> @@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct
>> file *file)
>> goto out;
>> }
>> state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL);
>> - if (state == 0) {
>> + if (state) {
>
> Hi
> no, this should be "if (!state)"
>
> CJ
>
>> ret = -ENOMEM;
>> goto out;
>> }
>
prev parent reply other threads:[~2022-11-06 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-06 15:28 wangkailong
2022-11-06 16:12 ` Christophe JAILLET
2022-11-06 17:13 ` Christophe Leroy [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=7ad9268e-5c77-84e4-fd30-9a4bc7ad3d27@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=benh@kernel.crashing.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=sohu0106@126.com \
--cc=wangkailong@jari.cn \
/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
all inboxes | Powered by JetHome®