From: David Miller <davem@davemloft.net>
To: cgxu519@gmx.com
Cc: jakub.kicinski@netronome.com, oss-drivers@netronome.com,
netdev@vger.kernel.org
Subject: Re: [PATCH v2 net] nfp: cast sizeof() to int when comparing with error code
Date: Wed, 27 Jun 2018 15:38:07 +0900 (KST) [thread overview]
Message-ID: <20180627.153807.1103262343316196923.davem@davemloft.net> (raw)
In-Reply-To: <20180626011631.22717-1-cgxu519@gmx.com>
From: Chengguang Xu <cgxu519@gmx.com>
Date: Tue, 26 Jun 2018 09:16:31 +0800
> sizeof() will return unsigned value so in the error check
> negative error code will be always larger than sizeof().
>
> Fixes: a0d8e02c35ff ("nfp: add support for reading nffw info")
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
> v2:
> - Add more information to patch subject and commit log.
I guess the:
if (x < 0 || x < sizeof(foo))
better self-documents the situation, but this patch is fine too
so I have applied it.
Thanks.
prev parent reply other threads:[~2018-06-27 6:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 1:16 [PATCH v2 net] nfp: cast sizeof() to int when comparing with error code Chengguang Xu
2018-06-26 2:10 ` Joe Perches
2018-06-26 7:21 ` Julia Lawall
2018-06-26 8:06 ` Julia Lawall
2018-06-26 8:21 ` cgxu519
2018-06-26 2:29 ` Joe Perches
2018-06-26 2:48 ` cgxu519
2018-06-27 6:38 ` David Miller [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=20180627.153807.1103262343316196923.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=cgxu519@gmx.com \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.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