lkml.org 
[lkml]   [2007]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH 06/68] 0 -> NULL, for arch/frv
    From

    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 <padator@wanadoo.fr>
    Cc: dhowells@redhat.com
    Cc: akpm@linux-foundation.org
    ---

    dma-alloc.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
    index dc6522c..eb67cef 100644
    --- a/arch/frv/mm/dma-alloc.c
    +++ b/arch/frv/mm/dma-alloc.c
    @@ -61,7 +61,7 @@ static int map_page(unsigned long va, un

    /* Use middle 10 bits of VA to index the second-level map */
    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(gfp_t gfp, size_t

    /* allocate some common virtual space to map the new pages */
    area = get_vm_area(size, VM_ALLOC);
    - if (area == 0) {
    + if (area == NULL) {
    free_pages(page, order);
    return NULL;
    }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-07-27 11:51    [W:0.020 / U:300.716 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site