From patchwork Wed Jan 11 00:48:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: subhashj@codeaurora.org X-Patchwork-Id: 9508967 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 914F86075F for ; Wed, 11 Jan 2017 00:48:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8178C283F1 for ; Wed, 11 Jan 2017 00:48:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73A68284BC; Wed, 11 Jan 2017 00:48: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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 E500A283F1 for ; Wed, 11 Jan 2017 00:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756894AbdAKAsk (ORCPT ); Tue, 10 Jan 2017 19:48:40 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:50922 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756874AbdAKAsh (ORCPT ); Tue, 10 Jan 2017 19:48:37 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 77DB161405; Wed, 11 Jan 2017 00:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1484095716; bh=R7katmym+RuCxKOAealuvFdrnKqm9+J7QfTFVDtpZ2Y=; h=From:To:Cc:Subject:Date:From; b=Z9KjEjYaCbwjUxOu1Q2tuYjl/9diiMJTqtkmXFwIg7b53zwP/datWeZLGivBmxTTD cwPKM0SJkK5IF+aZUG5yQt4AamD5wezIUNSu7uWEGMeHjtkxJgjmYd6WPvz2u8qct/ wqkCI+eh84h0XDnSc+M9PRsXbpCwu+dT++dYbBn0= Received: from pacamara-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: subhashj@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9774861405; Wed, 11 Jan 2017 00:48:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1484095713; bh=R7katmym+RuCxKOAealuvFdrnKqm9+J7QfTFVDtpZ2Y=; h=From:To:Cc:Subject:Date:From; b=n5VmS8SrD2dqfwubo7phbxP5JVZ/SUL54Hu9fP0ki+Z7UWSQPNUripCWXYk22mqIP 6o/aFr5z6Qcr5J615kJED1++DE/76TkO922cjxGDrb/M2TDw5LJJKBfBijYZJDbPmJ 35qqUhak8nD3mmLBfnbqN7DOG9InRx3vwQuI3MRI= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 9774861405 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=subhashj@codeaurora.org From: Subhash Jadavani To: vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, colin.king@canonical.com, Subhash Jadavani , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1] scsi: ufs: fix arguments order some trace calls Date: Tue, 10 Jan 2017 16:48:25 -0800 Message-Id: <1484095705-3962-1-git-send-email-subhashj@codeaurora.org> X-Mailer: git-send-email 1.9.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 Colin Ian King reported that with commit 7ff5ab473633 ("scsi: ufs: add tracing support") static analysis is reporting that we may have swapped arguments on calls to: trace_ufshcd_runtime_resume, trace_ufshcd_runtime_suspend, trace_ufshcd_system_suspend, trace_ufshcd_system_resume, and trace_ufshcd_init Where: hba->uic_link_state is passed to dev_state hba->curr_dev_pwr_mode is passed to link_state This wasn't intentional so it's a bug. This change fixed this bug. Reported-by: Colin Ian King Signed-off-by: Subhash Jadavani Acked-by: Colin Ian King --- drivers/scsi/ufs/ufshcd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index be6322e..6b56eb0 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5805,7 +5805,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) trace_ufshcd_init(dev_name(hba->dev), ret, ktime_to_us(ktime_sub(ktime_get(), start)), - hba->uic_link_state, hba->curr_dev_pwr_mode); + hba->curr_dev_pwr_mode, hba->uic_link_state); return ret; } @@ -6819,7 +6819,7 @@ int ufshcd_system_suspend(struct ufs_hba *hba) out: trace_ufshcd_system_suspend(dev_name(hba->dev), ret, ktime_to_us(ktime_sub(ktime_get(), start)), - hba->uic_link_state, hba->curr_dev_pwr_mode); + hba->curr_dev_pwr_mode, hba->uic_link_state); if (!ret) hba->is_sys_suspended = true; return ret; @@ -6852,7 +6852,7 @@ int ufshcd_system_resume(struct ufs_hba *hba) out: trace_ufshcd_system_resume(dev_name(hba->dev), ret, ktime_to_us(ktime_sub(ktime_get(), start)), - hba->uic_link_state, hba->curr_dev_pwr_mode); + hba->curr_dev_pwr_mode, hba->uic_link_state); return ret; } EXPORT_SYMBOL(ufshcd_system_resume); @@ -6880,7 +6880,7 @@ int ufshcd_runtime_suspend(struct ufs_hba *hba) out: trace_ufshcd_runtime_suspend(dev_name(hba->dev), ret, ktime_to_us(ktime_sub(ktime_get(), start)), - hba->uic_link_state, hba->curr_dev_pwr_mode); + hba->curr_dev_pwr_mode, hba->uic_link_state); return ret; } EXPORT_SYMBOL(ufshcd_runtime_suspend); @@ -6921,7 +6921,7 @@ int ufshcd_runtime_resume(struct ufs_hba *hba) out: trace_ufshcd_runtime_resume(dev_name(hba->dev), ret, ktime_to_us(ktime_sub(ktime_get(), start)), - hba->uic_link_state, hba->curr_dev_pwr_mode); + hba->curr_dev_pwr_mode, hba->uic_link_state); return ret; } EXPORT_SYMBOL(ufshcd_runtime_resume);