Re: [PATCH 4/4] sr: reduce debug noise in sr_do_ioctl
On Sun, 2015-01-18 at 16:11 +0100, Christoph Hellwig wrote: The midlayer scsi logging already logs the command and sense code if the logging level is high enough, no need to duplicate that in the sr driver. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/sr_ioctl.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index e8deb9c..03054c0 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -188,7 +188,6 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) struct scsi_sense_hdr sshdr; int result, err = 0, retries = 0; struct request_sense *sense = cgc-sense; - char logbuf[SCSI_LOG_BUFSIZE]; SDev = cd-device; @@ -246,9 +245,6 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) sr_printk(KERN_INFO, cd, CDROM not ready. Make sure there is a disc in the drive.\n); -#ifdef DEBUG - scsi_print_sense_hdr(cd-device, cd-cdi.name, sshdr); -#endif err = -ENOMEDIUM; break; case ILLEGAL_REQUEST: @@ -257,22 +253,8 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) sshdr.ascq == 0x00) /* sense: Invalid command operation code */ err = -EDRIVE_CANT_DO_THIS; -#ifdef DEBUG - __scsi_format_command(logbuf, sizeof(logbuf), - cgc-cmd, CDROM_PACKET_SIZE); - sr_printk(KERN_INFO, cd, - CDROM (ioctl) invalid command: %s\n, - logbuf); - scsi_print_sense_hdr(cd-device, cd-cdi.name, sshdr); -#endif break; default: - __scsi_format_command(logbuf, sizeof(logbuf), - cgc-cmd, CDROM_PACKET_SIZE); - sr_printk(KERN_ERR, cd, - CDROM (ioctl) error, command: %s\n, - logbuf); - scsi_print_sense_hdr(cd-device, cd-cdi.name, sshdr); err = -EIO; } } Reviewed-by: Ewan D. Milne emi...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/4] sr: reduce debug noise in sr_do_ioctl
On 01/18/2015 04:11 PM, Christoph Hellwig wrote: The midlayer scsi logging already logs the command and sense code if the logging level is high enough, no need to duplicate that in the sr driver. Signed-off-by: Christoph Hellwig h...@lst.de Reviewed-by: Hannes Reinecke h...@suse.de Cheers, Hannes -- Dr. Hannes ReineckezSeries Storage h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/4] sr: reduce debug noise in sr_do_ioctl
The midlayer scsi logging already logs the command and sense code if the logging level is high enough, no need to duplicate that in the sr driver. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/sr_ioctl.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index e8deb9c..03054c0 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -188,7 +188,6 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) struct scsi_sense_hdr sshdr; int result, err = 0, retries = 0; struct request_sense *sense = cgc-sense; - char logbuf[SCSI_LOG_BUFSIZE]; SDev = cd-device; @@ -246,9 +245,6 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) sr_printk(KERN_INFO, cd, CDROM not ready. Make sure there is a disc in the drive.\n); -#ifdef DEBUG - scsi_print_sense_hdr(cd-device, cd-cdi.name, sshdr); -#endif err = -ENOMEDIUM; break; case ILLEGAL_REQUEST: @@ -257,22 +253,8 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) sshdr.ascq == 0x00) /* sense: Invalid command operation code */ err = -EDRIVE_CANT_DO_THIS; -#ifdef DEBUG - __scsi_format_command(logbuf, sizeof(logbuf), - cgc-cmd, CDROM_PACKET_SIZE); - sr_printk(KERN_INFO, cd, - CDROM (ioctl) invalid command: %s\n, - logbuf); - scsi_print_sense_hdr(cd-device, cd-cdi.name, sshdr); -#endif break; default: - __scsi_format_command(logbuf, sizeof(logbuf), - cgc-cmd, CDROM_PACKET_SIZE); - sr_printk(KERN_ERR, cd, - CDROM (ioctl) error, command: %s\n, - logbuf); - scsi_print_sense_hdr(cd-device, cd-cdi.name, sshdr); err = -EIO; } } -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html