Commit 773bab4a authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

s390/dasd: fix multi-line printks with multiple KERN_<level>s

Do not use more than one KERN_<level> per printk.
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: default avatarStefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent b01a37a7
...@@ -3847,7 +3847,7 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page) ...@@ -3847,7 +3847,7 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
len = 0; len = 0;
while (from <= to) { while (from <= to) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" CCW %p: %08X %08X DAT:", " CCW %p: %08X %08X DAT:",
from, ((int *) from)[0], ((int *) from)[1]); from, ((int *) from)[0], ((int *) from)[1]);
...@@ -3908,23 +3908,23 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device, ...@@ -3908,23 +3908,23 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
return; return;
} }
/* dump the sense data */ /* dump the sense data */
len = sprintf(page, KERN_ERR PRINTK_HEADER len = sprintf(page, PRINTK_HEADER
" I/O status report for device %s:\n", " I/O status report for device %s:\n",
dev_name(&device->cdev->dev)); dev_name(&device->cdev->dev));
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" in req: %p CC:%02X FC:%02X AC:%02X SC:%02X DS:%02X " " in req: %p CC:%02X FC:%02X AC:%02X SC:%02X DS:%02X "
"CS:%02X RC:%d\n", "CS:%02X RC:%d\n",
req, scsw_cc(&irb->scsw), scsw_fctl(&irb->scsw), req, scsw_cc(&irb->scsw), scsw_fctl(&irb->scsw),
scsw_actl(&irb->scsw), scsw_stctl(&irb->scsw), scsw_actl(&irb->scsw), scsw_stctl(&irb->scsw),
scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw),
req ? req->intrc : 0); req ? req->intrc : 0);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" device %s: Failing CCW: %p\n", " device %s: Failing CCW: %p\n",
dev_name(&device->cdev->dev), dev_name(&device->cdev->dev),
(void *) (addr_t) irb->scsw.cmd.cpa); (void *) (addr_t) irb->scsw.cmd.cpa);
if (irb->esw.esw0.erw.cons) { if (irb->esw.esw0.erw.cons) {
for (sl = 0; sl < 4; sl++) { for (sl = 0; sl < 4; sl++) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" Sense(hex) %2d-%2d:", " Sense(hex) %2d-%2d:",
(8 * sl), ((8 * sl) + 7)); (8 * sl), ((8 * sl) + 7));
...@@ -3937,23 +3937,23 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device, ...@@ -3937,23 +3937,23 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
if (irb->ecw[27] & DASD_SENSE_BIT_0) { if (irb->ecw[27] & DASD_SENSE_BIT_0) {
/* 24 Byte Sense Data */ /* 24 Byte Sense Data */
sprintf(page + len, KERN_ERR PRINTK_HEADER sprintf(page + len, PRINTK_HEADER
" 24 Byte: %x MSG %x, " " 24 Byte: %x MSG %x, "
"%s MSGb to SYSOP\n", "%s MSGb to SYSOP\n",
irb->ecw[7] >> 4, irb->ecw[7] & 0x0f, irb->ecw[7] >> 4, irb->ecw[7] & 0x0f,
irb->ecw[1] & 0x10 ? "" : "no"); irb->ecw[1] & 0x10 ? "" : "no");
} else { } else {
/* 32 Byte Sense Data */ /* 32 Byte Sense Data */
sprintf(page + len, KERN_ERR PRINTK_HEADER sprintf(page + len, PRINTK_HEADER
" 32 Byte: Format: %x " " 32 Byte: Format: %x "
"Exception class %x\n", "Exception class %x\n",
irb->ecw[6] & 0x0f, irb->ecw[22] >> 4); irb->ecw[6] & 0x0f, irb->ecw[22] >> 4);
} }
} else { } else {
sprintf(page + len, KERN_ERR PRINTK_HEADER sprintf(page + len, PRINTK_HEADER
" SORRY - NO VALID SENSE AVAILABLE\n"); " SORRY - NO VALID SENSE AVAILABLE\n");
} }
printk("%s", page); printk(KERN_ERR "%s", page);
if (req) { if (req) {
/* req == NULL for unsolicited interrupts */ /* req == NULL for unsolicited interrupts */
...@@ -3962,10 +3962,10 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device, ...@@ -3962,10 +3962,10 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
first = req->cpaddr; first = req->cpaddr;
for (last = first; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++); for (last = first; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
to = min(first + 6, last); to = min(first + 6, last);
len = sprintf(page, KERN_ERR PRINTK_HEADER len = sprintf(page, PRINTK_HEADER
" Related CP in req: %p\n", req); " Related CP in req: %p\n", req);
dasd_eckd_dump_ccw_range(first, to, page + len); dasd_eckd_dump_ccw_range(first, to, page + len);
printk("%s", page); printk(KERN_ERR "%s", page);
/* print failing CCW area (maximum 4) */ /* print failing CCW area (maximum 4) */
/* scsw->cda is either valid or zero */ /* scsw->cda is either valid or zero */
...@@ -3975,7 +3975,7 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device, ...@@ -3975,7 +3975,7 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
irb->scsw.cmd.cpa; /* failing CCW */ irb->scsw.cmd.cpa; /* failing CCW */
if (from < fail - 2) { if (from < fail - 2) {
from = fail - 2; /* there is a gap - print header */ from = fail - 2; /* there is a gap - print header */
len += sprintf(page, KERN_ERR PRINTK_HEADER "......\n"); len += sprintf(page, PRINTK_HEADER "......\n");
} }
to = min(fail + 1, last); to = min(fail + 1, last);
len += dasd_eckd_dump_ccw_range(from, to, page + len); len += dasd_eckd_dump_ccw_range(from, to, page + len);
...@@ -3984,11 +3984,11 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device, ...@@ -3984,11 +3984,11 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
from = max(from, ++to); from = max(from, ++to);
if (from < last - 1) { if (from < last - 1) {
from = last - 1; /* there is a gap - print header */ from = last - 1; /* there is a gap - print header */
len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n"); len += sprintf(page + len, PRINTK_HEADER "......\n");
} }
len += dasd_eckd_dump_ccw_range(from, last, page + len); len += dasd_eckd_dump_ccw_range(from, last, page + len);
if (len > 0) if (len > 0)
printk("%s", page); printk(KERN_ERR "%s", page);
} }
free_page((unsigned long) page); free_page((unsigned long) page);
} }
...@@ -4012,10 +4012,10 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device, ...@@ -4012,10 +4012,10 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
return; return;
} }
/* dump the sense data */ /* dump the sense data */
len = sprintf(page, KERN_ERR PRINTK_HEADER len = sprintf(page, PRINTK_HEADER
" I/O status report for device %s:\n", " I/O status report for device %s:\n",
dev_name(&device->cdev->dev)); dev_name(&device->cdev->dev));
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" in req: %p CC:%02X FC:%02X AC:%02X SC:%02X DS:%02X " " in req: %p CC:%02X FC:%02X AC:%02X SC:%02X DS:%02X "
"CS:%02X fcxs:%02X schxs:%02X RC:%d\n", "CS:%02X fcxs:%02X schxs:%02X RC:%d\n",
req, scsw_cc(&irb->scsw), scsw_fctl(&irb->scsw), req, scsw_cc(&irb->scsw), scsw_fctl(&irb->scsw),
...@@ -4023,7 +4023,7 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device, ...@@ -4023,7 +4023,7 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw), scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw),
irb->scsw.tm.fcxs, irb->scsw.tm.schxs, irb->scsw.tm.fcxs, irb->scsw.tm.schxs,
req ? req->intrc : 0); req ? req->intrc : 0);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" device %s: Failing TCW: %p\n", " device %s: Failing TCW: %p\n",
dev_name(&device->cdev->dev), dev_name(&device->cdev->dev),
(void *) (addr_t) irb->scsw.tm.tcw); (void *) (addr_t) irb->scsw.tm.tcw);
...@@ -4035,43 +4035,42 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device, ...@@ -4035,43 +4035,42 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
(struct tcw *)(unsigned long)irb->scsw.tm.tcw); (struct tcw *)(unsigned long)irb->scsw.tm.tcw);
if (tsb) { if (tsb) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->length %d\n", tsb->length); " tsb->length %d\n", tsb->length);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->flags %x\n", tsb->flags); " tsb->flags %x\n", tsb->flags);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->dcw_offset %d\n", tsb->dcw_offset); " tsb->dcw_offset %d\n", tsb->dcw_offset);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->count %d\n", tsb->count); " tsb->count %d\n", tsb->count);
residual = tsb->count - 28; residual = tsb->count - 28;
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" residual %d\n", residual); " residual %d\n", residual);
switch (tsb->flags & 0x07) { switch (tsb->flags & 0x07) {
case 1: /* tsa_iostat */ case 1: /* tsa_iostat */
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->tsa.iostat.dev_time %d\n", " tsb->tsa.iostat.dev_time %d\n",
tsb->tsa.iostat.dev_time); tsb->tsa.iostat.dev_time);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->tsa.iostat.def_time %d\n", " tsb->tsa.iostat.def_time %d\n",
tsb->tsa.iostat.def_time); tsb->tsa.iostat.def_time);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->tsa.iostat.queue_time %d\n", " tsb->tsa.iostat.queue_time %d\n",
tsb->tsa.iostat.queue_time); tsb->tsa.iostat.queue_time);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->tsa.iostat.dev_busy_time %d\n", " tsb->tsa.iostat.dev_busy_time %d\n",
tsb->tsa.iostat.dev_busy_time); tsb->tsa.iostat.dev_busy_time);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->tsa.iostat.dev_act_time %d\n", " tsb->tsa.iostat.dev_act_time %d\n",
tsb->tsa.iostat.dev_act_time); tsb->tsa.iostat.dev_act_time);
sense = tsb->tsa.iostat.sense; sense = tsb->tsa.iostat.sense;
break; break;
case 2: /* ts_ddpc */ case 2: /* ts_ddpc */
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->tsa.ddpc.rc %d\n", tsb->tsa.ddpc.rc); " tsb->tsa.ddpc.rc %d\n", tsb->tsa.ddpc.rc);
for (sl = 0; sl < 2; sl++) { for (sl = 0; sl < 2; sl++) {
len += sprintf(page + len, len += sprintf(page + len, PRINTK_HEADER
KERN_ERR PRINTK_HEADER
" tsb->tsa.ddpc.rcq %2d-%2d: ", " tsb->tsa.ddpc.rcq %2d-%2d: ",
(8 * sl), ((8 * sl) + 7)); (8 * sl), ((8 * sl) + 7));
rcq = tsb->tsa.ddpc.rcq; rcq = tsb->tsa.ddpc.rcq;
...@@ -4084,15 +4083,14 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device, ...@@ -4084,15 +4083,14 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
sense = tsb->tsa.ddpc.sense; sense = tsb->tsa.ddpc.sense;
break; break;
case 3: /* tsa_intrg */ case 3: /* tsa_intrg */
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" tsb->tsa.intrg.: not supportet yet \n"); " tsb->tsa.intrg.: not supportet yet\n");
break; break;
} }
if (sense) { if (sense) {
for (sl = 0; sl < 4; sl++) { for (sl = 0; sl < 4; sl++) {
len += sprintf(page + len, len += sprintf(page + len, PRINTK_HEADER
KERN_ERR PRINTK_HEADER
" Sense(hex) %2d-%2d:", " Sense(hex) %2d-%2d:",
(8 * sl), ((8 * sl) + 7)); (8 * sl), ((8 * sl) + 7));
for (sct = 0; sct < 8; sct++) { for (sct = 0; sct < 8; sct++) {
...@@ -4104,27 +4102,27 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device, ...@@ -4104,27 +4102,27 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
if (sense[27] & DASD_SENSE_BIT_0) { if (sense[27] & DASD_SENSE_BIT_0) {
/* 24 Byte Sense Data */ /* 24 Byte Sense Data */
sprintf(page + len, KERN_ERR PRINTK_HEADER sprintf(page + len, PRINTK_HEADER
" 24 Byte: %x MSG %x, " " 24 Byte: %x MSG %x, "
"%s MSGb to SYSOP\n", "%s MSGb to SYSOP\n",
sense[7] >> 4, sense[7] & 0x0f, sense[7] >> 4, sense[7] & 0x0f,
sense[1] & 0x10 ? "" : "no"); sense[1] & 0x10 ? "" : "no");
} else { } else {
/* 32 Byte Sense Data */ /* 32 Byte Sense Data */
sprintf(page + len, KERN_ERR PRINTK_HEADER sprintf(page + len, PRINTK_HEADER
" 32 Byte: Format: %x " " 32 Byte: Format: %x "
"Exception class %x\n", "Exception class %x\n",
sense[6] & 0x0f, sense[22] >> 4); sense[6] & 0x0f, sense[22] >> 4);
} }
} else { } else {
sprintf(page + len, KERN_ERR PRINTK_HEADER sprintf(page + len, PRINTK_HEADER
" SORRY - NO VALID SENSE AVAILABLE\n"); " SORRY - NO VALID SENSE AVAILABLE\n");
} }
} else { } else {
sprintf(page + len, KERN_ERR PRINTK_HEADER sprintf(page + len, PRINTK_HEADER
" SORRY - NO TSB DATA AVAILABLE\n"); " SORRY - NO TSB DATA AVAILABLE\n");
} }
printk("%s", page); printk(KERN_ERR "%s", page);
free_page((unsigned long) page); free_page((unsigned long) page);
} }
......
...@@ -479,19 +479,19 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -479,19 +479,19 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
"No memory to dump sense data"); "No memory to dump sense data");
return; return;
} }
len = sprintf(page, KERN_ERR PRINTK_HEADER len = sprintf(page, PRINTK_HEADER
" I/O status report for device %s:\n", " I/O status report for device %s:\n",
dev_name(&device->cdev->dev)); dev_name(&device->cdev->dev));
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" in req: %p CS: 0x%02X DS: 0x%02X\n", req, " in req: %p CS: 0x%02X DS: 0x%02X\n", req,
irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); irb->scsw.cmd.cstat, irb->scsw.cmd.dstat);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" device %s: Failing CCW: %p\n", " device %s: Failing CCW: %p\n",
dev_name(&device->cdev->dev), dev_name(&device->cdev->dev),
(void *) (addr_t) irb->scsw.cmd.cpa); (void *) (addr_t) irb->scsw.cmd.cpa);
if (irb->esw.esw0.erw.cons) { if (irb->esw.esw0.erw.cons) {
for (sl = 0; sl < 4; sl++) { for (sl = 0; sl < 4; sl++) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" Sense(hex) %2d-%2d:", " Sense(hex) %2d-%2d:",
(8 * sl), ((8 * sl) + 7)); (8 * sl), ((8 * sl) + 7));
...@@ -502,7 +502,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -502,7 +502,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
} }
} else { } else {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" SORRY - NO VALID SENSE AVAILABLE\n"); " SORRY - NO VALID SENSE AVAILABLE\n");
} }
printk(KERN_ERR "%s", page); printk(KERN_ERR "%s", page);
...@@ -512,10 +512,9 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -512,10 +512,9 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
act = req->cpaddr; act = req->cpaddr;
for (last = act; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++); for (last = act; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
end = min(act + 8, last); end = min(act + 8, last);
len = sprintf(page, KERN_ERR PRINTK_HEADER len = sprintf(page, PRINTK_HEADER " Related CP in req: %p\n", req);
" Related CP in req: %p\n", req);
while (act <= end) { while (act <= end) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" CCW %p: %08X %08X DAT:", " CCW %p: %08X %08X DAT:",
act, ((int *) act)[0], ((int *) act)[1]); act, ((int *) act)[0], ((int *) act)[1]);
for (count = 0; count < 32 && count < act->count; for (count = 0; count < 32 && count < act->count;
...@@ -533,11 +532,11 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -533,11 +532,11 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
len = 0; len = 0;
if (act < ((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa) - 2) { if (act < ((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa) - 2) {
act = ((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa) - 2; act = ((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa) - 2;
len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n"); len += sprintf(page + len, PRINTK_HEADER "......\n");
} }
end = min((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa + 2, last); end = min((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa + 2, last);
while (act <= end) { while (act <= end) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" CCW %p: %08X %08X DAT:", " CCW %p: %08X %08X DAT:",
act, ((int *) act)[0], ((int *) act)[1]); act, ((int *) act)[0], ((int *) act)[1]);
for (count = 0; count < 32 && count < act->count; for (count = 0; count < 32 && count < act->count;
...@@ -552,10 +551,10 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -552,10 +551,10 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
/* print last CCWs */ /* print last CCWs */
if (act < last - 2) { if (act < last - 2) {
act = last - 2; act = last - 2;
len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n"); len += sprintf(page + len, PRINTK_HEADER "......\n");
} }
while (act <= last) { while (act <= last) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, PRINTK_HEADER
" CCW %p: %08X %08X DAT:", " CCW %p: %08X %08X DAT:",
act, ((int *) act)[0], ((int *) act)[1]); act, ((int *) act)[0], ((int *) act)[1]);
for (count = 0; count < 32 && count < act->count; for (count = 0; count < 32 && count < act->count;
......
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