Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1579168 > unrolled thread

[PATCH 1/2] arch/x86: Fix sparse warning symbol not declared

Started by"Tobin C. Harding" <me@tobin.cc>
First post2017-02-12 07:50 +0100
Last post2017-02-12 12:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] arch/x86: Fix sparse warning symbol not declared "Tobin C. Harding" <me@tobin.cc> - 2017-02-12 07:50 +0100
    Re: [PATCH 1/2] arch/x86: Fix sparse warning symbol not declared Thomas Gleixner <tglx@linutronix.de> - 2017-02-12 12:00 +0100

#1579168 — [PATCH 1/2] arch/x86: Fix sparse warning symbol not declared

From"Tobin C. Harding" <me@tobin.cc>
Date2017-02-12 07:50 +0100
Subject[PATCH 1/2] arch/x86: Fix sparse warning symbol not declared
Message-ID<t9W8W-2TD-5@gated-at.bofh.it>
This patch adds static declaration to a number of variables. Fixes
sparse symbol was not declared warnings.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 arch/x86/purgatory/purgatory.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/purgatory/purgatory.c b/arch/x86/purgatory/purgatory.c
index 25e068b..2a2cbe5 100644
--- a/arch/x86/purgatory/purgatory.c
+++ b/arch/x86/purgatory/purgatory.c
@@ -18,11 +18,11 @@ struct sha_region {
 	unsigned long len;
 };
 
-unsigned long backup_dest = 0;
-unsigned long backup_src = 0;
-unsigned long backup_sz = 0;
+static unsigned long backup_dest = 0;
+static unsigned long backup_src = 0;
+static unsigned long backup_sz = 0;
 
-u8 sha256_digest[SHA256_DIGEST_SIZE] = { 0 };
+static u8 sha256_digest[SHA256_DIGEST_SIZE] = { 0 };
 
 struct sha_region sha_regions[16] = {};
 
@@ -39,7 +39,7 @@ static int copy_backup_region(void)
 	return 0;
 }
 
-int verify_sha256_digest(void)
+static int verify_sha256_digest(void)
 {
 	struct sha_region *ptr, *end;
 	u8 digest[SHA256_DIGEST_SIZE];
-- 
2.7.4

[toc] | [next] | [standalone]


#1579191

FromThomas Gleixner <tglx@linutronix.de>
Date2017-02-12 12:00 +0100
Message-ID<ta02S-5ge-1@gated-at.bofh.it>
In reply to#1579168
On Sun, 12 Feb 2017, Tobin C. Harding wrote:

A few nitpicks.

> Subject: [PATCH 1/2] arch/x86: Fix sparse warning symbol not declared

arch/x86: is not the correct prefix. Run git log on a file to figure out
what the usual prefix is. The file was checked in with 'purgatory', but I'd
prefer 'x86/purgatory' for future changes.

> This patch adds static declaration to a number of variables. Fixes
> sparse symbol was not declared warnings.

Please read 'Documentation...SubmittingPatches' and look for 'This patch'.

I give you an example for a changelog:

  Sparse emits several 'symbol not declared' warnings.

  Make the variables and functions, which have only file scope static.

Now try to map that to the advise in Documentation.

Thanks,

	tglx

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web