Skip to contentSkip to conversation

atyfb_base.c: fix warning

PATCH In review Alexander Beregalov 3 participants 4 messages Jul 30, 2008 – Jul 31, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atyfb_base.c: fix warning

From: Alexander Beregalov <[email protected]>

atyfb_base.c: fix warning

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

Cc Ville Syrjala <[email protected]>
Cc Antonino A. Daplas <[email protected]>

---

 drivers/video/aty/atyfb_base.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/video/aty/atyfb_base.c +4 -0
index 620ba81..9e5dfb1 100644
@@ -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)
Reviewed-by Mark Asselstine on v1 1/1
#1 lore raw
Quoted 10 lines · Alexander Beregalov

From: Alexander Beregalov <[email protected]>

atyfb_base.c: fix warning

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

Cc Ville Syrjala <[email protected]>
Cc Antonino A. Daplas <[email protected]>

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.

Quoted 40 lines

---

 drivers/video/aty/atyfb_base.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/video/aty/atyfb_base.c +4 -1
index 620ba81..9e5dfb1 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Alexander Beregalov
Quoted 38 lines · On Thu, 31 Jul 2008 01:03:52 +0400 Alexander Beregalov <[email protected]>…

From: Alexander Beregalov <[email protected]>

atyfb_base.c: fix warning

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

Cc Ville Syrjala <[email protected]>
Cc Antonino A. Daplas <[email protected]>

---

 drivers/video/aty/atyfb_base.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/video/aty/atyfb_base.c +3 -0
index 620ba81..9e5dfb1 100644
@@ -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;

drivers/video/aty/atyfb_base.c static void aty_resume_chip(struct fb_info *info) · line 2680

Quoted 7 lines
drivers/video/aty/atyfb_base.c +1 -0
@@ -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(-)
drivers/video/aty/atyfb_base.c renamed from drivers/video/aty/atyfb_base.c~atyfb_basec-fix-warning +15 -14
diff -puN drivers/video/aty/atyfb_base.c~atyfb_basec-fix-warning 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)
 {

_

#3 lore raw
Quoted 50 lines · Andrew Morton
Quoted 38 lines · On Thu, 31 Jul 2008 01:03:52 +0400 Alexander Beregalov <[email protected]>…

From: Alexander Beregalov <[email protected]>

atyfb_base.c: fix warning

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

Cc Ville Syrjala <[email protected]>
Cc Antonino A. Daplas <[email protected]>

---

 drivers/video/aty/atyfb_base.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/video/aty/atyfb_base.c +3 -0
index 620ba81..9e5dfb1 100644
@@ -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;

drivers/video/aty/atyfb_base.c static void aty_resume_chip(struct fb_info *info) · line 2680

Quoted 7 lines
drivers/video/aty/atyfb_base.c +1 -0
@@ -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...

Quoted 8 lines

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

Quoted 63 lines
 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

drivers/video/aty/atyfb_base.c renamed from drivers/video/aty/atyfb_base.c~atyfb_basec-fix-warning +15 -14
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html