Patchwork [v1,1/2] ACPI / configfs: Mark local functions static

login
register
mail settings
Submitter Andy Shevchenko
Date March 11, 2019, 2:04 p.m.
Message ID <20190311140430.74283-1-andriy.shevchenko@linux.intel.com>
Download mbox | patch
Permalink /patch/746015/
State New
Headers show

Comments

Andy Shevchenko - March 11, 2019, 2:04 p.m.
There is no need to have non-static local functions. otherwise
compiler is not happy:

  CC [M]  drivers/acpi/acpi_configfs.o
drivers/acpi/acpi_configfs.c:105:9: warning: no previous prototype for ‘acpi_table_signature_show’ [-Wmissing-prototypes]
 ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
         ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/acpi_configfs.c:115:9: warning: no previous prototype for ‘acpi_table_length_show’ [-Wmissing-prototypes]
 ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
         ^~~~~~~~~~~~~~~~~~~~~~
...

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/acpi_configfs.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
Rafael J. Wysocki - March 13, 2019, 9:55 a.m.
On Monday, March 11, 2019 3:04:29 PM CET Andy Shevchenko wrote:
> There is no need to have non-static local functions. otherwise
> compiler is not happy:
> 
>   CC [M]  drivers/acpi/acpi_configfs.o
> drivers/acpi/acpi_configfs.c:105:9: warning: no previous prototype for ‘acpi_table_signature_show’ [-Wmissing-prototypes]
>  ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
>          ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/acpi/acpi_configfs.c:115:9: warning: no previous prototype for ‘acpi_table_length_show’ [-Wmissing-prototypes]
>  ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
>          ^~~~~~~~~~~~~~~~~~~~~~
> ...
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/acpi/acpi_configfs.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
> index b58850389094..78bb6ad1aa26 100644
> --- a/drivers/acpi/acpi_configfs.c
> +++ b/drivers/acpi/acpi_configfs.c
> @@ -102,7 +102,7 @@ struct configfs_bin_attribute *acpi_table_bin_attrs[] = {
>  	NULL,
>  };
>  
> -ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
> +static ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> @@ -112,7 +112,7 @@ ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
>  	return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->signature);
>  }
>  
> -ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
> +static ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> @@ -122,7 +122,7 @@ ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
>  	return sprintf(str, "%d\n", h->length);
>  }
>  
> -ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
> +static ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> @@ -132,7 +132,7 @@ ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
>  	return sprintf(str, "%d\n", h->revision);
>  }
>  
> -ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
> +static ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> @@ -142,7 +142,7 @@ ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
>  	return sprintf(str, "%.*s\n", ACPI_OEM_ID_SIZE, h->oem_id);
>  }
>  
> -ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
> +static ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> @@ -152,7 +152,7 @@ ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
>  	return sprintf(str, "%.*s\n", ACPI_OEM_TABLE_ID_SIZE, h->oem_table_id);
>  }
>  
> -ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
> +static ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> @@ -162,7 +162,8 @@ ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
>  	return sprintf(str, "%d\n", h->oem_revision);
>  }
>  
> -ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, char *str)
> +static ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg,
> +					       char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> @@ -172,8 +173,8 @@ ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, char *str)
>  	return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->asl_compiler_id);
>  }
>  
> -ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
> -					      char *str)
> +static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
> +						     char *str)
>  {
>  	struct acpi_table_header *h = get_header(cfg);
>  
> 

Applied along with the [2/2], thanks!

Patch

diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
index b58850389094..78bb6ad1aa26 100644
--- a/drivers/acpi/acpi_configfs.c
+++ b/drivers/acpi/acpi_configfs.c
@@ -102,7 +102,7 @@  struct configfs_bin_attribute *acpi_table_bin_attrs[] = {
 	NULL,
 };
 
-ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
+static ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);
 
@@ -112,7 +112,7 @@  ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
 	return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->signature);
 }
 
-ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
+static ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);
 
@@ -122,7 +122,7 @@  ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
 	return sprintf(str, "%d\n", h->length);
 }
 
-ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
+static ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);
 
@@ -132,7 +132,7 @@  ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
 	return sprintf(str, "%d\n", h->revision);
 }
 
-ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
+static ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);
 
@@ -142,7 +142,7 @@  ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
 	return sprintf(str, "%.*s\n", ACPI_OEM_ID_SIZE, h->oem_id);
 }
 
-ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
+static ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);
 
@@ -152,7 +152,7 @@  ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
 	return sprintf(str, "%.*s\n", ACPI_OEM_TABLE_ID_SIZE, h->oem_table_id);
 }
 
-ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
+static ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);
 
@@ -162,7 +162,8 @@  ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
 	return sprintf(str, "%d\n", h->oem_revision);
 }
 
-ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, char *str)
+static ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg,
+					       char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);
 
@@ -172,8 +173,8 @@  ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, char *str)
 	return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->asl_compiler_id);
 }
 
-ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
-					      char *str)
+static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
+						     char *str)
 {
 	struct acpi_table_header *h = get_header(cfg);