From patchwork Wed Jan 16 00:50:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10765277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F1DB13A4 for ; Wed, 16 Jan 2019 00:50:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3AD22A1B9 for ; Wed, 16 Jan 2019 00:50:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E83BF2E23C; Wed, 16 Jan 2019 00:50:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 706EF2A1B9 for ; Wed, 16 Jan 2019 00:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727121AbfAPAuq (ORCPT ); Tue, 15 Jan 2019 19:50:46 -0500 Received: from out002.mailprotect.be ([83.217.72.86]:37323 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727110AbfAPAup (ORCPT ); Tue, 15 Jan 2019 19:50:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=rfYiUkwg9FK4InlAFuzI5FmTJZ+ZndbL/MthdtDekqg=; b=njW0bVG0SWoY pmJ9ao6rEuUa6oTkjWSOtu2i/xyW3wj3+SRfEELLOWG8i6cZ3MwxVTKCVgnSWKM7L7SG3zzNme3Tg gijxeuhpxO0KVYBzbHasBr4mtW7y8HYzs3AG/A86A1Mzjt4tWzGGku92q2bfvtJVX7eJm6/K+2xpJ UcbRcvjZmqPZwnWkBQQpM+2CzYVes0GAgxcU3xkerT5hNWhPUyfsNyIH93YlsAwxCdWKgnNWctB+j 03WyKzf3qcJvr1WzzPZ9C26JclbBh58MebKv9PzoJg4Ajsp6k6Am3BMI7v3g8W1D5HEf6065HjIDi tK/3rIOwbCjbeczvXsmcKg==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gjZPh-0006Qq-HL; Wed, 16 Jan 2019 01:50:38 +0100 Received: from desktop-bart.svl.corp.google.com (unknown [104.133.8.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id AB5BAC0878; Wed, 16 Jan 2019 01:50:23 +0100 (CET) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke Subject: [PATCH v2 6/7] sd: Rename 'SCpnt' into 'cmd' Date: Tue, 15 Jan 2019 16:50:02 -0800 Message-Id: <20190116005003.230678-7-bvanassche@acm.org> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog In-Reply-To: <20190116005003.230678-1-bvanassche@acm.org> References: <20190116005003.230678-1-bvanassche@acm.org> MIME-Version: 1.0 X-Originating-IP: 178.208.39.155 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: SB/global_tokens (0.000376020003915) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5hVTeN4tSSbKb8IMxLeyycZ602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1tLifGj39bI0bcPyaJsYTbBu5YFz4Jx0uq4149LpZwrkOR4/HajlzkVhakIw7Ig6RAJ lmpPd1BHwQ+kdrsiFH2cfUiCXtJytJdYVIlBCNoVg5+MMxHz1qQag3kpom3W/e94I33w2HmOCspO DckV+F+3wL2Y4F0412ezGCyTUPan0uklXEw37uMwN0/87jeHA/DtEBjlrI3+ffLtqduEczQiwKLX T1N2MSH7GZ5RD1hGCbBzkh9OM/IQZX4UQ+0M5PcjPpm+mbxw9CcA3CQNDkFXB5UJrhTKjy92DTI6 8h3SnQmqYLjdEEIOK2vMtDcOIv6swqwgYQJviKY5/kNaTaa5Pkqio+WL8yLJH3B4G7qkcHsvFjae yZBKVj4s5LZEG/K9gXjVgrC1QcAgdzCQzBT9wRRkuvoiB4YsCfofouncNB4U2glErAJuIw/B9005 oAzEEJbreAQRsbSZZ9fXoUEifL76GD10kuo3nOZaoX+gsjENmEszkjZCjfYHwrdvNJlAR4VG1al3 V9+D6kte4sxnIKDFkcg0DoDn7tP2jpvLEQHXccWQ/x1965yjUk8rE9vpo2UgV9PP0GtOSQCD3Wp6 EipRzMVZ5LqwTx7Vvn9SWQRihqWRcCaa7yMGNcHiKmhXELglXPvXwY+m2hjhWXXhGUHq6zkhvAQI TbAoA+S9KBcYMRrvepe2Yk2okg9JmQeYUOp7A73HI6oJg7w/Vofg3oXo1l/v5aKY1zkbZm/DmoYV E/p9MbBpvhj6CNw5Cvqe0XEshFuK/GpNT7ar8xuaF/P4oRariZP4h22zsTekMDRcCgYQIezXimM8 MMGBqZ+MpTJWssqhJzGoox2dERAKwZizBzFaFVv8O8dWYXRzXuJbt+aROdok6ENb8QcOV4D/UhoV 7BDkUqX6OOzSXSCrBF+Rr7gD/PbbEd/imcyVNwpU15Un0FfK735x4KpOFCcHL8+lTGBIVE9xbEkX 79s8o4XELc8yJ4QkhrPnLpRW2GNGz3siphBNPRLkjfE26R1/rxbQicf/5tMwo2bfwweqYtYE+WQ7 6HhyFntm2v6MQik4xcszxqBpk9lxB93ijjZAaWYpI6FpE9hPAWtgQ1UxL7hrJSk60SF3F6RYOYr2 X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch makes the source code more uniform and does not change any functionality. Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen [ bvanassche: extracted this patch from a larger patch ] Signed-off-by: Bart Van Assche --- drivers/scsi/sd.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e2bd39670362..7a1cf6c80f6a 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1149,10 +1149,10 @@ static blk_status_t sd_setup_rw6_cmnd(struct scsi_cmnd *cmd, bool write, return BLK_STS_OK; } -static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) +static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd) { - struct request *rq = SCpnt->request; - struct scsi_device *sdp = SCpnt->device; + struct request *rq = cmd->request; + struct scsi_device *sdp = cmd->device; struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); sector_t lba = sectors_to_logical(sdp, blk_rq_pos(rq)); sector_t threshold; @@ -1163,24 +1163,24 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) unsigned char protect, fua; blk_status_t ret; - ret = scsi_init_io(SCpnt); + ret = scsi_init_io(cmd); if (ret != BLK_STS_OK) return ret; - WARN_ON_ONCE(SCpnt != rq->special); + WARN_ON_ONCE(cmd != rq->special); if (!scsi_device_online(sdp) || sdp->changed) { - scmd_printk(KERN_ERR, SCpnt, "device offline or changed\n"); + scmd_printk(KERN_ERR, cmd, "device offline or changed\n"); return BLK_STS_IOERR; } if (blk_rq_pos(rq) + blk_rq_sectors(rq) > get_capacity(rq->rq_disk)) { - scmd_printk(KERN_ERR, SCpnt, "access beyond end of device\n"); + scmd_printk(KERN_ERR, cmd, "access beyond end of device\n"); return BLK_STS_IOERR; } if ((blk_rq_pos(rq) & mask) || (blk_rq_sectors(rq) & mask)) { - scmd_printk(KERN_ERR, SCpnt, "request not aligned to the logical block size\n"); + scmd_printk(KERN_ERR, cmd, "request not aligned to the logical block size\n"); return BLK_STS_IOERR; } @@ -1201,29 +1201,29 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) } fua = rq->cmd_flags & REQ_FUA ? 0x8 : 0; - dix = scsi_prot_sg_count(SCpnt); - dif = scsi_host_dif_capable(SCpnt->device->host, sdkp->protection_type); + dix = scsi_prot_sg_count(cmd); + dif = scsi_host_dif_capable(cmd->device->host, sdkp->protection_type); if (write && dix) - t10_pi_prepare(SCpnt->request, sdkp->protection_type); + t10_pi_prepare(cmd->request, sdkp->protection_type); if (dif || dix) - protect = sd_setup_protect_cmnd(SCpnt, dix, dif); + protect = sd_setup_protect_cmnd(cmd, dix, dif); else protect = 0; if (protect && sdkp->protection_type == T10_PI_TYPE2_PROTECTION) { - ret = sd_setup_rw32_cmnd(SCpnt, write, lba, nr_blocks, + ret = sd_setup_rw32_cmnd(cmd, write, lba, nr_blocks, protect | fua); } else if (sdp->use_16_for_rw || (nr_blocks > 0xffff)) { - ret = sd_setup_rw16_cmnd(SCpnt, write, lba, nr_blocks, + ret = sd_setup_rw16_cmnd(cmd, write, lba, nr_blocks, protect | fua); } else if ((nr_blocks > 0xff) || (lba > 0x1fffff) || sdp->use_10_for_rw || protect) { - ret = sd_setup_rw10_cmnd(SCpnt, write, lba, nr_blocks, + ret = sd_setup_rw10_cmnd(cmd, write, lba, nr_blocks, protect | fua); } else { - ret = sd_setup_rw6_cmnd(SCpnt, write, lba, nr_blocks, + ret = sd_setup_rw6_cmnd(cmd, write, lba, nr_blocks, protect | fua); } @@ -1235,18 +1235,18 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) * host adapter, it's safe to assume that we can at least transfer * this many bytes between each connect / disconnect. */ - SCpnt->transfersize = sdp->sector_size; - SCpnt->underflow = nr_blocks << 9; - SCpnt->allowed = SD_MAX_RETRIES; - SCpnt->sdb.length = nr_blocks * sdp->sector_size; + cmd->transfersize = sdp->sector_size; + cmd->underflow = nr_blocks << 9; + cmd->allowed = SD_MAX_RETRIES; + cmd->sdb.length = nr_blocks * sdp->sector_size; SCSI_LOG_HLQUEUE(1, - scmd_printk(KERN_INFO, SCpnt, + scmd_printk(KERN_INFO, cmd, "%s: block=%llu, count=%d\n", __func__, (unsigned long long)blk_rq_pos(rq), blk_rq_sectors(rq))); SCSI_LOG_HLQUEUE(2, - scmd_printk(KERN_INFO, SCpnt, + scmd_printk(KERN_INFO, cmd, "%s %d/%u 512 byte blocks.\n", write ? "writing" : "reading", nr_blocks, blk_rq_sectors(rq)));