Re: [U-Boot] [PATCH v2 1/1] malloc: don't compare pointers to 0

2017-11-20 Thread Bin Meng
On Sat, Nov 11, 2017 at 4:46 AM, Heinrich Schuchardt wrote: > 0 is not a pointer. So do not compare pointers to 0. > > Do not return 0 from functions with a pointer return > type. > > Problem identified with Coccinelle. > > Signed-off-by: Heinrich Schuchardt > --- > v2 > Fix more occurenc

Re: [U-Boot] [PATCH v2 1/1] malloc: don't compare pointers to 0

2017-11-13 Thread Tom Rini
On Mon, Nov 13, 2017 at 09:04:40PM +0100, Wolfgang Denk wrote: > Dear Heinrich, > > In message <20171110204634.20515-1-xypron.g...@gmx.de> you wrote: > > 0 is not a pointer. So do not compare pointers to 0. > > Who says so? 0 can be the value of a pointer to a valid, existing > address. For exa

Re: [U-Boot] [PATCH v2 1/1] malloc: don't compare pointers to 0

2017-11-13 Thread Wolfgang Denk
Dear Heinrich, In message <20171110204634.20515-1-xypron.g...@gmx.de> you wrote: > 0 is not a pointer. So do not compare pointers to 0. Who says so? 0 can be the value of a pointer to a valid, existing address. For example a large number of Power Architecture systems map the RAM beginning at ph

Re: [U-Boot] [PATCH v2 1/1] malloc: don't compare pointers to 0

2017-11-12 Thread Heinrich Schuchardt
On 11/12/2017 09:02 PM, Jeroen Hofstee wrote: Hello Heinrich, On 11/10/2017 09:46 PM, Heinrich Schuchardt wrote: 0 is not a pointer. So do not compare pointers to 0. Do not return 0 from functions with a pointer return type. Problem identified with Coccinelle. Perhaps you can elaborate on w

Re: [U-Boot] [PATCH v2 1/1] malloc: don't compare pointers to 0

2017-11-12 Thread Jeroen Hofstee
Hello Heinrich, On 11/10/2017 09:46 PM, Heinrich Schuchardt wrote: 0 is not a pointer. So do not compare pointers to 0. Do not return 0 from functions with a pointer return type. Problem identified with Coccinelle. Perhaps you can elaborate on what problem you are solving? As far as I know i

[U-Boot] [PATCH v2 1/1] malloc: don't compare pointers to 0

2017-11-10 Thread Heinrich Schuchardt
0 is not a pointer. So do not compare pointers to 0. Do not return 0 from functions with a pointer return type. Problem identified with Coccinelle. Signed-off-by: Heinrich Schuchardt --- v2 Fix more occurences of the problem. v1 [PATCH 1/1] malloc: compare pointer to NULL not to