From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Damien Le Moal <dlemoal@kernel.org>,
Hannes Reinecke <hare@suse.de>,
Bart Van Assche <bvanassche@acm.org>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: [PATCH 6/6] scsi: sd: Do not split error messages
Date: Tue, 30 Jul 2024 14:00:41 -0700 [thread overview]
Message-ID: <20240730210042.266504-7-bvanassche@acm.org> (raw)
In-Reply-To: <20240730210042.266504-1-bvanassche@acm.org>
Make it easier to find these error messages with grep. This patch has been
created as follows:
* Delete all occurrences of the following regular expression:
"[[:blank:]]*\\*\n[[:blank:]]*"
* Split long lines manually where necessary.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/scsi/sd.c | 54 ++++++++++++++++++++---------------------------
1 file changed, 23 insertions(+), 31 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3f4df58f2bbc..304da82fea4f 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1651,8 +1651,9 @@ static int sd_ioctl(struct block_device *bdev, blk_mode_t mode,
void __user *p = (void __user *)arg;
int error;
- SCSI_LOG_IOCTL(1, sd_printk(KERN_INFO, sdkp, "sd_ioctl: disk=%s, "
- "cmd=0x%x\n", disk->disk_name, cmd));
+ SCSI_LOG_IOCTL(1, sd_printk(KERN_INFO, sdkp,
+ "sd_ioctl: disk=%s, cmd=0x%x\n",
+ disk->disk_name, cmd));
if (bdev_is_partition(bdev) && !capable(CAP_SYS_RAWIO))
return -ENOIOCTLCMD;
@@ -2549,8 +2550,8 @@ static int sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer
type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */
if (type > T10_PI_TYPE3_PROTECTION) {
- sd_printk(KERN_ERR, sdkp, "formatted with unsupported" \
- " protection type %u. Disabling disk!\n",
+ sd_printk(KERN_ERR, sdkp,
+ "formatted with unsupported protection type %u. Disabling disk!\n",
type);
sdkp->protection_type = 0;
return -ENODEV;
@@ -2829,8 +2830,8 @@ sd_read_capacity(struct scsi_disk *sdkp, struct queue_limits *lim,
if ((sizeof(sdkp->capacity) > 4) &&
(sdkp->capacity > 0xffffffffULL)) {
int old_sector_size = sector_size;
- sd_printk(KERN_NOTICE, sdkp, "Very big device. "
- "Trying to use READ CAPACITY(16).\n");
+ sd_printk(KERN_NOTICE, sdkp,
+ "Very big device. Trying to use READ CAPACITY(16).\n");
sector_size = read_capacity_16(sdkp, sdp, lim, buffer);
if (sector_size < 0) {
sd_printk(KERN_NOTICE, sdkp,
@@ -2856,8 +2857,8 @@ sd_read_capacity(struct scsi_disk *sdkp, struct queue_limits *lim,
*/
if (sdp->fix_capacity ||
(sdp->guess_capacity && (sdkp->capacity & 0x01))) {
- sd_printk(KERN_INFO, sdkp, "Adjusting the sector count "
- "from its reported value: %llu\n",
+ sd_printk(KERN_INFO, sdkp,
+ "Adjusting the sector count from its reported value: %llu\n",
(unsigned long long) sdkp->capacity);
--sdkp->capacity;
}
@@ -2865,8 +2866,7 @@ sd_read_capacity(struct scsi_disk *sdkp, struct queue_limits *lim,
got_data:
if (sector_size == 0) {
sector_size = 512;
- sd_printk(KERN_NOTICE, sdkp, "Sector size 0 reported, "
- "assuming 512.\n");
+ sd_printk(KERN_NOTICE, sdkp, "Sector size 0 reported, assuming 512.\n");
}
if (sector_size != 512 &&
@@ -3071,8 +3071,9 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
if (len < 3)
goto bad_sense;
else if (len > SD_BUF_SIZE) {
- sd_first_printk(KERN_NOTICE, sdkp, "Truncating mode parameter "
- "data from %d to %d bytes\n", len, SD_BUF_SIZE);
+ sd_first_printk(KERN_NOTICE, sdkp,
+ "Truncating mode parameter data from %d to %d bytes\n",
+ len, SD_BUF_SIZE);
len = SD_BUF_SIZE;
}
if (modepage == 0x3F && sdp->use_192_bytes_for_3f)
@@ -3095,8 +3096,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
*/
if (len - offset <= 2) {
sd_first_printk(KERN_ERR, sdkp,
- "Incomplete mode parameter "
- "data\n");
+ "Incomplete mode parameter data\n");
goto defaults;
} else {
modepage = page_code;
@@ -3111,8 +3111,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
offset += 2 + buffer[offset+1];
else {
sd_first_printk(KERN_ERR, sdkp,
- "Incomplete mode "
- "parameter data\n");
+ "Incomplete mode parameter data\n");
goto defaults;
}
}
@@ -3579,8 +3578,7 @@ static bool sd_validate_min_xfer_size(struct scsi_disk *sdkp)
if (min_xfer_bytes & (sdkp->physical_block_size - 1)) {
sd_first_printk(KERN_WARNING, sdkp,
- "Preferred minimum I/O size %u bytes not a " \
- "multiple of physical block size (%u bytes)\n",
+ "Preferred minimum I/O size %u bytes not a multiple of physical block size (%u bytes)\n",
min_xfer_bytes, sdkp->physical_block_size);
sdkp->min_xfer_blocks = 0;
return false;
@@ -3610,41 +3608,35 @@ static bool sd_validate_opt_xfer_size(struct scsi_disk *sdkp,
if (sdkp->opt_xfer_blocks > dev_max) {
sd_first_printk(KERN_WARNING, sdkp,
- "Optimal transfer size %u logical blocks " \
- "> dev_max (%u logical blocks)\n",
+ "Optimal transfer size %u logical blocks > dev_max (%u logical blocks)\n",
sdkp->opt_xfer_blocks, dev_max);
return false;
}
if (sdkp->opt_xfer_blocks > SD_DEF_XFER_BLOCKS) {
sd_first_printk(KERN_WARNING, sdkp,
- "Optimal transfer size %u logical blocks " \
- "> sd driver limit (%u logical blocks)\n",
+ "Optimal transfer size %u logical blocks > sd driver limit (%u logical blocks)\n",
sdkp->opt_xfer_blocks, SD_DEF_XFER_BLOCKS);
return false;
}
if (opt_xfer_bytes < PAGE_SIZE) {
sd_first_printk(KERN_WARNING, sdkp,
- "Optimal transfer size %u bytes < " \
- "PAGE_SIZE (%u bytes)\n",
+ "Optimal transfer size %u bytes < PAGE_SIZE (%u bytes)\n",
opt_xfer_bytes, (unsigned int)PAGE_SIZE);
return false;
}
if (min_xfer_bytes && opt_xfer_bytes % min_xfer_bytes) {
sd_first_printk(KERN_WARNING, sdkp,
- "Optimal transfer size %u bytes not a " \
- "multiple of preferred minimum block " \
- "size (%u bytes)\n",
+ "Optimal transfer size %u bytes not a multiple of preferred minimum block size (%u bytes)\n",
opt_xfer_bytes, min_xfer_bytes);
return false;
}
if (opt_xfer_bytes & (sdkp->physical_block_size - 1)) {
sd_first_printk(KERN_WARNING, sdkp,
- "Optimal transfer size %u bytes not a " \
- "multiple of physical block size (%u bytes)\n",
+ "Optimal transfer size %u bytes not a multiple of physical block size (%u bytes)\n",
opt_xfer_bytes, sdkp->physical_block_size);
return false;
}
@@ -3706,8 +3698,8 @@ static int sd_revalidate_disk(struct gendisk *disk)
buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
if (!buffer) {
- sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "
- "allocation failure.\n");
+ sd_printk(KERN_WARNING, sdkp,
+ "sd_revalidate_disk: Memory allocation failure.\n");
goto out;
}
next prev parent reply other threads:[~2024-07-30 21:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 21:00 [PATCH 0/6] SCSI disk source code cleanup Bart Van Assche
2024-07-30 21:00 ` [PATCH 1/6] scsi: sd: Move the sd_remove() function definition Bart Van Assche
2024-07-30 23:41 ` Damien Le Moal
2024-07-30 21:00 ` [PATCH 2/6] scsi: sd: Move the sd_config_discard() " Bart Van Assche
2024-07-30 23:42 ` Damien Le Moal
2024-07-30 21:00 ` [PATCH 3/6] scsi: sd: Move the sd_config_write_same() " Bart Van Assche
2024-07-30 23:43 ` Damien Le Moal
2024-07-30 21:00 ` [PATCH 4/6] scsi: sd: Move the scsi_disk_release() " Bart Van Assche
2024-07-30 23:43 ` Damien Le Moal
2024-07-30 21:00 ` [PATCH 5/6] scsi: sd: Move the sd_fops definition Bart Van Assche
2024-07-30 23:44 ` Damien Le Moal
2024-07-30 21:00 ` Bart Van Assche [this message]
2024-07-30 23:47 ` [PATCH 6/6] scsi: sd: Do not split error messages Damien Le Moal
2024-08-05 23:38 ` Bart Van Assche
2024-07-31 1:12 ` [PATCH 0/6] SCSI disk source code cleanup Himanshu Madhani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240730210042.266504-7-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox