Re: [PATCH v2 net] nfp: cast sizeof() to int when comparing with error code

2018-06-26 Thread David Miller
From: Chengguang Xu 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 > Acked-by: Jakub

Re: [PATCH v2 net] nfp: cast sizeof() to int when comparing with error code

2018-06-25 Thread cgxu519
On 06/26/2018 10:29 AM, Joe Perches wrote: On Tue, 2018-06-26 at 09:16 +0800, Chengguang Xu wrote: sizeof() will return unsigned value so in the error check negative error code will be always larger than sizeof(). [] diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c b/driv

Re: [PATCH v2 net] nfp: cast sizeof() to int when comparing with error code

2018-06-25 Thread Joe Perches
On Tue, 2018-06-26 at 09:16 +0800, Chengguang Xu wrote: > sizeof() will return unsigned value so in the error check > negative error code will be always larger than sizeof(). [] > diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c > b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_

[PATCH v2 net] nfp: cast sizeof() to int when comparing with error code

2018-06-25 Thread Chengguang Xu
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 Acked-by: Jakub Kicinski --- v2: - Add more information to patch subject and commit log.