[OPW,kernel] Staging: crystalhd: Fix sparse warnings regarding static functions
diff mbox

Message ID 1381083198-31200-1-git-send-email-valentina.manea.m@gmail.com
State Changes Requested
Headers show

Commit Message

Valentina Manea Oct. 6, 2013, 6:13 p.m. UTC
This fixes the following sparse warnings:
* drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning:
symbol 'chd_dec_alloc_iodata' was not declared. Should it be static?
* drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning:
symbol 'chd_dec_free_iodata' was not declared. Should it be static?
* drivers/staging/crystalhd/crystalhd_lnx.c:630:5: warning:
symbol 'chd_dec_pci_suspend' was not declared. Should it be static?
* drivers/staging/crystalhd/crystalhd_lnx.c:664:5: warning:
symbol 'chd_dec_pci_resume' was not declared. Should it be static?

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
---
 drivers/staging/crystalhd/crystalhd_lnx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Josh Triplett Oct. 6, 2013, 9:27 p.m. UTC | #1
On Sun, Oct 06, 2013 at 09:13:18PM +0300, Valentina Manea wrote:
> This fixes the following sparse warnings:
> * drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning:
> symbol 'chd_dec_alloc_iodata' was not declared. Should it be static?
> * drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning:
> symbol 'chd_dec_free_iodata' was not declared. Should it be static?
> * drivers/staging/crystalhd/crystalhd_lnx.c:630:5: warning:
> symbol 'chd_dec_pci_suspend' was not declared. Should it be static?
> * drivers/staging/crystalhd/crystalhd_lnx.c:664:5: warning:
> symbol 'chd_dec_pci_resume' was not declared. Should it be static?
> 
> Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>

Very nice work!  One minor nit below, but otherwise this looks perfect.

> ---
>  drivers/staging/crystalhd/crystalhd_lnx.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
> index b17fbf8..4d64759 100644
> --- a/drivers/staging/crystalhd/crystalhd_lnx.c
> +++ b/drivers/staging/crystalhd/crystalhd_lnx.c
> @@ -75,6 +75,7 @@ static int chd_dec_disable_int(struct crystalhd_adp *adp)
>  	return 0;
>  }
>  
> +static
>  struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp,
>  					 bool isr)

Please be consistent with formatting: put "static" on the same line as
the function declaration, as you did with the other three functions
below.

>  {
> @@ -96,7 +97,7 @@ struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp,
>  	return temp;
>  }
>  
> -void chd_dec_free_iodata(struct crystalhd_adp *adp,
> +static void chd_dec_free_iodata(struct crystalhd_adp *adp,
>  			 struct crystalhd_ioctl_data *iodata, bool isr)
>  {
>  	unsigned long flags = 0;
> @@ -627,7 +628,7 @@ err:
>  }
>  
>  #ifdef CONFIG_PM
> -int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
> +static int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
>  {
>  	struct crystalhd_adp *adp;
>  	struct crystalhd_ioctl_data *temp;
> @@ -661,7 +662,7 @@ int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
>  	return 0;
>  }
>  
> -int chd_dec_pci_resume(struct pci_dev *pdev)
> +static int chd_dec_pci_resume(struct pci_dev *pdev)
>  {
>  	struct crystalhd_adp *adp;
>  	enum BC_STATUS sts = BC_STS_SUCCESS;
> -- 
> 1.8.1.2
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Patch
diff mbox

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index b17fbf8..4d64759 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -75,6 +75,7 @@  static int chd_dec_disable_int(struct crystalhd_adp *adp)
 	return 0;
 }
 
+static
 struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp,
 					 bool isr)
 {
@@ -96,7 +97,7 @@  struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp,
 	return temp;
 }
 
-void chd_dec_free_iodata(struct crystalhd_adp *adp,
+static void chd_dec_free_iodata(struct crystalhd_adp *adp,
 			 struct crystalhd_ioctl_data *iodata, bool isr)
 {
 	unsigned long flags = 0;
@@ -627,7 +628,7 @@  err:
 }
 
 #ifdef CONFIG_PM
-int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
+static int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
 	struct crystalhd_adp *adp;
 	struct crystalhd_ioctl_data *temp;
@@ -661,7 +662,7 @@  int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 	return 0;
 }
 
-int chd_dec_pci_resume(struct pci_dev *pdev)
+static int chd_dec_pci_resume(struct pci_dev *pdev)
 {
 	struct crystalhd_adp *adp;
 	enum BC_STATUS sts = BC_STS_SUCCESS;