From patchwork Fri Jan 11 00:08:58 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: 10757065 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 20F0B17D2 for ; Fri, 11 Jan 2019 00:09:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D28329D45 for ; Fri, 11 Jan 2019 00:09:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0165E29D48; Fri, 11 Jan 2019 00:09:35 +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 7B7DC29D46 for ; Fri, 11 Jan 2019 00:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730735AbfAKAJf (ORCPT ); Thu, 10 Jan 2019 19:09:35 -0500 Received: from out002.mailprotect.be ([83.217.72.86]:41467 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730612AbfAKAJe (ORCPT ); Thu, 10 Jan 2019 19:09:34 -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=jLPJkF/Mx+BqNtZW0hUcK5P2eMW0JojCdcCM1rGCybo=; b=QZt+jGIR5Txx K49F3/nrrJjOSLUVDOJXjaRT+/N/oY0eHYHORIQIwfWfOTmLh8FkjW0jsVEJ3Rv8SvzoZMOh67MRX +r8S3uQ0ft9kAZhKUiNu//q7xRRnidN1uCAivfWNCUFhm5jtzvQV+uw9tTcMnZ5K7G7EjbqDWQQ8B lehw6X4EP46kzODutOfwpUX9d6CFaUoYCwzwsMWt8f5ZoU9u5YlmX7hcKznZYkqR8uYYt81FRZuCS 2lkX6zMLlX1QsK7/0S2KjF9CdlxYR1ifDhOhYzxUyaLSr9X2MFBI7C3UFhWzQ9phIIVlRkj4Loznc 5qkBbeXFjbnSviAfxaOwMQ==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1ghkO9-000De3-E5; Fri, 11 Jan 2019 01:09:30 +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 6ECE5C07A1; Fri, 11 Jan 2019 01:09:25 +0100 (CET) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche Subject: [PATCH 8/8] sd: Rename 'SCpnt' into 'cmd' Date: Thu, 10 Jan 2019 16:08:58 -0800 Message-Id: <20190111000858.76261-9-bvanassche@acm.org> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog In-Reply-To: <20190111000858.76261-1-bvanassche@acm.org> References: <20190111000858.76261-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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CnoMzps1w8ZlyWpuWa9TLRBg21otcGPr1 zYyDRfp0WSy7R6kupj1q3Dt9ZyCgxZHINA6A5+7T9o6by6TTlSa2Lh/bXHbr9KsH2f7CCey7HUjs wwJCoJUeO2iBpksPaDU3ZH1Nh3tobKAf6zEvuGslKTrRIXcXpFg5ivY= 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. Signed-off-by: Martin K. Petersen [ bvanassche: extracted this patch from a larger patch ] Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- 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 4e293e4c6823..4e69f182a1e5 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1150,10 +1150,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; @@ -1164,24 +1164,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; } @@ -1202,29 +1202,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); } @@ -1236,18 +1236,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)));