Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp881949pxk; Thu, 17 Sep 2020 20:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7mZOcx9pMkjx7QcBNWPJhLPWUiZ5XXsLTZCQWnzP3UW2nxh0gkH3eXnRFpboMM7B3J8k4 X-Received: by 2002:a17:906:cf85:: with SMTP id um5mr17745188ejb.479.1600398833156; Thu, 17 Sep 2020 20:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398833; cv=none; d=google.com; s=arc-20160816; b=H5Z5o/+Wgiq4g1u+EAQE7F7eo61HASJCk/bDNmFpTBVuVLtwH927iIko7AvaTtaZmD +yaUSDzipU6DEAPZPhgxK89II4SCi1rQIRbvDFoL6hI2b6c16MbH9y5jVr9lL2UHqz1H 83qGDiotuMAC4/PrRfucxPnli94dCd6OtXbx6pV07Ng2FPxZt3qjRNgIK2kHmOLu9ot5 V/NJJuiScmuu29Qix1nIN0Tf/XGythHPrTnxw4svdUdxkjtXqdM0BLWXI1st340GeME4 F29qMAcuRHX3O00OnS8OfrChOR0w7QwOHRHjIjahIndXr2zHo3CXK5TVsJTjZMrNuqAd lpZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oomqXFrn/7tKYuxle5SiYk/IZwifKBNmr+JhLx2Egpw=; b=ksMrLJJVNOHe40hlKjCFB5h2Oudvim5MjGUF1FARbLwiC3AYFmXGGwH6d7g69hst8j QwsgRJd09oOxuLiUjD53b4KdETiYZcJMPZ6L4HxUi82ukmPYcKDc4E1I2B0YPgkVnWnB NqYBoKIEnBRabmwzIeSrATkojuQKF6zfZll6C9NeeDezowQWpYWlYWnxiP5ZshfPvV4s k//bd4or8axAjM0nZlN2YSgV+zkUnF4TU16Lxs6psaJsWYucWmM6+Hpi8VXMv89OVtZ7 eIyKSTD2wc1HeLYa7uts6lKty8j0c2xPcAsF3Y4bndLrPNQketwN5gevyUhKzHGevuql DmIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EiaBtlQ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si1226010ejb.50.2020.09.17.20.13.29; Thu, 17 Sep 2020 20:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EiaBtlQ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729283AbgIRDJd (ORCPT + 99 others); Thu, 17 Sep 2020 23:09:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:48866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726939AbgIRCDC (ORCPT ); Thu, 17 Sep 2020 22:03:02 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A8DDB208DB; Fri, 18 Sep 2020 02:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394582; bh=Ittz/wxGC9/mPG2IeyB9vgmU2CwAvg/OtpsciejW1Ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EiaBtlQ4mB26wh7aUWvfWbdXEzA5p9n/YC0YP2J8cLEYaTK0TcLcPOo59dmGZCS/D xTYdQapgFXyQfQHqFBtTDj1oyKXio0l7t8o5mtCGNPXK/K/bGhFGMhB+I2QjgeAcI5 vfSAXsHcdna8fPoS55sCeTtURzLGuSmi/tMVEXE4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bart Van Assche , Bean Huo , Can Guo , Avri Altman , Stanley Chu , Tomas Winkler , Alim Akhtar , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.4 092/330] scsi: ufs: Make ufshcd_add_command_trace() easier to read Date: Thu, 17 Sep 2020 21:57:12 -0400 Message-Id: <20200918020110.2063155-92-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bart Van Assche [ Upstream commit e4d2add7fd5bc64ee3e388eabe6b9e081cb42e11 ] Since the lrbp->cmd expression occurs multiple times, introduce a new local variable to hold that pointer. This patch does not change any functionality. Cc: Bean Huo Cc: Can Guo Cc: Avri Altman Cc: Stanley Chu Cc: Tomas Winkler Link: https://lore.kernel.org/r/20191224220248.30138-3-bvanassche@acm.org Reviewed-by: Stanley Chu Reviewed-by: Can Guo Reviewed-by: Alim Akhtar Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ufs/ufshcd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 5e502e1605549..020a93a40a982 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -334,27 +334,27 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, u8 opcode = 0; u32 intr, doorbell; struct ufshcd_lrb *lrbp = &hba->lrb[tag]; + struct scsi_cmnd *cmd = lrbp->cmd; int transfer_len = -1; if (!trace_ufshcd_command_enabled()) { /* trace UPIU W/O tracing command */ - if (lrbp->cmd) + if (cmd) ufshcd_add_cmd_upiu_trace(hba, tag, str); return; } - if (lrbp->cmd) { /* data phase exists */ + if (cmd) { /* data phase exists */ /* trace UPIU also */ ufshcd_add_cmd_upiu_trace(hba, tag, str); - opcode = (u8)(*lrbp->cmd->cmnd); + opcode = cmd->cmnd[0]; if ((opcode == READ_10) || (opcode == WRITE_10)) { /* * Currently we only fully trace read(10) and write(10) * commands */ - if (lrbp->cmd->request && lrbp->cmd->request->bio) - lba = - lrbp->cmd->request->bio->bi_iter.bi_sector; + if (cmd->request && cmd->request->bio) + lba = cmd->request->bio->bi_iter.bi_sector; transfer_len = be32_to_cpu( lrbp->ucd_req_ptr->sc.exp_data_transfer_len); } -- 2.25.1