Message ID | 20221201230810.1019834-2-ahalaney@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp536686wrr; Thu, 1 Dec 2022 15:17:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf52vo92a3WyqAsHLTybpgXpSXhEpTlcivpK/dAmjhfZfYWZBIvdOG2p0sk6yPhzTWwJNcMa X-Received: by 2002:a17:907:d092:b0:7ad:7e85:8056 with SMTP id vc18-20020a170907d09200b007ad7e858056mr57247735ejc.40.1669936655489; Thu, 01 Dec 2022 15:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669936655; cv=none; d=google.com; s=arc-20160816; b=J3qi+RSOm0Lug3KQsQrD7b3GR1jHH8yzb1bwGBE5CMT4s+aYPeeeiiQzNFGUPszJ1A p3OiDKw/YZX9WyzDhfol+PNI+g7GgbwwCnl+qR74s6Yuke3NvJ3fhju7yqhBUl/js/MO CWIV5alfKkm4bGEQjrjEfSWMUfRYZl/lKuIaDaxFlcivps26NuTqO7vzYG7dsISYK0+J pzAPaLIIdJ0zHOTiXNtYwOF8n+9WegLKFGjfPrKBbguarPDgEY1kUXUcCKfrGYHagYsE U3hZVyrcJCxXDFPngJmoHJVfKIfawfiz4iuXTOgSbq9FJ1K9Hvghq/+OcS1GtZ0H2K9T cYwQ== 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=WPrzspswmnM04Pzvw/sX2KvWfaVbj7fPyU5av4wS70Y=; b=eqOA17D0L6DD97S7/Zcomhbw0vFi37zy8JMMfwx6G+CXH2UrRwtyPPQd5JdIVPbXxg 4sVBvxT0vmfap+tT8wdyuRIkeT6hNod2/cGn9XPJIvEQAN/jqcuMyB2AILF2jJJZP5AJ uDxot7c7tKpbQLo0EQ89KI7OBqFC2d8Q8QQpmTh/SudwbU20b9qdNIfW1nhshZ2bf3b/ yDYnWT2nu5t6UogQBPeMKWIddwCTMfzt34Pn4PHFFjy4NIH8C7ZvyDOz4BUNbJc9sxaB +WHoYzZqwvMg8Ysgiki2zs/fQ88IRrl1X9nwENRsNORRuZMb/rV0rw5cNRNm8A1W5zbs 3Zfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XMEsDOCZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw7-20020a170906478700b00781599eb7dbsi5306252ejc.573.2022.12.01.15.17.12; Thu, 01 Dec 2022 15:17:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XMEsDOCZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbiLAXJl (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Thu, 1 Dec 2022 18:09:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbiLAXJh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 1 Dec 2022 18:09:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33FCEBDCD7 for <linux-kernel@vger.kernel.org>; Thu, 1 Dec 2022 15:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669936126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WPrzspswmnM04Pzvw/sX2KvWfaVbj7fPyU5av4wS70Y=; b=XMEsDOCZIQA4RKU2NMAAH054LBClzG5ATdwZsvmve2PeLODw15gX8/DMpv6pEu9Rg2wwR/ oPPdA4CTTuTP83Qx8v7ezziYakiQNKiUOaYsVnVRX0/zpzMRrrZKv80m9GLtgRcJsM8NpH M6SMF6FThyX58Bxmmedb+alVv4TjWSE= Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-303-QkiUJZ20O668WnMewDC_Aw-1; Thu, 01 Dec 2022 18:08:45 -0500 X-MC-Unique: QkiUJZ20O668WnMewDC_Aw-1 Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-13bf576ffa6so1494811fac.9 for <linux-kernel@vger.kernel.org>; Thu, 01 Dec 2022 15:08:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WPrzspswmnM04Pzvw/sX2KvWfaVbj7fPyU5av4wS70Y=; b=YPJodtHJaX1e9pSdBxrZFP6ZcAuzy97dUCYHYIgMCaa1SZKmJNWa3g9+jP5jjtEaOo XgihW4gNr9Enw151xmQyQ90y2pg2yqtkVDIs+j1naDIRIi3V/kepZtSbP+eGSQtAkLGG LGEhCHir++74RHBe51M73J9z6nvVk03nw58GIjgVRAOOtXvu53kyG3Oxa3oMb6HF4Kdf Ai9d/gkazH8zbwEv2ylh6f7uIAKlrVOxp3sWZ0YEE+C706+FOXKAN8kA6mL5ja//K8VS YHkkv20nrKTLyNEuT3bnDLpnwik6eYsvAQ0SD+AayVaIzyFbNKJyO8kU5yF8ciOR+Yba PYfQ== X-Gm-Message-State: ANoB5pnGsFoq0A5IHIDVgHNbJkN911HbZg7zxOpE4UZHScFKrEjvk8ZO jnmwEFSMihU/AqMti6hj0pJMTYIohsTkY7s7Qd/4dbP1VkOiz/KFD5ky23ex9ySJ3cSds037frt uc5gUqvzM5O5H6j7xIfHvHHdv X-Received: by 2002:a4a:960d:0:b0:49f:e673:83e with SMTP id q13-20020a4a960d000000b0049fe673083emr23060992ooi.11.1669936124505; Thu, 01 Dec 2022 15:08:44 -0800 (PST) X-Received: by 2002:a4a:960d:0:b0:49f:e673:83e with SMTP id q13-20020a4a960d000000b0049fe673083emr23060981ooi.11.1669936124291; Thu, 01 Dec 2022 15:08:44 -0800 (PST) Received: from halaney-x13s.redhat.com ([2600:1700:1ff0:d0e0::41]) by smtp.gmail.com with ESMTPSA id y22-20020a4ade16000000b0049fb2a96de4sm2320393oot.0.2022.12.01.15.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 15:08:43 -0800 (PST) From: Andrew Halaney <ahalaney@redhat.com> To: andersson@kernel.org Cc: agross@kernel.org, konrad.dybcio@linaro.org, jejb@linux.ibm.com, martin.petersen@oracle.com, p.zabel@pengutronix.de, linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, manivannan.sadhasivam@linaro.org, Andrew Halaney <ahalaney@redhat.com> Subject: [PATCH 1/4] scsi: ufs: ufs-qcom: Drop unnecessary NULL checks Date: Thu, 1 Dec 2022 17:08:07 -0600 Message-Id: <20221201230810.1019834-2-ahalaney@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221201230810.1019834-1-ahalaney@redhat.com> References: <20221201230810.1019834-1-ahalaney@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751055498656901710?= X-GMAIL-MSGID: =?utf-8?q?1751055498656901710?= |
Series |
scsi: ufs: ufs-qcom: Debug clean ups
|
|
Commit Message
Andrew Halaney
Dec. 1, 2022, 11:08 p.m. UTC
This code path is only called through one function, and the hba
struct is already accessed in ufshcd_vops_dbg_register_dump() prior to
calling so there is no way for it to be NULL.
Likewise, the print_fn callback is always supplied within this driver
and is always provided.
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
drivers/ufs/host/ufs-qcom.c | 9 ---------
1 file changed, 9 deletions(-)
Comments
On Thu, Dec 01, 2022 at 05:08:07PM -0600, Andrew Halaney wrote: > This code path is only called through one function, and the hba > struct is already accessed in ufshcd_vops_dbg_register_dump() prior to > calling so there is no way for it to be NULL. > > Likewise, the print_fn callback is always supplied within this driver > and is always provided. > > Signed-off-by: Andrew Halaney <ahalaney@redhat.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Thanks, Mani > --- > drivers/ufs/host/ufs-qcom.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 8ad1415e10b6..70e25f9f8ca8 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -1202,15 +1202,6 @@ static void ufs_qcom_print_hw_debug_reg_all(struct ufs_hba *hba, > u32 reg; > struct ufs_qcom_host *host; > > - if (unlikely(!hba)) { > - pr_err("%s: hba is NULL\n", __func__); > - return; > - } > - if (unlikely(!print_fn)) { > - dev_err(hba->dev, "%s: print_fn is NULL\n", __func__); > - return; > - } > - > host = ufshcd_get_variant(hba); > if (!(host->dbg_print_en & UFS_QCOM_DBG_PRINT_REGS_EN)) > return; > -- > 2.38.1 >
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 8ad1415e10b6..70e25f9f8ca8 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -1202,15 +1202,6 @@ static void ufs_qcom_print_hw_debug_reg_all(struct ufs_hba *hba, u32 reg; struct ufs_qcom_host *host; - if (unlikely(!hba)) { - pr_err("%s: hba is NULL\n", __func__); - return; - } - if (unlikely(!print_fn)) { - dev_err(hba->dev, "%s: print_fn is NULL\n", __func__); - return; - } - host = ufshcd_get_variant(hba); if (!(host->dbg_print_en & UFS_QCOM_DBG_PRINT_REGS_EN)) return;