lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1321560192.11312.2.camel@Joe-Laptop>
Date:	Thu, 17 Nov 2011 12:03:12 -0800
From:	Joe Perches <joe@...ches.com>
To:	Thomas Jarosch <thomas.jarosch@...ra2net.com>
Cc:	Joerg Roedel <joerg.roedel@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix comparison using wrong pointer variable in dma
 debug code

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@...ra2net.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;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ