public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe()
@ 2013-08-01  6:30 Jingoo Han
  2013-08-01 16:18 ` Dinh Nguyen
  2013-08-09 13:31 ` Seungwon Jeon
  0 siblings, 2 replies; 6+ messages in thread
From: Jingoo Han @ 2013-08-01  6:30 UTC (permalink / raw)
  To: Chris Ball
  Cc: linux-mmc, Seungwon Jeon, Jaehoon Chung, Dinh Nguyen, Jingoo Han

dw_mci_socfpga_probe() is used only in this file.
Fix the following sparse warning:

drivers/mmc/host/dw_mmc-socfpga.c:116:5: warning: symbol 'dw_mci_socfpga_probe' was not declared. Should it be static?

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/mmc/host/dw_mmc-socfpga.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc-socfpga.c b/drivers/mmc/host/dw_mmc-socfpga.c
index 14b5961..35aebb8 100644
--- a/drivers/mmc/host/dw_mmc-socfpga.c
+++ b/drivers/mmc/host/dw_mmc-socfpga.c
@@ -113,7 +113,7 @@ static const struct of_device_id dw_mci_socfpga_match[] = {
 };
 MODULE_DEVICE_TABLE(of, dw_mci_socfpga_match);
 
-int dw_mci_socfpga_probe(struct platform_device *pdev)
+static int dw_mci_socfpga_probe(struct platform_device *pdev)
 {
 	const struct dw_mci_drv_data *drv_data;
 	const struct of_device_id *match;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe()
  2013-08-01  6:30 [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe() Jingoo Han
@ 2013-08-01 16:18 ` Dinh Nguyen
  2013-08-02  0:11   ` Jingoo Han
  2013-08-09 13:31 ` Seungwon Jeon
  1 sibling, 1 reply; 6+ messages in thread
From: Dinh Nguyen @ 2013-08-01 16:18 UTC (permalink / raw)
  To: Jingoo Han; +Cc: Chris Ball, linux-mmc, Seungwon Jeon, Jaehoon Chung

Hi,

On Thu, 2013-08-01 at 15:30 +0900, Jingoo Han wrote:
> dw_mci_socfpga_probe() is used only in this file.
> Fix the following sparse warning:
> 
> drivers/mmc/host/dw_mmc-socfpga.c:116:5: warning: symbol 'dw_mci_socfpga_probe' was not declared. Should it be static?
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/mmc/host/dw_mmc-socfpga.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc-socfpga.c b/drivers/mmc/host/dw_mmc-socfpga.c
> index 14b5961..35aebb8 100644
> --- a/drivers/mmc/host/dw_mmc-socfpga.c
> +++ b/drivers/mmc/host/dw_mmc-socfpga.c
> @@ -113,7 +113,7 @@ static const struct of_device_id dw_mci_socfpga_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, dw_mci_socfpga_match);
>  
> -int dw_mci_socfpga_probe(struct platform_device *pdev)
> +static int dw_mci_socfpga_probe(struct platform_device *pdev)
>  {
>  	const struct dw_mci_drv_data *drv_data;
>  	const struct of_device_id *match;

This looks good but do you care to fix the other sparse warnings for
dw_mmc-pltfm.c too?

drivers/mmc/host/dw_mmc-pltfm.c:58:24: warning: incorrect type in
argument 1 (different address spaces)
drivers/mmc/host/dw_mmc-pltfm.c:58:24:    expected void const *ptr
drivers/mmc/host/dw_mmc-pltfm.c:58:24:    got void [noderef]
<asn:2>*regs
drivers/mmc/host/dw_mmc-pltfm.c:59:36: warning: incorrect type in
argument 1 (different address spaces)
drivers/mmc/host/dw_mmc-pltfm.c:59:36:    expected void const *ptr
drivers/mmc/host/dw_mmc-pltfm.c:59:36:    got void [noderef]
<asn:2>*regs
drivers/mmc/host/dw_mmc-pltfm.c:36:5: warning: symbol
'dw_mci_pltfm_register' was not declared. Should it be static?
drivers/mmc/host/dw_mmc-pltfm.c:94:1: warning: symbol
'dw_mci_pltfm_pmops' was not declared. Should it be static?

Dinh



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe()
  2013-08-01 16:18 ` Dinh Nguyen
@ 2013-08-02  0:11   ` Jingoo Han
  2013-08-02  8:34     ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: Jingoo Han @ 2013-08-02  0:11 UTC (permalink / raw)
  To: 'Dinh Nguyen'
  Cc: 'Chris Ball', linux-mmc, 'Seungwon Jeon',
	'Jaehoon Chung', Dan Carpenter, Jingoo Han

On Friday, August 02, 2013 1:19 AM, Dinh Nguyen wrote:
> On Thu, 2013-08-01 at 15:30 +0900, Jingoo Han wrote:
> > dw_mci_socfpga_probe() is used only in this file.
> > Fix the following sparse warning:
> >
> > drivers/mmc/host/dw_mmc-socfpga.c:116:5: warning: symbol 'dw_mci_socfpga_probe' was not declared.
> Should it be static?
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > ---
> >  drivers/mmc/host/dw_mmc-socfpga.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/dw_mmc-socfpga.c b/drivers/mmc/host/dw_mmc-socfpga.c
> > index 14b5961..35aebb8 100644
> > --- a/drivers/mmc/host/dw_mmc-socfpga.c
> > +++ b/drivers/mmc/host/dw_mmc-socfpga.c
> > @@ -113,7 +113,7 @@ static const struct of_device_id dw_mci_socfpga_match[] = {
> >  };
> >  MODULE_DEVICE_TABLE(of, dw_mci_socfpga_match);
> >
> > -int dw_mci_socfpga_probe(struct platform_device *pdev)
> > +static int dw_mci_socfpga_probe(struct platform_device *pdev)
> >  {
> >  	const struct dw_mci_drv_data *drv_data;
> >  	const struct of_device_id *match;
> 
> This looks good but do you care to fix the other sparse warnings for
> dw_mmc-pltfm.c too?

+CC Dan Carpenter,

I will not care fix the other sparse warnings for dw_mmc-pltfm.c.

> 
> drivers/mmc/host/dw_mmc-pltfm.c:58:24: warning: incorrect type in
> argument 1 (different address spaces)
> drivers/mmc/host/dw_mmc-pltfm.c:58:24:    expected void const *ptr
> drivers/mmc/host/dw_mmc-pltfm.c:58:24:    got void [noderef]
> <asn:2>*regs
> drivers/mmc/host/dw_mmc-pltfm.c:59:36: warning: incorrect type in
> argument 1 (different address spaces)
> drivers/mmc/host/dw_mmc-pltfm.c:59:36:    expected void const *ptr
> drivers/mmc/host/dw_mmc-pltfm.c:59:36:    got void [noderef]
> <asn:2>*regs

You mean the following.

58 if (IS_ERR(host->regs))
59                return PTR_ERR(host->regs);

>From v3.11-rc1, it does not make sparse warnings,
because of the commit e7152b9 "err.h: IS_ERR() can accept __user pointers"
submitted by Dan Carpenter.


> drivers/mmc/host/dw_mmc-pltfm.c:36:5: warning: symbol
> 'dw_mci_pltfm_register' was not declared. Should it be static?
> drivers/mmc/host/dw_mmc-pltfm.c:94:1: warning: symbol
> 'dw_mci_pltfm_pmops' was not declared. Should it be static?

'dw_mci_pltfm_register' and 'dw_mci_pltfm_pmops' are exported as below:

70: EXPORT_SYMBOL_GPL(dw_mci_pltfm_register);
95: EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);

So, I am not sure whether these can be static or not. :(
Dan, if you know how to handle this, please let me know.


Best regards,
Jingoo Han


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe()
  2013-08-02  0:11   ` Jingoo Han
@ 2013-08-02  8:34     ` Dan Carpenter
  2013-08-06  1:30       ` Jingoo Han
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2013-08-02  8:34 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Dinh Nguyen', 'Chris Ball', linux-mmc,
	'Seungwon Jeon', 'Jaehoon Chung'

On Fri, Aug 02, 2013 at 09:11:19AM +0900, Jingoo Han wrote:
> On Friday, August 02, 2013 1:19 AM, Dinh Nguyen wrote:
> > drivers/mmc/host/dw_mmc-pltfm.c:58:24: warning: incorrect type in
> > argument 1 (different address spaces)
> > drivers/mmc/host/dw_mmc-pltfm.c:58:24:    expected void const *ptr
> > drivers/mmc/host/dw_mmc-pltfm.c:58:24:    got void [noderef]
> > <asn:2>*regs
> > drivers/mmc/host/dw_mmc-pltfm.c:59:36: warning: incorrect type in
> > argument 1 (different address spaces)
> > drivers/mmc/host/dw_mmc-pltfm.c:59:36:    expected void const *ptr
> > drivers/mmc/host/dw_mmc-pltfm.c:59:36:    got void [noderef]
> > <asn:2>*regs
> 
> You mean the following.
> 
> 58 if (IS_ERR(host->regs))
> 59                return PTR_ERR(host->regs);
> 
> >From v3.11-rc1, it does not make sparse warnings,
> because of the commit e7152b9 "err.h: IS_ERR() can accept __user pointers"
> submitted by Dan Carpenter.

You have to upgrade to a later version of Sparse as well.

> 
> 
> > drivers/mmc/host/dw_mmc-pltfm.c:36:5: warning: symbol
> > 'dw_mci_pltfm_register' was not declared. Should it be static?
> > drivers/mmc/host/dw_mmc-pltfm.c:94:1: warning: symbol
> > 'dw_mci_pltfm_pmops' was not declared. Should it be static?
> 
> 'dw_mci_pltfm_register' and 'dw_mci_pltfm_pmops' are exported as below:
> 
> 70: EXPORT_SYMBOL_GPL(dw_mci_pltfm_register);
> 95: EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);
> 
> So, I am not sure whether these can be static or not. :(
> Dan, if you know how to handle this, please let me know.

No, don't make these static.  The way to silence this warning is to
include "dw_mmc-pltfm.h".

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe()
  2013-08-02  8:34     ` Dan Carpenter
@ 2013-08-06  1:30       ` Jingoo Han
  0 siblings, 0 replies; 6+ messages in thread
From: Jingoo Han @ 2013-08-06  1:30 UTC (permalink / raw)
  To: 'Dan Carpenter'
  Cc: 'Dinh Nguyen', 'Chris Ball', linux-mmc,
	'Seungwon Jeon', 'Jaehoon Chung', Jingoo Han

On Friday, August 02, 2013 5:34 PM, Dan Carpenter wrote:
> On Fri, Aug 02, 2013 at 09:11:19AM +0900, Jingoo Han wrote:
> > On Friday, August 02, 2013 1:19 AM, Dinh Nguyen wrote:

[...]

> > > drivers/mmc/host/dw_mmc-pltfm.c:36:5: warning: symbol
> > > 'dw_mci_pltfm_register' was not declared. Should it be static?
> > > drivers/mmc/host/dw_mmc-pltfm.c:94:1: warning: symbol
> > > 'dw_mci_pltfm_pmops' was not declared. Should it be static?
> >
> > 'dw_mci_pltfm_register' and 'dw_mci_pltfm_pmops' are exported as below:
> >
> > 70: EXPORT_SYMBOL_GPL(dw_mci_pltfm_register);
> > 95: EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);
> >
> > So, I am not sure whether these can be static or not. :(
> > Dan, if you know how to handle this, please let me know.
> 
> No, don't make these static.  The way to silence this warning is to
> include "dw_mmc-pltfm.h".

I really appreciate your answer. :)
Then, I will send the patch to include "dw_mmc-pltfm.h".

Best regards,
Jingoo Han


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe()
  2013-08-01  6:30 [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe() Jingoo Han
  2013-08-01 16:18 ` Dinh Nguyen
@ 2013-08-09 13:31 ` Seungwon Jeon
  1 sibling, 0 replies; 6+ messages in thread
From: Seungwon Jeon @ 2013-08-09 13:31 UTC (permalink / raw)
  To: 'Jingoo Han', 'Chris Ball'
  Cc: linux-mmc, 'Jaehoon Chung', 'Dinh Nguyen'

On Thu, August 01, 2013, Jingoo Han wrote:
> dw_mci_socfpga_probe() is used only in this file.
> Fix the following sparse warning:
> 
> drivers/mmc/host/dw_mmc-socfpga.c:116:5: warning: symbol 'dw_mci_socfpga_probe' was not declared.
> Should it be static?
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Acked-by: Seungwon Jeon <tgih.jun@samsung.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-09 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01  6:30 [PATCH 1/2] mmc: dw_mmc-socfpga: Staticize dw_mci_socfpga_probe() Jingoo Han
2013-08-01 16:18 ` Dinh Nguyen
2013-08-02  0:11   ` Jingoo Han
2013-08-02  8:34     ` Dan Carpenter
2013-08-06  1:30       ` Jingoo Han
2013-08-09 13:31 ` Seungwon Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox