Netdev List
 help / color / mirror / Atom feed
From: Chengguang Xu <cgxu519@gmx.com>
To: jakub.kicinski@netronome.com, davem@davemloft.net
Cc: oss-drivers@netronome.com, netdev@vger.kernel.org,
	Chengguang Xu <cgxu519@gmx.com>
Subject: [PATCH] net/nfp: cast sizeof() to int when comparing with error code
Date: Mon, 25 Jun 2018 15:33:18 +0800	[thread overview]
Message-ID: <20180625073318.6828-1-cgxu519@gmx.com> (raw)

Negative error code will be larger than sizeof().

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
 drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c
index cd34097b79f1..37a6d7822a38 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c
@@ -232,7 +232,7 @@ struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp)
 	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
 			   nfp_resource_address(state->res),
 			   fwinf, sizeof(*fwinf));
-	if (err < sizeof(*fwinf))
+	if (err < (int)sizeof(*fwinf))
 		goto err_release;
 
 	if (!nffw_res_flg_init_get(fwinf))
-- 
2.17.1

             reply	other threads:[~2018-06-25  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25  7:33 Chengguang Xu [this message]
2018-06-25 18:11 ` [PATCH] net/nfp: cast sizeof() to int when comparing with error code Jakub Kicinski

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=20180625073318.6828-1-cgxu519@gmx.com \
    --to=cgxu519@gmx.com \
    --cc=davem@davemloft.net \
    --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