Blame 0016-Prevent-static-code-analyzer-confusion.patch
|
Anton Arapov |
32682d |
From 0b5c47c64b6fb3b626c5f75d9dc36bc864907fca Mon Sep 17 00:00:00 2001
|
|
Anton Arapov |
32682d |
From: Jean Delvare <jdelvare@suse.de>
|
|
Anton Arapov |
32682d |
Date: Wed, 7 Sep 2016 22:16:20 +0200
|
|
Anton Arapov |
32682d |
Subject: [PATCH 16/17] Prevent static code analyzer confusion
|
|
Anton Arapov |
32682d |
|
|
Anton Arapov |
32682d |
As reported in bug #48723:
|
|
Anton Arapov |
32682d |
http://savannah.nongnu.org/bugs/?48723
|
|
Anton Arapov |
32682d |
|
|
Anton Arapov |
32682d |
This is a false positive and the static code analyzer output should
|
|
Anton Arapov |
32682d |
be made clearer. Nevertheless we can write the code differently so
|
|
Anton Arapov |
32682d |
that it doesn't trigger a warning.
|
|
Anton Arapov |
32682d |
---
|
|
Anton Arapov |
32682d |
dmidecode.c | 2 +-
|
|
Anton Arapov |
32682d |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Anton Arapov |
32682d |
|
|
Anton Arapov |
32682d |
diff --git a/dmidecode.c b/dmidecode.c
|
|
Anton Arapov |
32682d |
index f929b28..3993592 100644
|
|
Anton Arapov |
32682d |
--- a/dmidecode.c
|
|
Anton Arapov |
32682d |
+++ b/dmidecode.c
|
|
Anton Arapov |
32682d |
@@ -2283,7 +2283,7 @@ static void dmi_memory_device_extended_size(u32 code)
|
|
Anton Arapov |
32682d |
*/
|
|
Anton Arapov |
32682d |
if (code & 0x3FFUL)
|
|
Anton Arapov |
32682d |
printf(" %lu MB", (unsigned long)code);
|
|
Anton Arapov |
32682d |
- else if (code & 0xFFFFFUL)
|
|
Anton Arapov |
32682d |
+ else if (code & 0xFFC00UL)
|
|
Anton Arapov |
32682d |
printf(" %lu GB", (unsigned long)code >> 10);
|
|
Anton Arapov |
32682d |
else
|
|
Anton Arapov |
32682d |
printf(" %lu TB", (unsigned long)code >> 20);
|
|
Anton Arapov |
32682d |
--
|
|
Anton Arapov |
32682d |
2.7.4
|
|
Anton Arapov |
32682d |
|