Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1826046pxy; Mon, 2 Aug 2021 11:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt+bWaF9Pme7WOxTnnLXGvO7NC4VEfjKTnev7EaSJLSv/Z0SPWuQhWEo4573mOGjqp9kMQ X-Received: by 2002:a6b:b795:: with SMTP id h143mr216834iof.74.1627927790254; Mon, 02 Aug 2021 11:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627927790; cv=none; d=google.com; s=arc-20160816; b=eJAmdb9OhueB0dgT7v1Mnm8RBNweFnk24uE8GkILFMPGFVE2oG558P1S0fJ4e5OujH GOnW0Xc55jgaCftmMZ9P7GiTIOMqiDBEYw7zd1TFM0QH5DXrR1nkVfsqZ8sukhACF4S7 yvWoa4yV6qDZbo6+hrcosa7Puf9aOn8FgSUZ+S4gYaiImGhHcil6Si8x7oZEmUe7oFZh hs4Y7Nd4gZxbqLDtbQXvpJnivaSePX1FSHEuYKwAgpcvVWJ4+kGFWXWOUVJEPvXIn/W/ RKPMPJKTHNZpDeJ1p2h8ijclReyCJM7B37oIqgpuQ9GvLKlxlz/aKNyi/z1NNoz+9J6J xPbw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=D2tEo2auWlRQbPn2RDM9SgFOD2D6wuYg38MJpC/JqLs=; b=zh5HtTLL4kO4G4wMDuLl8ZXFi9Ph7/+yybz0KvebEDXfxOfKklcGDt9Y+X+gQoV4p1 B3iZdFwdatMeNcM4bhiUh5iMVq57NaRLUGTnNihmZzjIs8EKsTiGYP2bAzhBx9LvF1qk yM+xfRCTIN7Z2vhdUOhtfTnTifmrGqLpOtHT465RVLPY4XH1qFydYnouX7pXrzNnLuRc Ez4S6PmO5xUPZpB3dfyp0R1KeVUOw1YIrYwiuYlmoQt5DDDaKu5MejdBNPIuAKCLltbi KCy9dvFctnIqBPpHKONbKLy63567DnMVOh4jHTv9LZ5SvYyzS8bq2djlZ5Ob4FXk7Hhm EsTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LIklMAl1; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si11580776ila.73.2021.08.02.11.09.36; Mon, 02 Aug 2021 11:09:50 -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=@gmail.com header.s=20161025 header.b=LIklMAl1; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbhHBSIZ (ORCPT + 99 others); Mon, 2 Aug 2021 14:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbhHBSIY (ORCPT ); Mon, 2 Aug 2021 14:08:24 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8244BC06175F; Mon, 2 Aug 2021 11:08:13 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id l18so22457435wrv.5; Mon, 02 Aug 2021 11:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D2tEo2auWlRQbPn2RDM9SgFOD2D6wuYg38MJpC/JqLs=; b=LIklMAl1SAtQKrTzKfjH7PBZsN64Txr+rI1UYmP44La1EG4ajOs9wGod3ZxB3masJZ R5eWktMc2OYxAnR227Rh5w7/ywudpY9t87l5REuU136qE2ogCZhEiYEIY/2dAKc7oQ+p FbS6aj9KhW34wPe8CfwvVd5gDAZr7adGYStQ20QjxQ/fpW7VJkYWhW1n1tWZ9E0a60Do r9V2hWzcwBLkjEPjnwWNh/dYdbz2vIPi7e6C2y8x8F1jDaJMKV9Y2i8Fhm3QHfuVMOOh jha/P4Z0JOC3E6hA+Eea54FFP3AWjDUwl7KyDdYK7pItXD9XnhyDdT6TgInEDZXNolfW p4PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D2tEo2auWlRQbPn2RDM9SgFOD2D6wuYg38MJpC/JqLs=; b=loHNDzK0aMswltzuWZI6i9xkBMvzLBV64ymngk3Z6AW3SMq0x3TMco8RkJLpPn2OIh qaRmzwqs8KHThLFfuo6iyRedBWGYKwh1xxrGBqJ0NSA41HHgOO5ra36B2xaRp4XF1Vq7 Qk1PduXbMW/bhiYW/4NZ5ohq3H2kMwbK5I3TKpfVe3XPG1r31TBhK/D4zbuuq4N1Gjuv oeceydynSl3boyLnHdssTAvN2lFS2El3VaplEKlzsJZWwNme64kHKJzRd2ebWO2XztIC YYfGC0kxOQcxexJpgCvXeWf8BTv5nRDvk/iIz4Ypq88JzoxDGWFv0aR02ZQ0XZClOF67 alNQ== X-Gm-Message-State: AOAM532FvMsRXqbRBHCG8kbtzHckHVXiLHnoxpj4ciu+jK+D79KOXMqH GSzaOcKB3ynQ1TflWQ07LLQ= X-Received: by 2002:adf:82ae:: with SMTP id 43mr18840903wrc.73.1627927692206; Mon, 02 Aug 2021 11:08:12 -0700 (PDT) Received: from localhost.localdomain (ip5f5bfdd7.dynamic.kabel-deutschland.de. [95.91.253.215]) by smtp.gmail.com with ESMTPSA id w4sm54086wrm.24.2021.08.02.11.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 11:08:12 -0700 (PDT) From: Bean Huo To: alim.akhtar@samsung.com, avri.altman@wdc.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: ufs: Remove useless if-state in ufshcd_add_command_trace Date: Mon, 2 Aug 2021 20:08:03 +0200 Message-Id: <20210802180803.100033-1-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo ufshcd_add_cmd_upiu_trace() will be called anyway, so move if-state down, make code simpler. Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 064a44e628d6..02f54153fd6d 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -380,14 +380,11 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, if (!cmd) return; - if (!trace_ufshcd_command_enabled()) { - /* trace UPIU W/O tracing command */ - ufshcd_add_cmd_upiu_trace(hba, tag, str_t); - return; - } - /* trace UPIU also */ ufshcd_add_cmd_upiu_trace(hba, tag, str_t); + if (!trace_ufshcd_command_enabled()) + return; + opcode = cmd->cmnd[0]; lba = scsi_get_lba(cmd); -- 2.25.1