Message ID | 20210716193140.25591-1-jpittman@redhat.com |
---|---|
State | New |
Headers | show |
Series | scsi: sd: only print initial write protect status if enabled | expand |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index b8d55af763f9..30c549cdf35f 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2702,8 +2702,8 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer) sdkp->write_prot = ((data.device_specific & 0x80) != 0); set_disk_ro(sdkp->disk, sdkp->write_prot); if (sdkp->first_scan || old_wp != sdkp->write_prot) { - sd_printk(KERN_NOTICE, sdkp, "Write Protect is %s\n", - sdkp->write_prot ? "on" : "off"); + if (sdkp->write_prot) + sd_printk(KERN_NOTICE, sdkp, "Write Protect is on"); sd_printk(KERN_DEBUG, sdkp, "Mode Sense: %4ph\n", buffer); } }