linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atyfb_base.c: fix warning
@ 2008-07-30 21:03 Alexander Beregalov
  2008-07-31  1:14 ` M. Asselstine
  2008-07-31  9:15 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Beregalov @ 2008-07-30 21:03 UTC (permalink / raw)
  To: syrjala, adaplas, linux-fbdev-devel, kernel-janitors,
	linux-kernel

From: Alexander Beregalov <a.beregalov@gmail.com>

atyfb_base.c: fix warning

drivers/video/aty/atyfb_base.c:2663: warning: 'aty_resume_chip' defined
but not used

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Antonino A. Daplas <adaplas@pol.net>
---

 drivers/video/aty/atyfb_base.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 620ba81..9e5dfb1 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -244,7 +244,9 @@ static int atyfb_sync(struct fb_info *info);
      */
 
 static int aty_init(struct fb_info *info);
+#if defined(CONFIG_PM) && defined(CONFIG_PCI)
 static void aty_resume_chip(struct fb_info *info);
+#endif
 #ifdef CONFIG_ATARI
 static int store_video_par(char *videopar, unsigned char m64_num);
 #endif
@@ -2659,6 +2661,7 @@ aty_init_exit:
 	return ret;
 }
 
+#if defined(CONFIG_PM) && defined(CONFIG_PCI)
 static void aty_resume_chip(struct fb_info *info)
 {
 	struct atyfb_par *par = info->par;
@@ -2671,6 +2674,7 @@ static void aty_resume_chip(struct fb_info *info)
 	if (par->aux_start)
 		aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
 }
+#endif /* defined(CONFIG_PM) && defined(CONFIG_PCI) */
 
 #ifdef CONFIG_ATARI
 static int __devinit store_video_par(char *video_str, unsigned char m64_num)

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

* Re: [PATCH] atyfb_base.c: fix warning
  2008-07-30 21:03 [PATCH] atyfb_base.c: fix warning Alexander Beregalov
@ 2008-07-31  1:14 ` M. Asselstine
  2008-07-31  9:15 ` Andrew Morton
  1 sibling, 0 replies; 5+ messages in thread
From: M. Asselstine @ 2008-07-31  1:14 UTC (permalink / raw)
  To: Alexander Beregalov
  Cc: syrjala, adaplas, linux-fbdev-devel, kernel-janitors,
	linux-kernel

On Wed, Jul 30, 2008 at 5:03 PM, Alexander Beregalov
<a.beregalov@gmail.com> wrote:
> From: Alexander Beregalov <a.beregalov@gmail.com>
>
> atyfb_base.c: fix warning
>
> drivers/video/aty/atyfb_base.c:2663: warning: 'aty_resume_chip' defined
> but not used
>
> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
> Cc: Ville Syrjala <syrjala@sci.fi>
> Cc: Antonino A. Daplas <adaplas@pol.net>

Looks good, should you maybe move the aty_resume_chip() up into the
existing #if defined(CONFIG_PM) &&... that atyfb_pci_resume() is in?
Not sure, just a thought.

Reviewed-by: Mark Asselstine <asselsm@gmail.com>

> ---
>
>  drivers/video/aty/atyfb_base.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
> index 620ba81..9e5dfb1 100644
> --- a/drivers/video/aty/atyfb_base.c
> +++ b/drivers/video/aty/atyfb_base.c
> @@ -244,7 +244,9 @@ static int atyfb_sync(struct fb_info *info);
>      */
>
>  static int aty_init(struct fb_info *info);
> +#if defined(CONFIG_PM) && defined(CONFIG_PCI)
>  static void aty_resume_chip(struct fb_info *info);
> +#endif
>  #ifdef CONFIG_ATARI
>  static int store_video_par(char *videopar, unsigned char m64_num);
>  #endif
> @@ -2659,6 +2661,7 @@ aty_init_exit:
>        return ret;
>  }
>
> +#if defined(CONFIG_PM) && defined(CONFIG_PCI)
>  static void aty_resume_chip(struct fb_info *info)
>  {
>        struct atyfb_par *par = info->par;
> @@ -2671,6 +2674,7 @@ static void aty_resume_chip(struct fb_info *info)
>        if (par->aux_start)
>                aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
>  }
> +#endif /* defined(CONFIG_PM) && defined(CONFIG_PCI) */
>
>  #ifdef CONFIG_ATARI
>  static int __devinit store_video_par(char *video_str, unsigned char m64_num)
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] atyfb_base.c: fix warning
@ 2008-07-31  8:29 krzysztof.h1
  0 siblings, 0 replies; 5+ messages in thread
From: krzysztof.h1 @ 2008-07-31  8:29 UTC (permalink / raw)
  To: M. Asselstine, Alexander Beregalov
  Cc: linux-fbdev-devel@lists.sourceforge.net, syrjala@sci.fi,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	adaplas@gmail.com

> On Wed, Jul 30, 2008 at 5:03 PM, Alexander Beregalov
> <a.beregalov@gmail.com> wrote:
> > From: Alexander Beregalov <a.beregalov@gmail.com>
> >
> > atyfb_base.c: fix warning
> >
> > drivers/video/aty/atyfb_base.c:2663: warning: 'aty_resume_chip' defined
> > but not used
> >
> > Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
> > Cc: Ville Syrjala <syrjala@sci.fi>
> > Cc: Antonino A. Daplas <adaplas@pol.net>
> 
> Looks good, should you maybe move the aty_resume_chip() up into the
> existing #if defined(CONFIG_PM) &&... that atyfb_pci_resume() is in?
> Not sure, just a thought.
> 

The same thought has crossed my mind. Kill the forward declaration and move this short function before atyfb_pci_resume().

Regards,
Krzysztof 


----------------------------------------------------------------------
W kosciele tez zdarzaja sie wpadki!
Smieszny filmik >>> http://link.interia.pl/f1e61


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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

* Re: [PATCH] atyfb_base.c: fix warning
  2008-07-30 21:03 [PATCH] atyfb_base.c: fix warning Alexander Beregalov
  2008-07-31  1:14 ` M. Asselstine
@ 2008-07-31  9:15 ` Andrew Morton
  2008-07-31 12:47   ` M. Asselstine
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-07-31  9:15 UTC (permalink / raw)
  To: Alexander Beregalov
  Cc: kernel-janitors, syrjala, linux-fbdev-devel, linux-kernel,
	adaplas

On Thu, 31 Jul 2008 01:03:52 +0400 Alexander Beregalov <a.beregalov@gmail.com> wrote:

> From: Alexander Beregalov <a.beregalov@gmail.com>
> 
> atyfb_base.c: fix warning
> 
> drivers/video/aty/atyfb_base.c:2663: warning: 'aty_resume_chip' defined
> but not used
> 
> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
> Cc: Ville Syrjala <syrjala@sci.fi>
> Cc: Antonino A. Daplas <adaplas@pol.net>
> ---
> 
>  drivers/video/aty/atyfb_base.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
> index 620ba81..9e5dfb1 100644
> --- a/drivers/video/aty/atyfb_base.c
> +++ b/drivers/video/aty/atyfb_base.c
> @@ -244,7 +244,9 @@ static int atyfb_sync(struct fb_info *info);
>       */
>  
>  static int aty_init(struct fb_info *info);
> +#if defined(CONFIG_PM) && defined(CONFIG_PCI)
>  static void aty_resume_chip(struct fb_info *info);
> +#endif
>  #ifdef CONFIG_ATARI
>  static int store_video_par(char *videopar, unsigned char m64_num);
>  #endif
> @@ -2659,6 +2661,7 @@ aty_init_exit:
>  	return ret;
>  }
>  
> +#if defined(CONFIG_PM) && defined(CONFIG_PCI)
>  static void aty_resume_chip(struct fb_info *info)
>  {
>  	struct atyfb_par *par = info->par;
> @@ -2671,6 +2674,7 @@ static void aty_resume_chip(struct fb_info *info)
>  	if (par->aux_start)
>  		aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
>  }
> +#endif /* defined(CONFIG_PM) && defined(CONFIG_PCI) */
>  
>  #ifdef CONFIG_ATARI
>  static int __devinit store_video_par(char *video_str, unsigned char m64_num)

OK...

We don't strictly need the first ifdef - it's OK to declare a
non-existent function, and ifdefs are ugly.

But we can reorganise the code a bit more and remove the forward
declaration altogether and remove a whole ifdef block too.

How does this look?

 drivers/video/aty/atyfb_base.c |   29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff -puN drivers/video/aty/atyfb_base.c~atyfb_basec-fix-warning drivers/video/aty/atyfb_base.c
--- a/drivers/video/aty/atyfb_base.c~atyfb_basec-fix-warning
+++ a/drivers/video/aty/atyfb_base.c
@@ -244,7 +244,7 @@ static int atyfb_sync(struct fb_info *in
      */
 
 static int aty_init(struct fb_info *info);
-static void aty_resume_chip(struct fb_info *info);
+
 #ifdef CONFIG_ATARI
 static int store_video_par(char *videopar, unsigned char m64_num);
 #endif
@@ -2023,6 +2023,20 @@ static int atyfb_pci_suspend(struct pci_
 	return 0;
 }
 
+static void aty_resume_chip(struct fb_info *info)
+{
+	struct atyfb_par *par = info->par;
+
+	aty_st_le32(MEM_CNTL, par->mem_cntl, par);
+
+	if (par->pll_ops->resume_pll)
+		par->pll_ops->resume_pll(info, &par->pll);
+
+	if (par->aux_start)
+		aty_st_le32(BUS_CNTL,
+			aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
+}
+
 static int atyfb_pci_resume(struct pci_dev *pdev)
 {
 	struct fb_info *info = pci_get_drvdata(pdev);
@@ -2659,19 +2673,6 @@ aty_init_exit:
 	return ret;
 }
 
-static void aty_resume_chip(struct fb_info *info)
-{
-	struct atyfb_par *par = info->par;
-
-	aty_st_le32(MEM_CNTL, par->mem_cntl, par);
-
-	if (par->pll_ops->resume_pll)
-		par->pll_ops->resume_pll(info, &par->pll);
-
-	if (par->aux_start)
-		aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
-}
-
 #ifdef CONFIG_ATARI
 static int __devinit store_video_par(char *video_str, unsigned char m64_num)
 {
_


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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

* Re: [PATCH] atyfb_base.c: fix warning
  2008-07-31  9:15 ` Andrew Morton
@ 2008-07-31 12:47   ` M. Asselstine
  0 siblings, 0 replies; 5+ messages in thread
From: M. Asselstine @ 2008-07-31 12:47 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-fbdev-devel, adaplas, syrjala, kernel-janitors,
	linux-kernel, Alexander Beregalov

On Thu, Jul 31, 2008 at 5:15 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Thu, 31 Jul 2008 01:03:52 +0400 Alexander Beregalov <a.beregalov@gmail.com> wrote:
>
>> From: Alexander Beregalov <a.beregalov@gmail.com>
>>
>> atyfb_base.c: fix warning
>>
>> drivers/video/aty/atyfb_base.c:2663: warning: 'aty_resume_chip' defined
>> but not used
>>
>> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
>> Cc: Ville Syrjala <syrjala@sci.fi>
>> Cc: Antonino A. Daplas <adaplas@pol.net>
>> ---
>>
>>  drivers/video/aty/atyfb_base.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
>> index 620ba81..9e5dfb1 100644
>> --- a/drivers/video/aty/atyfb_base.c
>> +++ b/drivers/video/aty/atyfb_base.c
>> @@ -244,7 +244,9 @@ static int atyfb_sync(struct fb_info *info);
>>       */
>>
>>  static int aty_init(struct fb_info *info);
>> +#if defined(CONFIG_PM) && defined(CONFIG_PCI)
>>  static void aty_resume_chip(struct fb_info *info);
>> +#endif
>>  #ifdef CONFIG_ATARI
>>  static int store_video_par(char *videopar, unsigned char m64_num);
>>  #endif
>> @@ -2659,6 +2661,7 @@ aty_init_exit:
>>       return ret;
>>  }
>>
>> +#if defined(CONFIG_PM) && defined(CONFIG_PCI)
>>  static void aty_resume_chip(struct fb_info *info)
>>  {
>>       struct atyfb_par *par = info->par;
>> @@ -2671,6 +2674,7 @@ static void aty_resume_chip(struct fb_info *info)
>>       if (par->aux_start)
>>               aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
>>  }
>> +#endif /* defined(CONFIG_PM) && defined(CONFIG_PCI) */
>>
>>  #ifdef CONFIG_ATARI
>>  static int __devinit store_video_par(char *video_str, unsigned char m64_num)
>
> OK...
>
> We don't strictly need the first ifdef - it's OK to declare a
> non-existent function, and ifdefs are ugly.
>
> But we can reorganise the code a bit more and remove the forward
> declaration altogether and remove a whole ifdef block too.
>
> How does this look?
>

Ah. Much better, this is definitely the way to go.

Mark

>  drivers/video/aty/atyfb_base.c |   29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff -puN drivers/video/aty/atyfb_base.c~atyfb_basec-fix-warning drivers/video/aty/atyfb_base.c
> --- a/drivers/video/aty/atyfb_base.c~atyfb_basec-fix-warning
> +++ a/drivers/video/aty/atyfb_base.c
> @@ -244,7 +244,7 @@ static int atyfb_sync(struct fb_info *in
>      */
>
>  static int aty_init(struct fb_info *info);
> -static void aty_resume_chip(struct fb_info *info);
> +
>  #ifdef CONFIG_ATARI
>  static int store_video_par(char *videopar, unsigned char m64_num);
>  #endif
> @@ -2023,6 +2023,20 @@ static int atyfb_pci_suspend(struct pci_
>        return 0;
>  }
>
> +static void aty_resume_chip(struct fb_info *info)
> +{
> +       struct atyfb_par *par = info->par;
> +
> +       aty_st_le32(MEM_CNTL, par->mem_cntl, par);
> +
> +       if (par->pll_ops->resume_pll)
> +               par->pll_ops->resume_pll(info, &par->pll);
> +
> +       if (par->aux_start)
> +               aty_st_le32(BUS_CNTL,
> +                       aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
> +}
> +
>  static int atyfb_pci_resume(struct pci_dev *pdev)
>  {
>        struct fb_info *info = pci_get_drvdata(pdev);
> @@ -2659,19 +2673,6 @@ aty_init_exit:
>        return ret;
>  }
>
> -static void aty_resume_chip(struct fb_info *info)
> -{
> -       struct atyfb_par *par = info->par;
> -
> -       aty_st_le32(MEM_CNTL, par->mem_cntl, par);
> -
> -       if (par->pll_ops->resume_pll)
> -               par->pll_ops->resume_pll(info, &par->pll);
> -
> -       if (par->aux_start)
> -               aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
> -}
> -
>  #ifdef CONFIG_ATARI
>  static int __devinit store_video_par(char *video_str, unsigned char m64_num)
>  {
> _
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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

end of thread, other threads:[~2008-07-31 12:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30 21:03 [PATCH] atyfb_base.c: fix warning Alexander Beregalov
2008-07-31  1:14 ` M. Asselstine
2008-07-31  9:15 ` Andrew Morton
2008-07-31 12:47   ` M. Asselstine
  -- strict thread matches above, loose matches on Subject: below --
2008-07-31  8:29 krzysztof.h1

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).