Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-08-02 Thread Robin Getz
On Wed 1 Aug 2007 06:38, Richard Knutsson pondered: > If I understood Robin correctly, he suggested that checkpatch.pl would > tell to convert "x == NULL" to "!x", if that would be the preferred way. I guess I was asking - _if_ this is really important - lets pick a preferred way, and try to use

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-08-01 Thread Matt Mackall
On Wed, Aug 01, 2007 at 12:38:39PM +0200, Richard Knutsson wrote: > Mike Frysinger wrote: > >On 7/31/07, Richard Knutsson <[EMAIL PROTECTED]> wrote: > > > >>Mike Frysinger wrote: > >> > >>>On 7/27/07, Robin Getz <[EMAIL PROTECTED]> wrote: > >>> > If there is a definite style or sema

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-08-01 Thread Richard Knutsson
Mike Frysinger wrote: On 7/31/07, Richard Knutsson <[EMAIL PROTECTED]> wrote: Mike Frysinger wrote: On 7/27/07, Robin Getz <[EMAIL PROTECTED]> wrote: If there is a definite style or semantic preference that everyone should live with - does it make sense to put checks in checkpat

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-08-01 Thread Mike Frysinger
On 7/31/07, Richard Knutsson <[EMAIL PROTECTED]> wrote: > Mike Frysinger wrote: > > On 7/27/07, Robin Getz <[EMAIL PROTECTED]> wrote: > >> If there is a definite style or semantic preference that everyone should > >> live > >> with - does it make sense to put checks in checkpatch.pl to enforce it?

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-08-01 Thread Richard Knutsson
Mike Frysinger wrote: On 7/27/07, Robin Getz <[EMAIL PROTECTED]> wrote: If there is a definite style or semantic preference that everyone should live with - does it make sense to put checks in checkpatch.pl to enforce it? checkpatch.pl does not have enough semantic knowledge to know if

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread Mike Frysinger
On 7/27/07, Robin Getz <[EMAIL PROTECTED]> wrote: > If there is a definite style or semantic preference that everyone should live > with - does it make sense to put checks in checkpatch.pl to enforce it? checkpatch.pl does not have enough semantic knowledge to know if the thing being tested is a p

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread Robin Getz
On Fri 27 Jul 2007 06:18, Yoann Padioleau pondered: > David Howells <[EMAIL PROTECTED]> writes: > > > Yoann Padioleau <[EMAIL PROTECTED]> wrote: > > > >> When comparing a pointer, it's clearer to compare it to NULL than to > 0. > > > > Can you make them of style: > > > > if (!x) > > Yes I can

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread Al Viro
On Fri, Jul 27, 2007 at 12:21:53PM +0200, Yoann Padioleau wrote: > > On Fri, Jul 27, 2007 at 11:44:35AM +0200, Yoann Padioleau wrote: > >>pte = pte_alloc_kernel(pme, va); > >> - if (pte != 0) { > >> + if (pte != NULL) { > I don't understand. pte is a pointer right ? So why should we > keep

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread Yoann Padioleau
Al Viro <[EMAIL PROTECTED]> writes: > On Fri, Jul 27, 2007 at 11:44:35AM +0200, Yoann Padioleau wrote: >> pte = pte_alloc_kernel(pme, va); >> -if (pte != 0) { >> +if (pte != NULL) { >> err = 0; >> set_pte(pte, mk_pte_phys(pa & PAGE_MASK, prot)); >> } >>

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread Yoann Padioleau
David Howells <[EMAIL PROTECTED]> writes: > Yoann Padioleau <[EMAIL PROTECTED]> wrote: > >> When comparing a pointer, it's clearer to compare it to NULL than to 0. > > Can you make them of style: > > if (!x) Yes I can. I can make another semantic patch later to do that transformation. But s

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread David Howells
Yoann Padioleau <[EMAIL PROTECTED]> wrote: > When comparing a pointer, it's clearer to compare it to NULL than to 0. Can you make them of style: if (!x) instead? Thanks, David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL P

Re: [PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread Al Viro
On Fri, Jul 27, 2007 at 11:44:35AM +0200, Yoann Padioleau wrote: > pte = pte_alloc_kernel(pme, va); > - if (pte != 0) { > + if (pte != NULL) { > err = 0; > set_pte(pte, mk_pte_phys(pa & PAGE_MASK, prot)); > } > @@ -99,7 +99,7 @@ void *consistent_alloc

[PATCH 06/68] 0 -> NULL, for arch/frv

2007-07-27 Thread Yoann Padioleau
When comparing a pointer, it's clearer to compare it to NULL than to 0. Here is an excerpt of the semantic patch: @@ expression *E; @@ E == - 0 + NULL @@ expression *E; @@ E != - 0 + NULL Signed-off-by: Yoann Padioleau <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] ---