* [PATCH] mbcs: Remove lots of global symbols
@ 2007-07-09 13:50 Alan Cox
2007-07-09 13:55 ` Jes Sorensen
2007-07-09 15:21 ` Jes Sorensen
0 siblings, 2 replies; 3+ messages in thread
From: Alan Cox @ 2007-07-09 13:50 UTC (permalink / raw)
To: linux-altix, linux-kernel, akpm
MBCS has a collection of things that searches say are not used elsewhere
and could be static. If this is the case they should be static, if not
then someone at SGI should rename things like "soft_list" so they don't
pollute the global namespace with generic names...
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.c linux-2.6.22-rc6-mm1/drivers/char/mbcs.c
--- linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.c 2007-07-02 20:47:23.000000000 +0100
+++ linux-2.6.22-rc6-mm1/drivers/char/mbcs.c 2007-07-09 12:11:02.250630816 +0100
@@ -39,14 +39,14 @@
#else
#define DBG(fmt...)
#endif
-int mbcs_major;
+static int mbcs_major;
-LIST_HEAD(soft_list);
+static LIST_HEAD(soft_list);
/*
* file operations
*/
-const struct file_operations mbcs_ops = {
+static const struct file_operations mbcs_ops = {
.open = mbcs_open,
.llseek = mbcs_sram_llseek,
.read = mbcs_sram_read,
@@ -377,7 +377,7 @@
return rv;
}
-int mbcs_open(struct inode *ip, struct file *fp)
+static int mbcs_open(struct inode *ip, struct file *fp)
{
struct mbcs_soft *soft;
int minor;
@@ -394,7 +394,7 @@
return -ENODEV;
}
-ssize_t mbcs_sram_read(struct file * fp, char __user *buf, size_t len, loff_t * off)
+static ssize_t mbcs_sram_read(struct file * fp, char __user *buf, size_t len, loff_t * off)
{
struct cx_dev *cx_dev = fp->private_data;
struct mbcs_soft *soft = cx_dev->soft;
@@ -418,7 +418,7 @@
return rv;
}
-ssize_t
+static ssize_t
mbcs_sram_write(struct file * fp, const char __user *buf, size_t len, loff_t * off)
{
struct cx_dev *cx_dev = fp->private_data;
@@ -443,7 +443,7 @@
return rv;
}
-loff_t mbcs_sram_llseek(struct file * filp, loff_t off, int whence)
+static loff_t mbcs_sram_llseek(struct file * filp, loff_t off, int whence)
{
loff_t newpos;
@@ -491,7 +491,7 @@
soft->gscr_addr = mbcs_pioaddr(soft, MBCS_GSCR_START);
}
-int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma)
+static int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma)
{
struct cx_dev *cx_dev = fp->private_data;
struct mbcs_soft *soft = cx_dev->soft;
@@ -793,7 +793,7 @@
return 0;
}
-const struct cx_device_id __devinitdata mbcs_id_table[] = {
+static const struct cx_device_id __devinitdata mbcs_id_table[] = {
{
.part_num = MBCS_PART_NUM,
.mfg_num = MBCS_MFG_NUM,
@@ -807,7 +807,7 @@
MODULE_DEVICE_TABLE(cx, mbcs_id_table);
-struct cx_drv mbcs_driver = {
+static struct cx_drv mbcs_driver = {
.name = DEVICE_NAME,
.id_table = mbcs_id_table,
.probe = mbcs_probe,
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.h linux-2.6.22-rc6-mm1/drivers/char/mbcs.h
--- linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.h 2007-07-02 20:47:23.000000000 +0100
+++ linux-2.6.22-rc6-mm1/drivers/char/mbcs.h 2007-07-09 12:12:40.045763696 +0100
@@ -542,12 +542,12 @@
struct semaphore algolock;
};
-extern int mbcs_open(struct inode *ip, struct file *fp);
-extern ssize_t mbcs_sram_read(struct file *fp, char __user *buf, size_t len,
+static int mbcs_open(struct inode *ip, struct file *fp);
+static ssize_t mbcs_sram_read(struct file *fp, char __user *buf, size_t len,
loff_t * off);
-extern ssize_t mbcs_sram_write(struct file *fp, const char __user *buf, size_t len,
+static ssize_t mbcs_sram_write(struct file *fp, const char __user *buf, size_t len,
loff_t * off);
-extern loff_t mbcs_sram_llseek(struct file *filp, loff_t off, int whence);
-extern int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma);
+static loff_t mbcs_sram_llseek(struct file *filp, loff_t off, int whence);
+static int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma);
#endif // __MBCS_H__
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mbcs: Remove lots of global symbols
2007-07-09 13:50 [PATCH] mbcs: Remove lots of global symbols Alan Cox
@ 2007-07-09 13:55 ` Jes Sorensen
2007-07-09 15:21 ` Jes Sorensen
1 sibling, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2007-07-09 13:55 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-altix, linux-kernel, akpm
Alan Cox wrote:
> MBCS has a collection of things that searches say are not used elsewhere
> and could be static. If this is the case they should be static, if not
> then someone at SGI should rename things like "soft_list" so they don't
> pollute the global namespace with generic names...
>
> Signed-off-by: Alan Cox <alan@redhat.com>
Hi Alan,
I don't know anything about the mbcs driver, but I bounced it by the
authors. Will get back to you asap.
Cheers,
Jes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mbcs: Remove lots of global symbols
2007-07-09 13:50 [PATCH] mbcs: Remove lots of global symbols Alan Cox
2007-07-09 13:55 ` Jes Sorensen
@ 2007-07-09 15:21 ` Jes Sorensen
1 sibling, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2007-07-09 15:21 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-altix, linux-kernel, akpm, Bruce Losure
Alan Cox wrote:
> MBCS has a collection of things that searches say are not used elsewhere
> and could be static. If this is the case they should be static, if not
> then someone at SGI should rename things like "soft_list" so they don't
> pollute the global namespace with generic names...
>
> Signed-off-by: Alan Cox <alan@redhat.com>
Hi Alan,
Bruce says the changes should be fine, so
Signed-off-by: Bruce Losure <blosure@sgi.com>
Cheers,
Jes
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.c linux-2.6.22-rc6-mm1/drivers/char/mbcs.c
> --- linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.c 2007-07-02 20:47:23.000000000 +0100
> +++ linux-2.6.22-rc6-mm1/drivers/char/mbcs.c 2007-07-09 12:11:02.250630816 +0100
> @@ -39,14 +39,14 @@
> #else
> #define DBG(fmt...)
> #endif
> -int mbcs_major;
> +static int mbcs_major;
>
> -LIST_HEAD(soft_list);
> +static LIST_HEAD(soft_list);
>
> /*
> * file operations
> */
> -const struct file_operations mbcs_ops = {
> +static const struct file_operations mbcs_ops = {
> .open = mbcs_open,
> .llseek = mbcs_sram_llseek,
> .read = mbcs_sram_read,
> @@ -377,7 +377,7 @@
> return rv;
> }
>
> -int mbcs_open(struct inode *ip, struct file *fp)
> +static int mbcs_open(struct inode *ip, struct file *fp)
> {
> struct mbcs_soft *soft;
> int minor;
> @@ -394,7 +394,7 @@
> return -ENODEV;
> }
>
> -ssize_t mbcs_sram_read(struct file * fp, char __user *buf, size_t len, loff_t * off)
> +static ssize_t mbcs_sram_read(struct file * fp, char __user *buf, size_t len, loff_t * off)
> {
> struct cx_dev *cx_dev = fp->private_data;
> struct mbcs_soft *soft = cx_dev->soft;
> @@ -418,7 +418,7 @@
> return rv;
> }
>
> -ssize_t
> +static ssize_t
> mbcs_sram_write(struct file * fp, const char __user *buf, size_t len, loff_t * off)
> {
> struct cx_dev *cx_dev = fp->private_data;
> @@ -443,7 +443,7 @@
> return rv;
> }
>
> -loff_t mbcs_sram_llseek(struct file * filp, loff_t off, int whence)
> +static loff_t mbcs_sram_llseek(struct file * filp, loff_t off, int whence)
> {
> loff_t newpos;
>
> @@ -491,7 +491,7 @@
> soft->gscr_addr = mbcs_pioaddr(soft, MBCS_GSCR_START);
> }
>
> -int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma)
> +static int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma)
> {
> struct cx_dev *cx_dev = fp->private_data;
> struct mbcs_soft *soft = cx_dev->soft;
> @@ -793,7 +793,7 @@
> return 0;
> }
>
> -const struct cx_device_id __devinitdata mbcs_id_table[] = {
> +static const struct cx_device_id __devinitdata mbcs_id_table[] = {
> {
> .part_num = MBCS_PART_NUM,
> .mfg_num = MBCS_MFG_NUM,
> @@ -807,7 +807,7 @@
>
> MODULE_DEVICE_TABLE(cx, mbcs_id_table);
>
> -struct cx_drv mbcs_driver = {
> +static struct cx_drv mbcs_driver = {
> .name = DEVICE_NAME,
> .id_table = mbcs_id_table,
> .probe = mbcs_probe,
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.h linux-2.6.22-rc6-mm1/drivers/char/mbcs.h
> --- linux.vanilla-2.6.22-rc6-mm1/drivers/char/mbcs.h 2007-07-02 20:47:23.000000000 +0100
> +++ linux-2.6.22-rc6-mm1/drivers/char/mbcs.h 2007-07-09 12:12:40.045763696 +0100
> @@ -542,12 +542,12 @@
> struct semaphore algolock;
> };
>
> -extern int mbcs_open(struct inode *ip, struct file *fp);
> -extern ssize_t mbcs_sram_read(struct file *fp, char __user *buf, size_t len,
> +static int mbcs_open(struct inode *ip, struct file *fp);
> +static ssize_t mbcs_sram_read(struct file *fp, char __user *buf, size_t len,
> loff_t * off);
> -extern ssize_t mbcs_sram_write(struct file *fp, const char __user *buf, size_t len,
> +static ssize_t mbcs_sram_write(struct file *fp, const char __user *buf, size_t len,
> loff_t * off);
> -extern loff_t mbcs_sram_llseek(struct file *filp, loff_t off, int whence);
> -extern int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma);
> +static loff_t mbcs_sram_llseek(struct file *filp, loff_t off, int whence);
> +static int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma);
>
> #endif // __MBCS_H__
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-09 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-09 13:50 [PATCH] mbcs: Remove lots of global symbols Alan Cox
2007-07-09 13:55 ` Jes Sorensen
2007-07-09 15:21 ` Jes Sorensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox