Skip to content

Commit e98fe51

Browse files
tchardingKAGA-KOKO
authored andcommitted
x86/purgatory: Fix sparse warning, symbol not declared
Sparse emits warning, 'symbol not declared' for a function that has neither file scope nor a forward declaration. The functions only call site is an ASM file. Add a header file with the function declaration. Include the header file in the C source file defining the function in order to fix the sparse warning. Include the header file in ASM file containing the call site to document the usage. Signed-off-by: Tobin C. Harding <me@tobin.cc> Link: http://lkml.kernel.org/r/1487545956-2547-3-git-send-email-me@tobin.cc Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 72042a8 commit e98fe51

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

arch/x86/purgatory/purgatory.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
#include "sha256.h"
14+
#include "purgatory.h"
1415
#include "../boot/string.h"
1516

1617
struct sha_region {

arch/x86/purgatory/purgatory.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef PURGATORY_H
2+
#define PURGATORY_H
3+
4+
#ifndef __ASSEMBLY__
5+
extern void purgatory(void);
6+
#endif /* __ASSEMBLY__ */
7+
8+
#endif /* PURGATORY_H */

arch/x86/purgatory/setup-x86_64.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* This source code is licensed under the GNU General Public License,
1010
* Version 2. See the file COPYING for more details.
1111
*/
12+
#include "purgatory.h"
1213

1314
.text
1415
.globl purgatory_start

0 commit comments

Comments
 (0)