Skip to contentSkip to conversation

drivers/video/: possible cleanups

PATCH New Antonino A. Daplas 1 participant 1 message Nov 7, 2005

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

PATCH 6/7 drivers/video/: possible cleanups

From: Adrian Bunk <[email protected]>

This patch contains the possible cleanups including the following:
- every file should #include the headers containing the prototypes for it's global functions
- make needlessly global functions static
- kyro/STG4000Interface.h: #include video/kyro.h and linux/pci.h instead of a manual "struct pci_dev"
- i810_main.{c,h}: prototypes for static functions belong to the C file

---
 arcfb.c                     |    8 +++---
 console/softcursor.c        |    2 +
 i810/i810-i2c.c             |    1 
 i810/i810_accel.c           |    1 
 i810/i810_gtf.c             |    1 
 i810/i810_main.c            |   51 ++++++++++++++++++++++++++++++++++++----
 i810/i810_main.h            |   56 +++-----------------------------------------
 kyro/STG4000InitDevice.c    |    1 
 kyro/STG4000Interface.h     |    3 +-
 kyro/STG4000OverlayDevice.c |    1 
 matrox/matroxfb_g450.c      |    2 +
 nvidia/nv_hw.c              |    1 
 tdfxfb.c                    |    2 -
 13 files changed, 68 insertions(+), 62 deletions(-)
drivers/video/arcfb.c +5 -3
index a1fc8bb..35a3394 100644
@@ -366,7 +366,8 @@ static void arcfb_lcd_update(struct arcf
 	}
 }
 
-void arcfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
+static void arcfb_fillrect(struct fb_info *info,
+			   const struct fb_fillrect *rect)
 {
 	struct arcfb_par *par = info->par;
 
@@ -376,7 +377,8 @@ void arcfb_fillrect(struct fb_info *info
 	arcfb_lcd_update(par, rect->dx, rect->dy, rect->width, rect->height);
 }
 
-void arcfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
+static void arcfb_copyarea(struct fb_info *info,
+			   const struct fb_copyarea *area)
 {
 	struct arcfb_par *par = info->par;
 
@@ -386,7 +388,7 @@ void arcfb_copyarea(struct fb_info *info
 	arcfb_lcd_update(par, area->dx, area->dy, area->width, area->height);
 }
 
-void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
+static void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
 {
 	struct arcfb_par *par = info->par;
 
drivers/video/console/softcursor.c +2 -0
index 8529bf0..3957fc7 100644
@@ -17,6 +17,8 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
+#include "fbcon.h"
+
 int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
 {
 	unsigned int scan_align = info->pixmap.scan_align - 1;
drivers/video/i810/i810-i2c.c +1 -0
index c61bad0..277b51a 100644
@@ -17,6 +17,7 @@
 #include <linux/fb.h>
 #include "i810.h"
 #include "i810_regs.h"
+#include "i810_main.h"
 #include "../edid.h"
 
 #define I810_DDC 0x50
drivers/video/i810/i810_accel.c +1 -0
index 64cd1c8..1ba6567 100644
@@ -14,6 +14,7 @@
 
 #include "i810_regs.h"
 #include "i810.h"
+#include "i810_main.h"
 
 static u32 i810fb_rop[] = {
 	COLOR_COPY_ROP, /* ROP_COPY */
drivers/video/i810/i810_gtf.c +1 -0
index 64f087a..9743d51 100644
@@ -14,6 +14,7 @@
 
 #include "i810_regs.h"
 #include "i810.h"
+#include "i810_main.h"
 
 /*
  * FIFO and Watermark tables - based almost wholly on i810_wmark.c in 
drivers/video/i810/i810_main.c +46 -5

63 lines not on this page · raw message

drivers/video/i810/i810_main.h +4 -52

80 lines not on this page · raw message

drivers/video/kyro/STG4000InitDevice.c +1 -0
index 7e33cd3..ab5285a 100644
@@ -15,6 +15,7 @@
 #include <linux/pci.h>
 
 #include "STG4000Reg.h"
+#include "STG4000Interface.h"
 
 /* SDRAM fixed settings */
 #define SDRAM_CFG_0   0x49A1
drivers/video/kyro/STG4000Interface.h +2 -1
index e75b3b4..b7c83d5 100644
@@ -11,7 +11,8 @@
 #ifndef _STG4000INTERFACE_H
 #define _STG4000INTERFACE_H
 
-struct pci_dev;
+#include <linux/pci.h>
+#include <video/kyro.h>
 
 /*
  * Ramdac Setup
drivers/video/kyro/STG4000OverlayDevice.c +0 -0
index 2ae9baf..a8c9713 100644

--- a/drivers/video/kyro/STG4000OverlayDevice.cFrom: Adrian Bunk <[email protected]>

This patch contains the possible cleanups including the following:
- every file should #include the headers containing the prototypes for it's global functions
- make needlessly global functions static
- kyro/STG4000Interface.h: #include video/kyro.h and linux/pci.h instead of a manual "struct pci_dev"
- i810_main.{c,h}: prototypes for static functions belong to the C file

---
 arcfb.c                     |    8 +++---
 console/softcursor.c        |    2 +
 i810/i810-i2c.c             |    1 
 i810/i810_accel.c           |    1 
 i810/i810_gtf.c             |    1 
 i810/i810_main.c            |   51 ++++++++++++++++++++++++++++++++++++----
 i810/i810_main.h            |   56 +++-----------------------------------------
 kyro/STG4000InitDevice.c    |    1 
 kyro/STG4000Interface.h     |    3 +-
 kyro/STG4000OverlayDevice.c |    1 
 matrox/matroxfb_g450.c      |    2 +
 nvidia/nv_hw.c              |    1 
 tdfxfb.c                    |    2 -
 13 files changed, 68 insertions(+), 62 deletions(-)
drivers/video/arcfb.c +5 -3
index a1fc8bb..35a3394 100644
@@ -366,7 +366,8 @@ static void arcfb_lcd_update(struct arcf
 	}
 }
 
-void arcfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
+static void arcfb_fillrect(struct fb_info *info,
+			   const struct fb_fillrect *rect)
 {
 	struct arcfb_par *par = info->par;
 
@@ -376,7 +377,8 @@ void arcfb_fillrect(struct fb_info *info
 	arcfb_lcd_update(par, rect->dx, rect->dy, rect->width, rect->height);
 }
 
-void arcfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
+static void arcfb_copyarea(struct fb_info *info,
+			   const struct fb_copyarea *area)
 {
 	struct arcfb_par *par = info->par;
 
@@ -386,7 +388,7 @@ void arcfb_copyarea(struct fb_info *info
 	arcfb_lcd_update(par, area->dx, area->dy, area->width, area->height);
 }
 
-void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
+static void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
 {
 	struct arcfb_par *par = info->par;
 
drivers/video/console/softcursor.c +2 -0
index 8529bf0..3957fc7 100644
@@ -17,6 +17,8 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
+#include "fbcon.h"
+
 int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
 {
 	unsigned int scan_align = info->pixmap.scan_align - 1;
drivers/video/i810/i810-i2c.c +1 -0
index c61bad0..277b51a 100644
@@ -17,6 +17,7 @@
 #include <linux/fb.h>
 #include "i810.h"
 #include "i810_regs.h"
+#include "i810_main.h"
 #include "../edid.h"
 
 #define I810_DDC 0x50
drivers/video/i810/i810_accel.c +1 -0
index 64cd1c8..1ba6567 100644
@@ -14,6 +14,7 @@
 
 #include "i810_regs.h"
 #include "i810.h"
+#include "i810_main.h"
 
 static u32 i810fb_rop[] = {
 	COLOR_COPY_ROP, /* ROP_COPY */
drivers/video/i810/i810_gtf.c +1 -0
index 64f087a..9743d51 100644
@@ -14,6 +14,7 @@
 
 #include "i810_regs.h"
 #include "i810.h"
+#include "i810_main.h"
 
 /*
  * FIFO and Watermark tables - based almost wholly on i810_wmark.c in 
drivers/video/i810/i810_main.c +46 -5

63 lines not on this page · raw message

drivers/video/i810/i810_main.h +4 -52

80 lines not on this page · raw message

drivers/video/kyro/STG4000InitDevice.c +1 -0
index 7e33cd3..ab5285a 100644
@@ -15,6 +15,7 @@
 #include <linux/pci.h>
 
 #include "STG4000Reg.h"
+#include "STG4000Interface.h"
 
 /* SDRAM fixed settings */
 #define SDRAM_CFG_0   0x49A1
drivers/video/kyro/STG4000Interface.h +2 -1
index e75b3b4..b7c83d5 100644
@@ -11,7 +11,8 @@
 #ifndef _STG4000INTERFACE_H
 #define _STG4000INTERFACE_H
 
-struct pci_dev;
+#include <linux/pci.h>
+#include <video/kyro.h>
 
 /*
  * Ramdac Setup
drivers/video/kyro/STG4000OverlayDevice.c +1 -0
index 2ae9baf..a8c9713 100644
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 
 #include "STG4000Reg.h"
+#include "STG4000Interface.h"
 
 /* HW Defines */
 
drivers/video/matrox/matroxfb_g450.c +2 -0
index 35008af..c122d87 100644
@@ -20,6 +20,8 @@
 #include <asm/uaccess.h>
 #include <asm/div64.h>
 
+#include "matroxfb_g450.h"
+
 /* Definition of the various controls */
 struct mctl {
 	struct v4l2_queryctrl desc;
drivers/video/nvidia/nv_hw.c +1 -0
index b989358..9940bc0 100644
@@ -52,6 +52,7 @@
 #include <linux/pci.h>
 #include "nv_type.h"
 #include "nv_local.h"
+#include "nv_proto.h"
 
 void NVLockUnlock(struct nvidia_par *par, int Lock)
 {
drivers/video/tdfxfb.c +1 -1
index 9d53387..60bc890 100644
@@ -1307,7 +1307,7 @@ out_err:
 }
 
 #ifndef MODULE
-void tdfxfb_setup(char *options)
+static void tdfxfb_setup(char *options)
 {
 	char* this_opt;
 

+++ b/drivers/video/kyro/STG4000OverlayDevice.c
@@ -14,6 +14,7 @@
#include <linux/types.h>

#include "STG4000Reg.h"
+#include "STG4000Interface.h"

/* HW Defines */

drivers/video/matrox/matroxfb_g450.c +2 -0
index 35008af..c122d87 100644
@@ -20,6 +20,8 @@
 #include <asm/uaccess.h>
 #include <asm/div64.h>
 
+#include "matroxfb_g450.h"
+
 /* Definition of the various controls */
 struct mctl {
 	struct v4l2_queryctrl desc;
drivers/video/nvidia/nv_hw.c +1 -0
index b989358..9940bc0 100644
@@ -52,6 +52,7 @@
 #include <linux/pci.h>
 #include "nv_type.h"
 #include "nv_local.h"
+#include "nv_proto.h"
 
 void NVLockUnlock(struct nvidia_par *par, int Lock)
 {
drivers/video/tdfxfb.c +1 -1
index 9d53387..60bc890 100644
@@ -1307,7 +1307,7 @@ out_err:
 }
 
 #ifndef MODULE
-void tdfxfb_setup(char *options)
+static void tdfxfb_setup(char *options)
 {
 	char* this_opt;
 

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php