From patchwork Thu Jun 28 15:31:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10494335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A36E60230 for ; Thu, 28 Jun 2018 15:31:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8454E27F97 for ; Thu, 28 Jun 2018 15:31:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7878328DB6; Thu, 28 Jun 2018 15:31:58 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 18B5C27F97 for ; Thu, 28 Jun 2018 15:31:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753566AbeF1Pb5 (ORCPT ); Thu, 28 Jun 2018 11:31:57 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:26243 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753465AbeF1Pb4 (ORCPT ); Thu, 28 Jun 2018 11:31:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1530199916; x=1561735916; h=from:to:cc:subject:date:message-id; bh=QrJj0cLn4o7heph62I1pFUBywznm6HZB3G2UvWjHMQw=; b=V2Rs5STLHpLvqlz41daFbu5qQFf6LdRlni6r2fIW28+2ASiZ3c3OgcaY +Nw1g94hsEwSNVuZa8jXQQpJceSDho1lCrGTp4+BBaf8P0loVJ+fBzOPj VwRP4yRdgGFjKGoHOdrY4/AU9QLlL8dl+ZjYcFpyXsXNcLmyjmBBVMnVP uAEyohzKod5fpQIv7As+uTRwhXr1dtJ/sf/HnMBG+SXq4Y1EtAcY7NM// Akkejnx7b1JfEweRy7P7B7Fkcc+KDwl1Wzwu5jbzz3vdfzqiubiW26xsW vBPvvcXfjLDk1jiWu+stoIcUhUgGROL2TMc1ffOToIxzq67GnPC72r0gg w==; X-IronPort-AV: E=Sophos;i="5.51,284,1526313600"; d="scan'208";a="185762850" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jun 2018 23:31:30 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 28 Jun 2018 08:20:59 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 28 Jun 2018 08:31:29 -0700 From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH] sd_zbc: Remove an assignment from sd_zbc_setup_report_cmnd() Date: Thu, 28 Jun 2018 08:31:28 -0700 Message-Id: <20180628153128.8045-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 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 Since nr_bytes == blk_rq_bytes(rq) == rq->__data_len, the rq->__data_len = nr_bytes assignment does not modify the value of rq->__data_len. Hence remove that assignment. Note: the code in sd_done() that sets the residual to zero for zone report requests is not affected by this patch. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Hannes Reinecke Cc: Johannes Thumshirn Reviewed-by: Johannes Thumshirn --- drivers/scsi/sd_zbc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index a14fef11776e..160b79619d30 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -148,12 +148,6 @@ int sd_zbc_setup_report_cmnd(struct scsi_cmnd *cmd) cmd->transfersize = sdkp->device->sector_size; cmd->allowed = 0; - /* - * Report may return less bytes than requested. Make sure - * to report completion on the entire initial request. - */ - rq->__data_len = nr_bytes; - return BLKPREP_OK; }