Skip to content

Commit

Permalink
s390/dasd: Remove %p format specifier from error messages
Browse files Browse the repository at this point in the history
Printing pointer in error messages doesn't add any value since the
addresses are hashed. Remove the %p format specifier and adapt the error
messages slightly.

Replace %p with %px in ERP to get the actual addresses since ERP is used
for debugging purposes only anyway.

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20240208164248.540985-8-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jan Höppner authored and Jens Axboe committed Feb 8, 2024
1 parent 0b3644b commit 4ba6366
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
20 changes: 8 additions & 12 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
}
if (cqr->retries < 0) {
dev_err(&device->cdev->dev,
"Start I/O ran out of retries %p\n", cqr);
"Start I/O ran out of retries\n");
cqr->status = DASD_CQR_ERROR;
return -EIO;
}
Expand Down Expand Up @@ -1907,7 +1907,7 @@ static void __dasd_process_cqr(struct dasd_device *device,
break;
default:
dev_err(&device->cdev->dev,
"Unexpected CQR status %p %02x", cqr, cqr->status);
"Unexpected CQR status %02x", cqr->status);
BUG();
}
if (cqr->callback)
Expand Down Expand Up @@ -1972,16 +1972,14 @@ static void __dasd_device_check_expire(struct dasd_device *device)
if (device->discipline->term_IO(cqr) != 0) {
/* Hmpf, try again in 5 sec */
dev_err(&device->cdev->dev,
"cqr %p timed out (%lus) but cannot be "
"ended, retrying in 5 s\n",
cqr, (cqr->expires/HZ));
"CQR timed out (%lus) but cannot be ended, retrying in 5s\n",
(cqr->expires / HZ));
cqr->expires += 5*HZ;
dasd_device_set_timer(device, 5*HZ);
} else {
dev_err(&device->cdev->dev,
"cqr %p timed out (%lus), %i retries "
"remaining\n", cqr, (cqr->expires/HZ),
cqr->retries);
"CQR timed out (%lus), %i retries remaining\n",
(cqr->expires / HZ), cqr->retries);
}
__dasd_device_check_autoquiesce_timeout(device, cqr);
}
Expand Down Expand Up @@ -2102,8 +2100,7 @@ int dasd_flush_device_queue(struct dasd_device *device)
if (rc) {
/* unable to terminate requeust */
dev_err(&device->cdev->dev,
"Flushing the DASD request queue "
"failed for request %p\n", cqr);
"Flushing the DASD request queue failed\n");
/* stop flush processing */
goto finished;
}
Expand Down Expand Up @@ -2619,8 +2616,7 @@ static int __dasd_cancel_req(struct dasd_ccw_req *cqr)
rc = device->discipline->term_IO(cqr);
if (rc) {
dev_err(&device->cdev->dev,
"Cancelling request %p failed with rc=%d\n",
cqr, rc);
"Cancelling request failed with rc=%d\n", rc);
} else {
cqr->stopclk = get_tod_clock();
}
Expand Down
14 changes: 5 additions & 9 deletions drivers/s390/block/dasd_3990_erp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2659,7 +2659,7 @@ dasd_3990_erp_further_erp(struct dasd_ccw_req *erp)
* necessary
*/
dev_err(&device->cdev->dev,
"ERP %p has run out of retries and failed\n", erp);
"ERP %px has run out of retries and failed\n", erp);

erp->status = DASD_CQR_FAILED;
}
Expand Down Expand Up @@ -2782,11 +2782,9 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
"ERP chain at BEGINNING of ERP-ACTION\n");
for (temp_erp = cqr;
temp_erp != NULL; temp_erp = temp_erp->refers) {

dev_err(&device->cdev->dev,
"ERP %p (%02x) refers to %p\n",
temp_erp, temp_erp->status,
temp_erp->refers);
"ERP %px (%02x) refers to %px\n",
temp_erp, temp_erp->status, temp_erp->refers);
}
}

Expand Down Expand Up @@ -2833,11 +2831,9 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
"ERP chain at END of ERP-ACTION\n");
for (temp_erp = erp;
temp_erp != NULL; temp_erp = temp_erp->refers) {

dev_err(&device->cdev->dev,
"ERP %p (%02x) refers to %p\n",
temp_erp, temp_erp->status,
temp_erp->refers);
"ERP %px (%02x) refers to %px\n",
temp_erp, temp_erp->status, temp_erp->refers);
}
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/s390/block/dasd_erp.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ dasd_log_sense(struct dasd_ccw_req *cqr, struct irb *irb)
device = cqr->startdev;
if (cqr->intrc == -ETIMEDOUT) {
dev_err(&device->cdev->dev,
"A timeout error occurred for cqr %p\n", cqr);
"A timeout error occurred for cqr %px\n", cqr);
return;
}
if (cqr->intrc == -ENOLINK) {
dev_err(&device->cdev->dev,
"A transport error occurred for cqr %p\n", cqr);
"A transport error occurred for cqr %px\n", cqr);
return;
}
/* dump sense data */
Expand Down

0 comments on commit 4ba6366

Please sign in to comment.