* [PATCH] Fix comparison using wrong pointer variable in dma debug code
@ 2011-11-17 19:31 Thomas Jarosch
2011-11-17 20:01 ` Neil Horman
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Thomas Jarosch @ 2011-11-17 19:31 UTC (permalink / raw)
To: Joerg Roedel; +Cc: linux-kernel
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;
}
--
1.7.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] Fix comparison using wrong pointer variable in dma debug code
2011-11-17 19:31 [PATCH] Fix comparison using wrong pointer variable in dma debug code Thomas Jarosch
@ 2011-11-17 20:01 ` Neil Horman
2011-11-18 16:47 ` Thomas Jarosch
2011-11-17 20:03 ` Joe Perches
2011-11-21 10:37 ` Joerg Roedel
2 siblings, 1 reply; 5+ messages in thread
From: Neil Horman @ 2011-11-17 20:01 UTC (permalink / raw)
To: Thomas Jarosch; +Cc: Joerg Roedel, linux-kernel
On Thu, Nov 17, 2011 at 08:31:02PM +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;
> }
>
> --
> 1.7.6.4
>
> --
> 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/
>
Thanks for the catch! Viro just pointed out you can also remove the ?
true/false changes and extraneous parens, reducing it to:
(a->dev_addr == b->dev_addr) && (a->dev == b->dev)
But its not strictly necessecary
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix comparison using wrong pointer variable in dma debug code
2011-11-17 20:01 ` Neil Horman
@ 2011-11-18 16:47 ` Thomas Jarosch
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Jarosch @ 2011-11-18 16:47 UTC (permalink / raw)
To: Neil Horman; +Cc: Joerg Roedel, linux-kernel
On Thursday, 17. November 2011 21:01:36 Neil Horman wrote:
> Thanks for the catch! Viro just pointed out you can also remove the ?
> true/false changes and extraneous parens, reducing it to:
>
> (a->dev_addr == b->dev_addr) && (a->dev == b->dev)
> But its not strictly necessecary
>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
I'd say just commit the fix, that rarely used function
is not worth the extra effort.
Cheers,
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix comparison using wrong pointer variable in dma debug code
2011-11-17 19:31 [PATCH] Fix comparison using wrong pointer variable in dma debug code Thomas Jarosch
2011-11-17 20:01 ` Neil Horman
@ 2011-11-17 20:03 ` Joe Perches
2011-11-21 10:37 ` Joerg Roedel
2 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2011-11-17 20:03 UTC (permalink / raw)
To: Thomas Jarosch; +Cc: Joerg Roedel, linux-kernel
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;
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix comparison using wrong pointer variable in dma debug code
2011-11-17 19:31 [PATCH] Fix comparison using wrong pointer variable in dma debug code Thomas Jarosch
2011-11-17 20:01 ` Neil Horman
2011-11-17 20:03 ` Joe Perches
@ 2011-11-21 10:37 ` Joerg Roedel
2 siblings, 0 replies; 5+ messages in thread
From: Joerg Roedel @ 2011-11-21 10:37 UTC (permalink / raw)
To: Thomas Jarosch; +Cc: linux-kernel
On Thu, Nov 17, 2011 at 08:31:02PM +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>
Applied to iommu/fixes, thanks.
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-21 10:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 19:31 [PATCH] Fix comparison using wrong pointer variable in dma debug code Thomas Jarosch
2011-11-17 20:01 ` Neil Horman
2011-11-18 16:47 ` Thomas Jarosch
2011-11-17 20:03 ` Joe Perches
2011-11-21 10:37 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox