[1/2] x86/speculation: add cpu_show_gds() prototype

Message ID 20230809130530.1913368-1-arnd@kernel.org
State New
Headers
Series [1/2] x86/speculation: add cpu_show_gds() prototype |

Commit Message

Arnd Bergmann Aug. 9, 2023, 1:04 p.m. UTC
  From: Arnd Bergmann <arnd@arndb.de>

The newly added function has two definitions but no prototypes:

drivers/base/cpu.c:605:16: error: no previous prototype for 'cpu_show_gds' [-Werror=missing-prototypes]

Add a declaration next to the other ones for this file to avoid the
warning.

Fixes: 8974eb588283b ("x86/speculation: Add Gather Data Sampling mitigation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/cpu.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Daniel Sneddon Aug. 9, 2023, 3:46 p.m. UTC | #1
On 8/9/23 06:04, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The newly added function has two definitions but no prototypes:
> 
> drivers/base/cpu.c:605:16: error: no previous prototype for 'cpu_show_gds' [-Werror=missing-prototypes]
> 
> Add a declaration next to the other ones for this file to avoid the
> warning.
> 
> Fixes: 8974eb588283b ("x86/speculation: Add Gather Data Sampling mitigation")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  include/linux/cpu.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/cpu.h b/include/linux/cpu.h
> index 9d43b734170d6..0abd60a7987b6 100644
> --- a/include/linux/cpu.h
> +++ b/include/linux/cpu.h
> @@ -73,6 +73,8 @@ extern ssize_t cpu_show_retbleed(struct device *dev,
>  				 struct device_attribute *attr, char *buf);
>  extern ssize_t cpu_show_spec_rstack_overflow(struct device *dev,
>  					     struct device_attribute *attr, char *buf);
> +extern ssize_t cpu_show_gds(struct device *dev,
> +			    struct device_attribute *attr, char *buf);
>  
>  extern __printf(4, 5)
>  struct device *cpu_device_create(struct device *parent, void *drvdata,

Sorry I missed that. Shouldn't stable be CC'd here as well?

Thanks,
Dan
  
Dave Hansen Aug. 9, 2023, 10:13 p.m. UTC | #2
On 8/9/23 06:04, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The newly added function has two definitions but no prototypes:

Thanks for these, Arnd.  We'll get these up to Linus, probably alongside
some of the other fixes for the other hardware issues that got mitigated
this week.
  

Patch

diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 9d43b734170d6..0abd60a7987b6 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -73,6 +73,8 @@  extern ssize_t cpu_show_retbleed(struct device *dev,
 				 struct device_attribute *attr, char *buf);
 extern ssize_t cpu_show_spec_rstack_overflow(struct device *dev,
 					     struct device_attribute *attr, char *buf);
+extern ssize_t cpu_show_gds(struct device *dev,
+			    struct device_attribute *attr, char *buf);
 
 extern __printf(4, 5)
 struct device *cpu_device_create(struct device *parent, void *drvdata,