public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ewan Milne <emilne@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>,
	James Bottomley <JBottomley@Parallels.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 4/4] sr: reduce debug noise in sr_do_ioctl
Date: Mon, 19 Jan 2015 10:33:12 -0500	[thread overview]
Message-ID: <1421681592.3891.218.camel@localhost.localdomain> (raw)
In-Reply-To: <1421593891-19984-4-git-send-email-hch@lst.de>

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 <hch@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 <emilne@redhat.com>



  parent reply	other threads:[~2015-01-19 15:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18 15:11 [PATCH 1/4] scsi: always use format argumets for dev_printk Christoph Hellwig
2015-01-18 15:11 ` [PATCH 2/4] scsi: annotate sdev_prefix_printk and scmd_printk as printf-like Christoph Hellwig
2015-01-19  7:04   ` Hannes Reinecke
2015-01-19 15:32   ` Ewan Milne
2015-01-18 15:11 ` [PATCH 3/4] ch: remove debug noise in ch_do_scsi Christoph Hellwig
2015-01-19  7:05   ` Hannes Reinecke
2015-01-19 15:32   ` Ewan Milne
2015-01-18 15:11 ` [PATCH 4/4] sr: reduce debug noise in sr_do_ioctl Christoph Hellwig
2015-01-19  7:05   ` Hannes Reinecke
2015-01-19 15:33   ` Ewan Milne [this message]
2015-01-18 15:22 ` [PATCH 1/4] scsi: always use format argumets for dev_printk James Bottomley
2015-01-19  7:04 ` Hannes Reinecke
2015-01-19 15:32 ` Ewan Milne

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=1421681592.3891.218.camel@localhost.localdomain \
    --to=emilne@redhat.com \
    --cc=JBottomley@Parallels.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    /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