* [2.6 patch] drivers/block/aoe/aoechr.c cleanups
@ 2005-01-29 13:35 Adrian Bunk
2005-01-31 14:34 ` Ed L Cashin
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2005-01-29 13:35 UTC (permalink / raw)
To: Sam Hopkins; +Cc: linux-kernel
This patch contains the following cleanups:
- make the needlessly global struct aoe_fops static
- #if 0 the unused global function aoechr_hdump
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/block/aoe/aoechr.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)
--- linux-2.6.11-rc2-mm1-full/drivers/block/aoe/aoechr.c.old 2005-01-29 13:43:34.000000000 +0100
+++ linux-2.6.11-rc2-mm1-full/drivers/block/aoe/aoechr.c 2005-01-29 13:44:16.000000000 +0100
@@ -99,6 +99,8 @@
up(&emsgs_sema);
}
+#if 0
+
#define PERLINE 16
void
aoechr_hdump(char *buf, int n)
@@ -134,6 +136,8 @@
kfree(fbuf);
}
+#endif /* 0 */
+
static ssize_t
aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp)
{
@@ -233,7 +237,7 @@
}
}
-struct file_operations aoe_fops = {
+static struct file_operations aoe_fops = {
.write = aoechr_write,
.read = aoechr_read,
.open = aoechr_open,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] drivers/block/aoe/aoechr.c cleanups
2005-01-29 13:35 [2.6 patch] drivers/block/aoe/aoechr.c cleanups Adrian Bunk
@ 2005-01-31 14:34 ` Ed L Cashin
2005-02-01 7:54 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Ed L Cashin @ 2005-01-31 14:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Adrian Bunk, Greg K-H
[-- Attachment #1: Type: text/plain, Size: 483 bytes --]
Adrian Bunk <bunk@stusta.de> writes:
> This patch contains the following cleanups:
> - make the needlessly global struct aoe_fops static
> - #if 0 the unused global function aoechr_hdump
Thanks for the patch. The original patch leaves the prototype for
aoechr_hdump in aoe.h, but since this function is just for debugging,
it seems better to just take both prototype and definition out.
remove aoechr_hdump
make aoe_fops static
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
[-- Attachment #2: diff-cleanup --]
[-- Type: text/plain, Size: 1717 bytes --]
diff -urNp aa/drivers/block/aoe/aoe.h bb/drivers/block/aoe/aoe.h
--- aa/drivers/block/aoe/aoe.h 2005-01-31 09:20:53.000000000 -0500
+++ bb/drivers/block/aoe/aoe.h 2005-01-31 09:21:01.000000000 -0500
@@ -143,7 +143,6 @@ void aoedisk_rm_sysfs(struct aoedev *d);
int aoechr_init(void);
void aoechr_exit(void);
void aoechr_error(char *);
-void aoechr_hdump(char *, int len);
void aoecmd_work(struct aoedev *d);
void aoecmd_cfg(ushort, unsigned char);
diff -urNp aa/drivers/block/aoe/aoechr.c bb/drivers/block/aoe/aoechr.c
--- aa/drivers/block/aoe/aoechr.c 2005-01-31 09:20:53.000000000 -0500
+++ bb/drivers/block/aoe/aoechr.c 2005-01-31 09:21:01.000000000 -0500
@@ -99,41 +99,6 @@ bail: spin_unlock_irqrestore(&emsgs_loc
up(&emsgs_sema);
}
-#define PERLINE 16
-void
-aoechr_hdump(char *buf, int n)
-{
- int bufsiz;
- char *fbuf;
- int linelen;
- char *p, *e, *fp;
-
- bufsiz = n * 3; /* 2 hex digits and a space */
- bufsiz += n / PERLINE + 1; /* the newline characters */
- bufsiz += 1; /* the final '\0' */
-
- fbuf = kmalloc(bufsiz, GFP_ATOMIC);
- if (!fbuf) {
- printk(KERN_INFO
- "%s: cannot allocate memory\n",
- __FUNCTION__);
- return;
- }
-
- for (p = buf; n <= 0;) {
- linelen = n > PERLINE ? PERLINE : n;
- n -= linelen;
-
- fp = fbuf;
- for (e=p+linelen; p<e; p++)
- fp += sprintf(fp, "%2.2X ", *p & 255);
- sprintf(fp, "\n");
- aoechr_error(fbuf);
- }
-
- kfree(fbuf);
-}
-
static ssize_t
aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp)
{
@@ -233,7 +198,7 @@ loop:
}
}
-struct file_operations aoe_fops = {
+static struct file_operations aoe_fops = {
.write = aoechr_write,
.read = aoechr_read,
.open = aoechr_open,
[-- Attachment #3: Type: text/plain, Size: 41 bytes --]
--
Ed L Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] drivers/block/aoe/aoechr.c cleanups
2005-01-31 14:34 ` Ed L Cashin
@ 2005-02-01 7:54 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2005-02-01 7:54 UTC (permalink / raw)
To: Ed L Cashin; +Cc: linux-kernel, Adrian Bunk
On Mon, Jan 31, 2005 at 09:34:58AM -0500, Ed L Cashin wrote:
> Adrian Bunk <bunk@stusta.de> writes:
>
> > This patch contains the following cleanups:
> > - make the needlessly global struct aoe_fops static
> > - #if 0 the unused global function aoechr_hdump
>
> Thanks for the patch. The original patch leaves the prototype for
> aoechr_hdump in aoe.h, but since this function is just for debugging,
> it seems better to just take both prototype and definition out.
>
>
> remove aoechr_hdump
> make aoe_fops static
>
> Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Applied, thanks.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-02-01 7:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-29 13:35 [2.6 patch] drivers/block/aoe/aoechr.c cleanups Adrian Bunk
2005-01-31 14:34 ` Ed L Cashin
2005-02-01 7:54 ` Greg KH
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).