Commit e9271e60 authored by Ed L. Cashin's avatar Ed L. Cashin Committed by Greg Kroah-Hartman

[PATCH] aoe: drivers/block/aoe/aoechr.c cleanups

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: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarEd L. Cashin <ecashin@coraid.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 01069460
...@@ -143,7 +143,6 @@ void aoedisk_rm_sysfs(struct aoedev *d); ...@@ -143,7 +143,6 @@ void aoedisk_rm_sysfs(struct aoedev *d);
int aoechr_init(void); int aoechr_init(void);
void aoechr_exit(void); void aoechr_exit(void);
void aoechr_error(char *); void aoechr_error(char *);
void aoechr_hdump(char *, int len);
void aoecmd_work(struct aoedev *d); void aoecmd_work(struct aoedev *d);
void aoecmd_cfg(ushort, unsigned char); void aoecmd_cfg(ushort, unsigned char);
......
...@@ -99,41 +99,6 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags); ...@@ -99,41 +99,6 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags);
up(&emsgs_sema); 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 static ssize_t
aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp) aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp)
{ {
...@@ -233,7 +198,7 @@ aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off) ...@@ -233,7 +198,7 @@ aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off)
} }
} }
struct file_operations aoe_fops = { static struct file_operations aoe_fops = {
.write = aoechr_write, .write = aoechr_write,
.read = aoechr_read, .read = aoechr_read,
.open = aoechr_open, .open = aoechr_open,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment