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

2018-06-30 Thread cgxu519
On 06/26/2018 04:06 PM, Julia Lawall wrote: On Mon, 25 Jun 2018, 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(). This looks like a general class of

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

2018-06-26 Thread Julia Lawall
On Mon, 25 Jun 2018, 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(). > > This looks like a general class of error in the kernel > where a

Re: [Cocci] [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(). This looks like a general class of error in the kernel where a signed result that could be returning a -errno is tested