lkml.org 
[lkml]   [2011]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] Fix comparison using wrong pointer variable in dma debug code
    From
    Date
    On Thu, 2011-11-17 at 20:31 +0100, Thomas Jarosch wrote:
    > cppcheck reported:
    > [lib/dma-debug.c:248] -> [lib/dma-debug.c:248]: (style) Same expression on both sides of '=='.
    >
    > Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
    > ---
    > lib/dma-debug.c | 2 +-
    > 1 files changed, 1 insertions(+), 1 deletions(-)
    >
    > diff --git a/lib/dma-debug.c b/lib/dma-debug.c
    > index 74c6c7f..fea790a 100644
    > --- a/lib/dma-debug.c
    > +++ b/lib/dma-debug.c
    > @@ -245,7 +245,7 @@ static void put_hash_bucket(struct hash_bucket *bucket,
    >
    > static bool exact_match(struct dma_debug_entry *a, struct dma_debug_entry *b)
    > {
    > - return ((a->dev_addr == a->dev_addr) &&
    > + return ((a->dev_addr == b->dev_addr) &&
    > (a->dev == b->dev)) ? true : false;
    > }
    >

    Perhaps more sensible without the unnecessary ?:

    return a->dev_addr == b->dev_addr && a->dev == b->dev;



    \
     
     \ /
      Last update: 2011-11-17 21:05    [W:0.019 / U:12.904 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site