s390/dasd: fix multi-line printks with multiple KERN_<level>s
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 23 Oct 2012 18:28:37 +0000 (20:28 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 23 Nov 2012 10:14:26 +0000 (11:14 +0100)
Do not use more than one KERN_<level> per printk.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_fba.c

index 108332b..705b182 100644 (file)
@@ -3847,7 +3847,7 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
 
        len = 0;
        while (from <= to) {
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " CCW %p: %08X %08X DAT:",
                               from, ((int *) from)[0], ((int *) from)[1]);
 
@@ -3908,23 +3908,23 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
                return;
        }
        /* dump the sense data */
-       len = sprintf(page,  KERN_ERR PRINTK_HEADER
+       len = sprintf(page, PRINTK_HEADER
                      " I/O status report for device %s:\n",
                      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 "
                       "CS:%02X RC:%d\n",
                       req, scsw_cc(&irb->scsw), scsw_fctl(&irb->scsw),
                       scsw_actl(&irb->scsw), scsw_stctl(&irb->scsw),
                       scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw),
                       req ? req->intrc : 0);
-       len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+       len += sprintf(page + len, PRINTK_HEADER
                       " device %s: Failing CCW: %p\n",
                       dev_name(&device->cdev->dev),
                       (void *) (addr_t) irb->scsw.cmd.cpa);
        if (irb->esw.esw0.erw.cons) {
                for (sl = 0; sl < 4; sl++) {
-                       len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+                       len += sprintf(page + len, PRINTK_HEADER
                                       " Sense(hex) %2d-%2d:",
                                       (8 * sl), ((8 * sl) + 7));
 
@@ -3937,23 +3937,23 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
 
                if (irb->ecw[27] & DASD_SENSE_BIT_0) {
                        /* 24 Byte Sense Data */
-                       sprintf(page + len, KERN_ERR PRINTK_HEADER
+                       sprintf(page + len, PRINTK_HEADER
                                " 24 Byte: %x MSG %x, "
                                "%s MSGb to SYSOP\n",
                                irb->ecw[7] >> 4, irb->ecw[7] & 0x0f,
                                irb->ecw[1] & 0x10 ? "" : "no");
                } else {
                        /* 32 Byte Sense Data */
-                       sprintf(page + len, KERN_ERR PRINTK_HEADER
+                       sprintf(page + len, PRINTK_HEADER
                                " 32 Byte: Format: %x "
                                "Exception class %x\n",
                                irb->ecw[6] & 0x0f, irb->ecw[22] >> 4);
                }
        } else {
-               sprintf(page + len, KERN_ERR PRINTK_HEADER
+               sprintf(page + len, PRINTK_HEADER
                        " SORRY - NO VALID SENSE AVAILABLE\n");
        }
-       printk("%s", page);
+       printk(KERN_ERR "%s", page);
 
        if (req) {
                /* req == NULL for unsolicited interrupts */
@@ -3962,10 +3962,10 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
                first = req->cpaddr;
                for (last = first; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); 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);
                dasd_eckd_dump_ccw_range(first, to, page + len);
-               printk("%s", page);
+               printk(KERN_ERR "%s", page);
 
                /* print failing CCW area (maximum 4) */
                /* scsw->cda is either valid or zero  */
@@ -3975,7 +3975,7 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
                                irb->scsw.cmd.cpa; /* failing CCW */
                if (from <  fail - 2) {
                        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);
                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,
                from = max(from, ++to);
                if (from < last - 1) {
                        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);
                if (len > 0)
-                       printk("%s", page);
+                       printk(KERN_ERR "%s", page);
        }
        free_page((unsigned long) page);
 }
@@ -4012,10 +4012,10 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
                return;
        }
        /* dump the sense data */
-       len = sprintf(page,  KERN_ERR PRINTK_HEADER
+       len = sprintf(page, PRINTK_HEADER
                      " I/O status report for device %s:\n",
                      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 "
                       "CS:%02X fcxs:%02X schxs:%02X RC:%d\n",
                       req, scsw_cc(&irb->scsw), scsw_fctl(&irb->scsw),
@@ -4023,7 +4023,7 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
                       scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw),
                       irb->scsw.tm.fcxs, irb->scsw.tm.schxs,
                       req ? req->intrc : 0);
-       len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+       len += sprintf(page + len, PRINTK_HEADER
                       " device %s: Failing TCW: %p\n",
                       dev_name(&device->cdev->dev),
                       (void *) (addr_t) irb->scsw.tm.tcw);
@@ -4035,43 +4035,42 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
                        (struct tcw *)(unsigned long)irb->scsw.tm.tcw);
 
        if (tsb) {
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " 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);
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " 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);
                residual = tsb->count - 28;
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " residual %d\n", residual);
 
                switch (tsb->flags & 0x07) {
                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);
-                       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);
-                       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);
-                       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);
-                       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);
                        sense = tsb->tsa.iostat.sense;
                        break;
                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);
                        for (sl = 0; sl < 2; sl++) {
-                               len += sprintf(page + len,
-                                              KERN_ERR PRINTK_HEADER
+                               len += sprintf(page + len, PRINTK_HEADER
                                               " tsb->tsa.ddpc.rcq %2d-%2d: ",
                                               (8 * sl), ((8 * sl) + 7));
                                rcq = tsb->tsa.ddpc.rcq;
@@ -4084,15 +4083,14 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
                        sense = tsb->tsa.ddpc.sense;
                        break;
                case 3: /* tsa_intrg */
-                       len += sprintf(page + len, KERN_ERR PRINTK_HEADER
-                                     " tsb->tsa.intrg.: not supportet yet \n");
+                       len += sprintf(page + len, PRINTK_HEADER
+                                     " tsb->tsa.intrg.: not supportet yet\n");
                        break;
                }
 
                if (sense) {
                        for (sl = 0; sl < 4; sl++) {
-                               len += sprintf(page + len,
-                                              KERN_ERR PRINTK_HEADER
+                               len += sprintf(page + len, PRINTK_HEADER
                                               " Sense(hex) %2d-%2d:",
                                               (8 * sl), ((8 * sl) + 7));
                                for (sct = 0; sct < 8; sct++) {
@@ -4104,27 +4102,27 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
 
                        if (sense[27] & DASD_SENSE_BIT_0) {
                                /* 24 Byte Sense Data */
-                               sprintf(page + len, KERN_ERR PRINTK_HEADER
+                               sprintf(page + len, PRINTK_HEADER
                                        " 24 Byte: %x MSG %x, "
                                        "%s MSGb to SYSOP\n",
                                        sense[7] >> 4, sense[7] & 0x0f,
                                        sense[1] & 0x10 ? "" : "no");
                        } else {
                                /* 32 Byte Sense Data */
-                               sprintf(page + len, KERN_ERR PRINTK_HEADER
+                               sprintf(page + len, PRINTK_HEADER
                                        " 32 Byte: Format: %x "
                                        "Exception class %x\n",
                                        sense[6] & 0x0f, sense[22] >> 4);
                        }
                } else {
-                       sprintf(page + len, KERN_ERR PRINTK_HEADER
+                       sprintf(page + len, PRINTK_HEADER
                                " SORRY - NO VALID SENSE AVAILABLE\n");
                }
        } else {
-               sprintf(page + len, KERN_ERR PRINTK_HEADER
+               sprintf(page + len, PRINTK_HEADER
                        " SORRY - NO TSB DATA AVAILABLE\n");
        }
-       printk("%s", page);
+       printk(KERN_ERR "%s", page);
        free_page((unsigned long) page);
 }
 
index fb7f3bd..eb74850 100644 (file)
@@ -479,19 +479,19 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
                            "No memory to dump sense data");
                return;
        }
-       len = sprintf(page, KERN_ERR PRINTK_HEADER
+       len = sprintf(page, PRINTK_HEADER
                      " I/O status report for device %s:\n",
                      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,
                       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",
                       dev_name(&device->cdev->dev),
                       (void *) (addr_t) irb->scsw.cmd.cpa);
        if (irb->esw.esw0.erw.cons) {
                for (sl = 0; sl < 4; sl++) {
-                       len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+                       len += sprintf(page + len, PRINTK_HEADER
                                       " Sense(hex) %2d-%2d:",
                                       (8 * sl), ((8 * sl) + 7));
 
@@ -502,7 +502,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
                        len += sprintf(page + len, "\n");
                }
        } else {
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " SORRY - NO VALID SENSE AVAILABLE\n");
        }
        printk(KERN_ERR "%s", page);
@@ -512,10 +512,9 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
        act = req->cpaddr;
         for (last = act; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
        end = min(act + 8, last);
-       len = sprintf(page, KERN_ERR PRINTK_HEADER
-                     " Related CP in req: %p\n", req);
+       len = sprintf(page, PRINTK_HEADER " Related CP in req: %p\n", req);
        while (act <= end) {
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " CCW %p: %08X %08X DAT:",
                               act, ((int *) act)[0], ((int *) act)[1]);
                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,
        len = 0;
        if (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);
        while (act <= end) {
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " CCW %p: %08X %08X DAT:",
                               act, ((int *) act)[0], ((int *) act)[1]);
                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,
        /* print last CCWs */
        if (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) {
-               len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+               len += sprintf(page + len, PRINTK_HEADER
                               " CCW %p: %08X %08X DAT:",
                               act, ((int *) act)[0], ((int *) act)[1]);
                for (count = 0; count < 32 && count < act->count;