提交 cebadc5c 编写于 作者: A Alan Cox 提交者: James Bottomley

[SCSI] ppa: coding police and printk levels

Add printk levels
Clean up some oddities of formatting
Fix goto labels
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 75a1099c
master alk-4.19.24 alk-4.19.30 alk-4.19.34 alk-4.19.36 alk-4.19.43 alk-4.19.48 alk-4.19.57 ck-4.19.67 ck-4.19.81 ck-4.19.91 github/fork/deepanshu1422/fix-typo-in-comment github/fork/haosdent/fix-typo linux-next v4.19.91 v4.19.90 v4.19.89 v4.19.88 v4.19.87 v4.19.86 v4.19.85 v4.19.84 v4.19.83 v4.19.82 v4.19.81 v4.19.80 v4.19.79 v4.19.78 v4.19.77 v4.19.76 v4.19.75 v4.19.74 v4.19.73 v4.19.72 v4.19.71 v4.19.70 v4.19.69 v4.19.68 v4.19.67 v4.19.66 v4.19.65 v4.19.64 v4.19.63 v4.19.62 v4.19.61 v4.19.60 v4.19.59 v4.19.58 v4.19.57 v4.19.56 v4.19.55 v4.19.54 v4.19.53 v4.19.52 v4.19.51 v4.19.50 v4.19.49 v4.19.48 v4.19.47 v4.19.46 v4.19.45 v4.19.44 v4.19.43 v4.19.42 v4.19.41 v4.19.40 v4.19.39 v4.19.38 v4.19.37 v4.19.36 v4.19.35 v4.19.34 v4.19.33 v4.19.32 v4.19.31 v4.19.30 v4.19.29 v4.19.28 v4.19.27 v4.19.26 v4.19.25 v4.19.24 v4.19.23 v4.19.22 v4.19.21 v4.19.20 v4.19.19 v4.19.18 v4.19.17 v4.19.16 v4.19.15 v4.19.14 v4.19.13 v4.19.12 v4.19.11 v4.19.10 v4.19.9 v4.19.8 v4.19.7 v4.19.6 v4.19.5 v4.19.4 v4.19.3 v4.19.2 v4.19.1 v4.19 v4.19-rc8 v4.19-rc7 v4.19-rc6 v4.19-rc5 v4.19-rc4 v4.19-rc3 v4.19-rc2 v4.19-rc1 ck-release-21 ck-release-20 ck-release-19.2 ck-release-19.1 ck-release-19 ck-release-18 ck-release-17.2 ck-release-17.1 ck-release-17 ck-release-16 ck-release-15.1 ck-release-15 ck-release-14 ck-release-13.2 ck-release-13 ck-release-12 ck-release-11 ck-release-10 ck-release-9 ck-release-7 alk-release-15 alk-release-14 alk-release-13.2 alk-release-13 alk-release-12 alk-release-11 alk-release-10 alk-release-9 alk-release-7
无相关合并请求
...@@ -129,11 +129,11 @@ static inline int ppa_proc_write(ppa_struct *dev, char *buffer, int length) ...@@ -129,11 +129,11 @@ static inline int ppa_proc_write(ppa_struct *dev, char *buffer, int length)
if ((length > 10) && (strncmp(buffer, "recon_tmo=", 10) == 0)) { if ((length > 10) && (strncmp(buffer, "recon_tmo=", 10) == 0)) {
x = simple_strtoul(buffer + 10, NULL, 0); x = simple_strtoul(buffer + 10, NULL, 0);
dev->recon_tmo = x; dev->recon_tmo = x;
printk("ppa: recon_tmo set to %ld\n", x); printk(KERN_INFO "ppa: recon_tmo set to %ld\n", x);
return length; return length;
} }
printk("ppa /proc: invalid variable\n"); printk(KERN_WARNING "ppa /proc: invalid variable\n");
return (-EINVAL); return -EINVAL;
} }
static int ppa_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int inout) static int ppa_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int inout)
...@@ -216,7 +216,7 @@ static unsigned char ppa_wait(ppa_struct *dev) ...@@ -216,7 +216,7 @@ static unsigned char ppa_wait(ppa_struct *dev)
/* Counter expired - Time out occurred */ /* Counter expired - Time out occurred */
ppa_fail(dev, DID_TIME_OUT); ppa_fail(dev, DID_TIME_OUT);
printk("ppa timeout in ppa_wait\n"); printk(KERN_WARNING "ppa timeout in ppa_wait\n");
return 0; /* command timed out */ return 0; /* command timed out */
} }
...@@ -248,7 +248,7 @@ static inline void ecp_sync(ppa_struct *dev) ...@@ -248,7 +248,7 @@ static inline void ecp_sync(ppa_struct *dev)
return; return;
udelay(5); udelay(5);
} }
printk("ppa: ECP sync failed as data still present in FIFO.\n"); printk(KERN_WARNING "ppa: ECP sync failed as data still present in FIFO.\n");
} }
} }
...@@ -328,7 +328,7 @@ static int ppa_out(ppa_struct *dev, char *buffer, int len) ...@@ -328,7 +328,7 @@ static int ppa_out(ppa_struct *dev, char *buffer, int len)
break; break;
default: default:
printk("PPA: bug in ppa_out()\n"); printk(KERN_ERR "PPA: bug in ppa_out()\n");
r = 0; r = 0;
} }
return r; return r;
...@@ -381,7 +381,7 @@ static int ppa_in(ppa_struct *dev, char *buffer, int len) ...@@ -381,7 +381,7 @@ static int ppa_in(ppa_struct *dev, char *buffer, int len)
break; break;
default: default:
printk("PPA: bug in ppa_ins()\n"); printk(KERN_ERR "PPA: bug in ppa_ins()\n");
r = 0; r = 0;
break; break;
} }
...@@ -633,7 +633,7 @@ static void ppa_interrupt(struct work_struct *work) ...@@ -633,7 +633,7 @@ static void ppa_interrupt(struct work_struct *work)
struct scsi_cmnd *cmd = dev->cur_cmd; struct scsi_cmnd *cmd = dev->cur_cmd;
if (!cmd) { if (!cmd) {
printk("PPA: bug in ppa_interrupt\n"); printk(KERN_ERR "PPA: bug in ppa_interrupt\n");
return; return;
} }
if (ppa_engine(dev, cmd)) { if (ppa_engine(dev, cmd)) {
...@@ -646,31 +646,31 @@ static void ppa_interrupt(struct work_struct *work) ...@@ -646,31 +646,31 @@ static void ppa_interrupt(struct work_struct *work)
case DID_OK: case DID_OK:
break; break;
case DID_NO_CONNECT: case DID_NO_CONNECT:
printk("ppa: no device at SCSI ID %i\n", cmd->device->target); printk(KERN_DEBUG "ppa: no device at SCSI ID %i\n", cmd->device->target);
break; break;
case DID_BUS_BUSY: case DID_BUS_BUSY:
printk("ppa: BUS BUSY - EPP timeout detected\n"); printk(KERN_DEBUG "ppa: BUS BUSY - EPP timeout detected\n");
break; break;
case DID_TIME_OUT: case DID_TIME_OUT:
printk("ppa: unknown timeout\n"); printk(KERN_DEBUG "ppa: unknown timeout\n");
break; break;
case DID_ABORT: case DID_ABORT:
printk("ppa: told to abort\n"); printk(KERN_DEBUG "ppa: told to abort\n");
break; break;
case DID_PARITY: case DID_PARITY:
printk("ppa: parity error (???)\n"); printk(KERN_DEBUG "ppa: parity error (???)\n");
break; break;
case DID_ERROR: case DID_ERROR:
printk("ppa: internal driver error\n"); printk(KERN_DEBUG "ppa: internal driver error\n");
break; break;
case DID_RESET: case DID_RESET:
printk("ppa: told to reset device\n"); printk(KERN_DEBUG "ppa: told to reset device\n");
break; break;
case DID_BAD_INTR: case DID_BAD_INTR:
printk("ppa: bad interrupt (???)\n"); printk(KERN_WARNING "ppa: bad interrupt (???)\n");
break; break;
default: default:
printk("ppa: bad return code (%02x)\n", printk(KERN_WARNING "ppa: bad return code (%02x)\n",
(cmd->result >> 16) & 0xff); (cmd->result >> 16) & 0xff);
} }
#endif #endif
...@@ -724,8 +724,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) ...@@ -724,8 +724,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
if (retv) { if (retv) {
if (time_after(jiffies, dev->jstart + (1 * HZ))) { if (time_after(jiffies, dev->jstart + (1 * HZ))) {
printk printk(KERN_ERR "ppa: Parallel port cable is unplugged.\n");
("ppa: Parallel port cable is unplugged!!\n");
ppa_fail(dev, DID_BUS_BUSY); ppa_fail(dev, DID_BUS_BUSY);
return 0; return 0;
} else { } else {
...@@ -755,11 +754,9 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) ...@@ -755,11 +754,9 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
case 4: /* Phase 4 - Setup scatter/gather buffers */ case 4: /* Phase 4 - Setup scatter/gather buffers */
if (cmd->use_sg) { if (cmd->use_sg) {
/* if many buffers are available, start filling the first */ /* if many buffers are available, start filling the first */
cmd->SCp.buffer = cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
(struct scatterlist *) cmd->request_buffer;
cmd->SCp.this_residual = cmd->SCp.buffer->length; cmd->SCp.this_residual = cmd->SCp.buffer->length;
cmd->SCp.ptr = cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) +
page_address(cmd->SCp.buffer->page) +
cmd->SCp.buffer->offset; cmd->SCp.buffer->offset;
} else { } else {
/* else fill the only available buffer */ /* else fill the only available buffer */
...@@ -800,7 +797,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) ...@@ -800,7 +797,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
break; break;
default: default:
printk("ppa: Invalid scsi phase\n"); printk(KERN_ERR "ppa: Invalid scsi phase\n");
} }
return 0; return 0;
} }
...@@ -811,7 +808,7 @@ static int ppa_queuecommand(struct scsi_cmnd *cmd, ...@@ -811,7 +808,7 @@ static int ppa_queuecommand(struct scsi_cmnd *cmd,
ppa_struct *dev = ppa_dev(cmd->device->host); ppa_struct *dev = ppa_dev(cmd->device->host);
if (dev->cur_cmd) { if (dev->cur_cmd) {
printk("PPA: bug in ppa_queuecommand\n"); printk(KERN_ERR "PPA: bug in ppa_queuecommand\n");
return 0; return 0;
} }
dev->failed = 0; dev->failed = 0;
...@@ -899,7 +896,7 @@ static int device_check(ppa_struct *dev) ...@@ -899,7 +896,7 @@ static int device_check(ppa_struct *dev)
/* This routine looks for a device and then attempts to use EPP /* This routine looks for a device and then attempts to use EPP
to send a command. If all goes as planned then EPP is available. */ to send a command. If all goes as planned then EPP is available. */
static char cmd[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static u8 cmd[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
int loop, old_mode, status, k, ppb = dev->base; int loop, old_mode, status, k, ppb = dev->base;
unsigned char l; unsigned char l;
...@@ -909,14 +906,14 @@ static int device_check(ppa_struct *dev) ...@@ -909,14 +906,14 @@ static int device_check(ppa_struct *dev)
if ((ppb & 0x0007) == 0x0000) if ((ppb & 0x0007) == 0x0000)
dev->mode = PPA_EPP_32; dev->mode = PPA_EPP_32;
second_pass: second_pass:
ppa_connect(dev, CONNECT_EPP_MAYBE); ppa_connect(dev, CONNECT_EPP_MAYBE);
/* Select SCSI device */ /* Select SCSI device */
if (!ppa_select(dev, loop)) { if (!ppa_select(dev, loop)) {
ppa_disconnect(dev); ppa_disconnect(dev);
continue; continue;
} }
printk("ppa: Found device at ID %i, Attempting to use %s\n", printk(KERN_INFO "ppa: Found device at ID %i, Attempting to use %s\n",
loop, PPA_MODE_STRING[dev->mode]); loop, PPA_MODE_STRING[dev->mode]);
/* Send SCSI command */ /* Send SCSI command */
...@@ -965,7 +962,7 @@ static int device_check(ppa_struct *dev) ...@@ -965,7 +962,7 @@ static int device_check(ppa_struct *dev)
return -EIO; return -EIO;
} }
ppa_disconnect(dev); ppa_disconnect(dev);
printk("ppa: Communication established with ID %i using %s\n", printk(KERN_INFO "ppa: Communication established with ID %i using %s\n",
loop, PPA_MODE_STRING[dev->mode]); loop, PPA_MODE_STRING[dev->mode]);
ppa_connect(dev, CONNECT_EPP_MAYBE); ppa_connect(dev, CONNECT_EPP_MAYBE);
ppa_reset_pulse(ppb); ppa_reset_pulse(ppb);
...@@ -1140,7 +1137,7 @@ static struct parport_driver ppa_driver = { ...@@ -1140,7 +1137,7 @@ static struct parport_driver ppa_driver = {
static int __init ppa_driver_init(void) static int __init ppa_driver_init(void)
{ {
printk("ppa: Version %s\n", PPA_VERSION); printk(KERN_INFO "ppa: Version %s\n", PPA_VERSION);
return parport_register_driver(&ppa_driver); return parport_register_driver(&ppa_driver);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部