From patchwork Thu Dec 1 23:08:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 28587 Return-Path: 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 + 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 ); 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 ; 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 ; 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 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 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 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: 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?= 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 Reviewed-by: Manivannan Sadhasivam --- 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; From patchwork Thu Dec 1 23:08:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 28588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp537566wrr; Thu, 1 Dec 2022 15:19:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7qSmhSDpq3vui9VlbUr1Rgd/7WWf7e4/batvNxYXdiJ+QJnXBnWZT20FjL6nyN+Fy+sf+a X-Received: by 2002:a62:1e07:0:b0:575:59f0:99a7 with SMTP id e7-20020a621e07000000b0057559f099a7mr18652464pfe.51.1669936795062; Thu, 01 Dec 2022 15:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669936795; cv=none; d=google.com; s=arc-20160816; b=hv9aU0wFDp9t83mptFH4TZ1snNGfs1ISnqn+vuqSswSGatTaojq4e/nZzjIb9msKIE 50/jZdfqTZ2NOgi/ySBarPV1i0On8fmGkNxBYm5auMaVcLbFf/qOPAoqzgPnE1ALrmFt ZkYrsYxxpH0b4gOgl4bgShdYUnYrkzJ1+nelk6WvjTFqErjC/FydQgYjd3OKiytXqvvS nlmHrJGz2hMW9Qh2uafvOpLLn7J7AKinfMuUDQAotvuDR62MzGpiIkGyFT4AOTthV1uk mNdgT5W6lR5wVr1fqlGacXfuYuSQq7v3UUM+qQ3abUNvXo/1K0xYZzeGavhsZhUgGkUh 9Q5A== 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=pWddiBlQqBNhSTyOdkG+l/0Pm1/3GQWtxNtEP2I5kzo=; b=GWqahsPJDSZAimoe+bok3Z3DT1qq7orf9o8S3T6EdR4hAPqBhrqBiTl+Ue0aoZ6Gue pYPy5gv18EfpiLi1BHCBDFZuuF1bytSMXCljHYrFpBbjNJ9wJyXR/DYrLD5+Bd6MAoGk oQeOP5r9nuORDqB8nnTqcvhseOubsjOr22SrDfFbzja1JOWMskkL35iGnvL5LhEGiZ2w +K6ssSlFuLivtIa9PjRjhXKA1alLGVRq+4mdmCh1JDW5P0//r6JYBCLrJOEKqP/uIJtN jqh7BEMyVWpXnRYVxvAQ2FDFI4uCFv9Y8YP91wuDg/TDkzlHkf/XsoKKIpu/EWJ9wPoR 6V4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WovC6FPs; 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 i11-20020a1709026acb00b00189ad19dd26si4552010plt.326.2022.12.01.15.19.41; Thu, 01 Dec 2022 15:19:55 -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=WovC6FPs; 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 S231490AbiLAXKl (ORCPT + 99 others); Thu, 1 Dec 2022 18:10:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231544AbiLAXKY (ORCPT ); Thu, 1 Dec 2022 18:10:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59638BDCEB for ; Thu, 1 Dec 2022 15:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669936131; 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=pWddiBlQqBNhSTyOdkG+l/0Pm1/3GQWtxNtEP2I5kzo=; b=WovC6FPsh+57rsf9Mch+jfTAdPE+DmRFPs6667+KVaiRdORr1jYXe+uCp40HcBMdQrEVmc b2woZpVo5Cd/0ZpJrxK3tndGhWoXytIK7SJZoiHBFlbPG28E7Iaet0xkDrNjOJnUMfp/E9 MW9RYUFqRYNZmK6sv1Ol+sdTRAWZJX8= Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-654-2ZsGQQIfNUqtR5Z3OwQNdw-1; Thu, 01 Dec 2022 18:08:50 -0500 X-MC-Unique: 2ZsGQQIfNUqtR5Z3OwQNdw-1 Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-1438729f685so1497016fac.19 for ; Thu, 01 Dec 2022 15:08:50 -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=pWddiBlQqBNhSTyOdkG+l/0Pm1/3GQWtxNtEP2I5kzo=; b=0NPOzQZb1frJtehiD5PviAqXUoxDb80NHFsgqmTRHC9hlTI4hvwqp0s7CuQmQzqjVX 9GFv0toO2DkF2T+a8LDitG3uB2pylP3FxPBi0mqNEWCugFW1AQUWm5+QDhv+NMdqIvEV hTy1A6ffY2VWYLAe0XKmh9BR94yX7zh424E2IXmkOs6WaV34FfoOwcMEcTyFtEm2Dz3t aaCUu20xDZKX4GU0tAulhZ/omVYi0OEdkMwgQuQTjHalgCntFpmxSp4/fvgJNcVsmllu Gv5rWeyHf9TCnfV75YJxNjdCNXp1K+Ywa2KyFgbygACC0HDv0Jd9s1niNl3FbdI8lp3Y HFSg== X-Gm-Message-State: ANoB5plX1Mwr9ZKS9C6OONqcB3/elNJSDBtWADnkWUkxON3h1FRl1PH9 tQGGfK9plKKqwMeA5fOFIwfKEiyxRdt6WhnbO0/sm21x8pVva6Cn9ZUO8txQ7oiTOabnnyO9bU8 oL67H4MZV2eHcuaXYUa/nTZpx X-Received: by 2002:a05:6808:1392:b0:359:a4de:1d3a with SMTP id c18-20020a056808139200b00359a4de1d3amr35015719oiw.138.1669936129811; Thu, 01 Dec 2022 15:08:49 -0800 (PST) X-Received: by 2002:a05:6808:1392:b0:359:a4de:1d3a with SMTP id c18-20020a056808139200b00359a4de1d3amr35015708oiw.138.1669936129594; Thu, 01 Dec 2022 15:08:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 15:08:49 -0800 (PST) From: Andrew Halaney 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 Subject: [PATCH 2/4] scsi: ufs: ufs-qcom: Clean up dbg_register_dump Date: Thu, 1 Dec 2022 17:08:08 -0600 Message-Id: <20221201230810.1019834-3-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 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=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751055644515909089?= X-GMAIL-MSGID: =?utf-8?q?1751055644515909089?= The current implementation has abstractions that don't give any benefits. The print_fn callback (and its only callback implementation, ufs_qcom_dump_regs_wrapper()) was only used by ufs_qcom_print_hw_debug_reg_all() and just multiplies len by 4 before calling ufshcd_dump_regs(). ufs_qcom_print_hw_debug_reg_all() is only called by ufs_qcom_dump_dbg_regs(). There's no real gain in those abstractions, so let's just do the work directly in ufs_qcom_dump_dbg_regs() (the dbg_register_dump callback). Signed-off-by: Andrew Halaney Reviewed-by: Manivannan Sadhasivam --- drivers/ufs/host/ufs-qcom.c | 106 ++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 59 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 70e25f9f8ca8..1b0dfbbdcdf3 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -52,12 +52,6 @@ static struct ufs_qcom_host *rcdev_to_ufs_host(struct reset_controller_dev *rcd) return container_of(rcd, struct ufs_qcom_host, rcdev); } -static void ufs_qcom_dump_regs_wrapper(struct ufs_hba *hba, int offset, int len, - const char *prefix, void *priv) -{ - ufshcd_dump_regs(hba, offset, len * 4, prefix); -} - static int ufs_qcom_host_clk_get(struct device *dev, const char *name, struct clk **clk_out, bool optional) { @@ -1195,58 +1189,6 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, return err; } -static void ufs_qcom_print_hw_debug_reg_all(struct ufs_hba *hba, - void *priv, void (*print_fn)(struct ufs_hba *hba, - int offset, int num_regs, const char *str, void *priv)) -{ - u32 reg; - struct ufs_qcom_host *host; - - host = ufshcd_get_variant(hba); - if (!(host->dbg_print_en & UFS_QCOM_DBG_PRINT_REGS_EN)) - return; - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_REG_OCSC); - print_fn(hba, reg, 44, "UFS_UFS_DBG_RD_REG_OCSC ", priv); - - reg = ufshcd_readl(hba, REG_UFS_CFG1); - reg |= UTP_DBG_RAMS_EN; - ufshcd_writel(hba, reg, REG_UFS_CFG1); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_EDTL_RAM); - print_fn(hba, reg, 32, "UFS_UFS_DBG_RD_EDTL_RAM ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_DESC_RAM); - print_fn(hba, reg, 128, "UFS_UFS_DBG_RD_DESC_RAM ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_PRDT_RAM); - print_fn(hba, reg, 64, "UFS_UFS_DBG_RD_PRDT_RAM ", priv); - - /* clear bit 17 - UTP_DBG_RAMS_EN */ - ufshcd_rmwl(hba, UTP_DBG_RAMS_EN, 0, REG_UFS_CFG1); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_UAWM); - print_fn(hba, reg, 4, "UFS_DBG_RD_REG_UAWM ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_UARM); - print_fn(hba, reg, 4, "UFS_DBG_RD_REG_UARM ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_TXUC); - print_fn(hba, reg, 48, "UFS_DBG_RD_REG_TXUC ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_RXUC); - print_fn(hba, reg, 27, "UFS_DBG_RD_REG_RXUC ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_DFC); - print_fn(hba, reg, 19, "UFS_DBG_RD_REG_DFC ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_TRLUT); - print_fn(hba, reg, 34, "UFS_DBG_RD_REG_TRLUT ", priv); - - reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_TMRLUT); - print_fn(hba, reg, 9, "UFS_DBG_RD_REG_TMRLUT ", priv); -} - static void ufs_qcom_enable_test_bus(struct ufs_qcom_host *host) { if (host->dbg_print_en & UFS_QCOM_DBG_PRINT_TEST_BUS_EN) { @@ -1365,10 +1307,56 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host) static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba) { + u32 reg; + struct ufs_qcom_host *host; + + host = ufshcd_get_variant(hba); + ufshcd_dump_regs(hba, REG_UFS_SYS1CLK_1US, 16 * 4, "HCI Vendor Specific Registers "); - ufs_qcom_print_hw_debug_reg_all(hba, NULL, ufs_qcom_dump_regs_wrapper); + if (!(host->dbg_print_en & UFS_QCOM_DBG_PRINT_REGS_EN)) + return; + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_REG_OCSC); + ufshcd_dump_regs(hba, reg, 44 * 4, "UFS_UFS_DBG_RD_REG_OCSC "); + + reg = ufshcd_readl(hba, REG_UFS_CFG1); + reg |= UTP_DBG_RAMS_EN; + ufshcd_writel(hba, reg, REG_UFS_CFG1); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_EDTL_RAM); + ufshcd_dump_regs(hba, reg, 32 * 4, "UFS_UFS_DBG_RD_EDTL_RAM "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_DESC_RAM); + ufshcd_dump_regs(hba, reg, 128 * 4, "UFS_UFS_DBG_RD_DESC_RAM "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_PRDT_RAM); + ufshcd_dump_regs(hba, reg, 64 * 4, "UFS_UFS_DBG_RD_PRDT_RAM "); + + /* clear bit 17 - UTP_DBG_RAMS_EN */ + ufshcd_rmwl(hba, UTP_DBG_RAMS_EN, 0, REG_UFS_CFG1); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_UAWM); + ufshcd_dump_regs(hba, reg, 4 * 4, "UFS_DBG_RD_REG_UAWM "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_UARM); + ufshcd_dump_regs(hba, reg, 4 * 4, "UFS_DBG_RD_REG_UARM "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_TXUC); + ufshcd_dump_regs(hba, reg, 48 * 4, "UFS_DBG_RD_REG_TXUC "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_RXUC); + ufshcd_dump_regs(hba, reg, 27 * 4, "UFS_DBG_RD_REG_RXUC "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_DFC); + ufshcd_dump_regs(hba, reg, 19 * 4, "UFS_DBG_RD_REG_DFC "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_TRLUT); + ufshcd_dump_regs(hba, reg, 34 * 4, "UFS_DBG_RD_REG_TRLUT "); + + reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_TMRLUT); + ufshcd_dump_regs(hba, reg, 9 * 4, "UFS_DBG_RD_REG_TMRLUT "); } /** From patchwork Thu Dec 1 23:08:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 28589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp537567wrr; Thu, 1 Dec 2022 15:19:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6yxNVCCmRa7XK7fXVSgF1yMHITB8/xbVrvbhJ9lB1yysRrDMVHHZxWQ/mSGJ6DOqjFJRKQ X-Received: by 2002:a05:6a00:22ca:b0:56e:64c8:f222 with SMTP id f10-20020a056a0022ca00b0056e64c8f222mr71090542pfj.71.1669936795544; Thu, 01 Dec 2022 15:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669936795; cv=none; d=google.com; s=arc-20160816; b=fNIWMY4R+S4NNnVZwx2/n3He2ahNY3NDuxyXoUTQaO9Bfb+pRLBnfwUCUv2YY4DWA2 zoCSQGIo9aYyiakblnGCXAbwwcOuySls5PRwCntA4p2TmsttqdiaC1Jk+juvO82N9mkW LoYqD4R9xTeO96krPfyAKycMzXacBFzVddk0VdrftfcxCr6oB9YEsfalJgJ+U1S054rE aOnJ8IjmAs9inCiwFw8zMBg8CjgW/GE4NSYxBkFtkV+B2WoDaVed3d8QIiNskAIpAFtM 9S/2K6cQ7bcawCRmtMVMHIOYDfVpjducTkRGQCwouXX0eOk4vEAomElEDpnjRnLT8Q/t Al4A== 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=Au+k80w/pmMXn842EfJNDQH8P/z+f/qneC68ARqh1Us=; b=o4UjmcHGMA/+qlubifSRSpBmoUieJ8ZatpY8htD8bIRZHtPS9+A67n4QX1IbJ55tEs jxtQJbXg5dP7Q5tYUbISZggkerMqc5kTMFnmr17AWdCyqQyv0taF+F4ETUmO3/pvJo5o g2jdbTuWKr6gkZ4S0ecnw/I29pdq/wtG+809h69I0FvEagES8wy6HiYcBzoyJPHO5w2q frSw1PclaQHkPqX2QZKLh1HSwQ0IWWqnywiiC5guIV0NyMM8hT93aOP/o/Ls2b7LVC1q yM5/W8L5tLejPUS69EchH97lWtzJXw3Mf61S7vdTbbBvNOGvFRZOzSRyEL4eLwlhOm64 f7vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="R/9R1A1W"; 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 s11-20020a65584b000000b0047873dedf41si2739250pgr.415.2022.12.01.15.19.42; Thu, 01 Dec 2022 15:19:55 -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="R/9R1A1W"; 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 S231861AbiLAXLH (ORCPT + 99 others); Thu, 1 Dec 2022 18:11:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbiLAXKe (ORCPT ); Thu, 1 Dec 2022 18:10:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15287C23CF for ; Thu, 1 Dec 2022 15:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669936142; 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=Au+k80w/pmMXn842EfJNDQH8P/z+f/qneC68ARqh1Us=; b=R/9R1A1Ww8tagOxCDUzhdjn4DgLOhEHt0vQxEFjkDOY7OBFeNyCs4LL9gi3in47fieBpm/ jmzmYLak050E5FK+aKzbDIk7hM6YOmTJKedjmv8NrAPRLmt00p+I3rRHTX0abpEA1Ayd+p c0SO7iEJLzfGPl12RjZPT9BuWKbz0uA= Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-140-_EeCtl4xMgazBUmmEZ-J9w-1; Thu, 01 Dec 2022 18:08:54 -0500 X-MC-Unique: _EeCtl4xMgazBUmmEZ-J9w-1 Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-13ba8947e4cso1496587fac.6 for ; Thu, 01 Dec 2022 15:08:54 -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=Au+k80w/pmMXn842EfJNDQH8P/z+f/qneC68ARqh1Us=; b=v/9IpKNrqKTYgtlxKBSDPdLBNi4zyG1TVbsjaA9axn3g1a0vhCwaDppbxa3cELdqnz bNDpXdT8LkBUytIQMk4k8bDsTqIgA1PKWGwutAGVdGxajyw1AP2hVPMFQd7OG8tnl0Wz icoQTfHAG+bGgpanAdCg6r12TojaH+ysYSE/JZk7afc1N6rt8n2Yg4bzT6pK/tz/ji7W zr6pN86psFTfEoiVNSG2YHH7CEOkW7sRrackx7FlRABQIOdF7fJ7wEDvLL7T+qvTp4hP pOyNDpElC6u0jyOKyEQwf1KfkkFNvPxnBjaQiK59p5XLJil7jJTMfy/FpdNXDHiTj6xW HDrQ== X-Gm-Message-State: ANoB5plt3Qbn4U06PmK5/AmZxDdVFt/sEsvddJrDL6A1BgCbg9OXav76 wHeTzyT5Pg24Vvo5t6DuX6pvWxDyDFZY7JgL/Brwo+UAow0JwaMf2DwB69Wsb7vtbktQGk1wPri D0/LsFQ/vjf8ujrsevekxg1DG X-Received: by 2002:aca:c108:0:b0:354:946b:f72f with SMTP id r8-20020acac108000000b00354946bf72fmr26849981oif.48.1669936134115; Thu, 01 Dec 2022 15:08:54 -0800 (PST) X-Received: by 2002:aca:c108:0:b0:354:946b:f72f with SMTP id r8-20020acac108000000b00354946bf72fmr26849967oif.48.1669936133904; Thu, 01 Dec 2022 15:08:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 15:08:53 -0800 (PST) From: Andrew Halaney 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 Subject: [PATCH 3/4] scsi: ufs: ufs-qcom: Remove usage of dbg_print_en Date: Thu, 1 Dec 2022 17:08:09 -0600 Message-Id: <20221201230810.1019834-4-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 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=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751055645407807793?= X-GMAIL-MSGID: =?utf-8?q?1751055645407807793?= This bitmask is unconditionally set in the current driver, so all conditionals using it can be considered bit rot. Let's take the current default conditional path everywhere and remove dbg_print_en from the driver. Signed-off-by: Andrew Halaney Reviewed-by: Manivannan Sadhasivam --- drivers/ufs/host/ufs-qcom.c | 18 +++--------------- drivers/ufs/host/ufs-qcom.h | 11 ----------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 1b0dfbbdcdf3..b1fcff1fad0c 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -22,9 +22,6 @@ #include #include -#define UFS_QCOM_DEFAULT_DBG_PRINT_EN \ - (UFS_QCOM_DBG_PRINT_REGS_EN | UFS_QCOM_DBG_PRINT_TEST_BUS_EN) - enum { TSTBUS_UAWM, TSTBUS_UARM, @@ -1040,7 +1037,6 @@ static int ufs_qcom_init(struct ufs_hba *hba) if (hba->dev->id < MAX_UFS_QCOM_HOSTS) ufs_qcom_hosts[hba->dev->id] = host; - host->dbg_print_en |= UFS_QCOM_DEFAULT_DBG_PRINT_EN; ufs_qcom_get_default_testbus_cfg(host); err = ufs_qcom_testbus_config(host); if (err) { @@ -1191,14 +1187,9 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, static void ufs_qcom_enable_test_bus(struct ufs_qcom_host *host) { - if (host->dbg_print_en & UFS_QCOM_DBG_PRINT_TEST_BUS_EN) { - ufshcd_rmwl(host->hba, UFS_REG_TEST_BUS_EN, - UFS_REG_TEST_BUS_EN, REG_UFS_CFG1); - ufshcd_rmwl(host->hba, TEST_BUS_EN, TEST_BUS_EN, REG_UFS_CFG1); - } else { - ufshcd_rmwl(host->hba, UFS_REG_TEST_BUS_EN, 0, REG_UFS_CFG1); - ufshcd_rmwl(host->hba, TEST_BUS_EN, 0, REG_UFS_CFG1); - } + ufshcd_rmwl(host->hba, UFS_REG_TEST_BUS_EN, + UFS_REG_TEST_BUS_EN, REG_UFS_CFG1); + ufshcd_rmwl(host->hba, TEST_BUS_EN, TEST_BUS_EN, REG_UFS_CFG1); } static void ufs_qcom_get_default_testbus_cfg(struct ufs_qcom_host *host) @@ -1315,9 +1306,6 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba) ufshcd_dump_regs(hba, REG_UFS_SYS1CLK_1US, 16 * 4, "HCI Vendor Specific Registers "); - if (!(host->dbg_print_en & UFS_QCOM_DBG_PRINT_REGS_EN)) - return; - reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_REG_OCSC); ufshcd_dump_regs(hba, reg, 44 * 4, "UFS_UFS_DBG_RD_REG_OCSC "); diff --git a/drivers/ufs/host/ufs-qcom.h b/drivers/ufs/host/ufs-qcom.h index 44466a395bb5..e567e4636357 100644 --- a/drivers/ufs/host/ufs-qcom.h +++ b/drivers/ufs/host/ufs-qcom.h @@ -113,15 +113,6 @@ enum { MASK_CLK_NS_REG = 0xFFFC00, }; -/* QCOM UFS debug print bit mask */ -#define UFS_QCOM_DBG_PRINT_REGS_EN BIT(0) -#define UFS_QCOM_DBG_PRINT_ICE_REGS_EN BIT(1) -#define UFS_QCOM_DBG_PRINT_TEST_BUS_EN BIT(2) - -#define UFS_QCOM_DBG_PRINT_ALL \ - (UFS_QCOM_DBG_PRINT_REGS_EN | UFS_QCOM_DBG_PRINT_ICE_REGS_EN | \ - UFS_QCOM_DBG_PRINT_TEST_BUS_EN) - /* QUniPro Vendor specific attributes */ #define PA_VS_CONFIG_REG1 0x9000 #define DME_VS_CORE_CLK_CTRL 0xD002 @@ -212,8 +203,6 @@ struct ufs_qcom_host { u32 dev_ref_clk_en_mask; - /* Bitmask for enabling debug prints */ - u32 dbg_print_en; struct ufs_qcom_testbus testbus; /* Reset control of HCI */ From patchwork Thu Dec 1 23:08:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 28590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp538496wrr; Thu, 1 Dec 2022 15:22:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf6HuAzU6/8gv4aah1kSxgieCxMoVYba5N+TIQRPrjdA6Q5rRRU0CC9XzMlU9UJlYjsCgyi6 X-Received: by 2002:a05:6402:206b:b0:46a:d5ed:e066 with SMTP id bd11-20020a056402206b00b0046ad5ede066mr27861259edb.335.1669936950895; Thu, 01 Dec 2022 15:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669936950; cv=none; d=google.com; s=arc-20160816; b=lkEkNjjAMd0QJ+5YshIdL1HCDCSdTKQ8YgrHLof6tuqELUA5r7yLvOQbYn1Hk5uE9X 670vTjo6duHVVvUGjQ+g5qVNTPRQEoicZ8qAXnudyWrfYjPfMdKBTrZvyAA6G0tKAEZU XlqVEMUVXA27c2BQKsjiGBcWSsYi4NOdt74AlE7O1lhKHODEim7KyJS3P3m5Ycna2yct 96ff1EcYiRC0rsSO22HGda9VvTqfY/EJplSoiYhJfiBsBIP1ElXmomRoNQfa+QiWqWbd N19yVdVm4smRKkAAux9Seb07wuow4ch8GPOkSkyAqyL7SRPZsngxXQzdx6JPkKboTUBV ZP/A== 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=BtaH/R2U9H/FSCFeNcuszPREFemDGP9fQpdb/KT1ZL4=; b=B7Zbl2eUb7vI6JBjKpNbYl9AF1bIrbRojdlovZuQ+kGuSvCYHqzYvJVBCPxd8XI+j3 egLQFqv5RrX4McNR3Oniq/KOWFfdnuvLyoGziuaV1gs+DFmrstCCmgUUr02L581lPB3Y qUp1jBbcU4ZVGXcVonZV2Ki3QS67oF4KuMLC89YyvkMtvWHndOQduu8LlYkdWupt/Sdi lWWbCQo7/JSLbtPGqN5p4kufMqICJ4gnfqhmUhY6hwASzniioBzR/qW6uT5RYFKJuTIW FqJF9dM3e2JW1OftxPsCGUEWIroeLk74qiHJT/MOFDgqeohJd4FdQ4fBymyQ8GB6k4GE 5SLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iS9QIA0N; 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 ne16-20020a1709077b9000b007bf7bb4702asi5220100ejc.804.2022.12.01.15.22.07; Thu, 01 Dec 2022 15:22:30 -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=iS9QIA0N; 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 S231583AbiLAXLT (ORCPT + 99 others); Thu, 1 Dec 2022 18:11:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbiLAXKn (ORCPT ); Thu, 1 Dec 2022 18:10:43 -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 DA3FFBF652 for ; Thu, 1 Dec 2022 15:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669936140; 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=BtaH/R2U9H/FSCFeNcuszPREFemDGP9fQpdb/KT1ZL4=; b=iS9QIA0NoHrNEmxnkrx8RMEYZRasgwABiPvgRDiDN73fYYitKyOjm6DJKxF/3d9CxvjkTS MwR+C1qBhZf880BnPr9N7jssCD7MnrJQrKrZ2wxB7Lck3ZFKD3q/h5yJ6AkFC4MU4YFuD6 +/9DHtFzKN0TDQstf7rzDPdBOno7S6A= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-423-aCRiw6XANKmbDPazvPw0OA-1; Thu, 01 Dec 2022 18:08:58 -0500 X-MC-Unique: aCRiw6XANKmbDPazvPw0OA-1 Received: by mail-oo1-f72.google.com with SMTP id x13-20020a4a9b8d000000b0049eeca57fbcso1013661ooj.9 for ; Thu, 01 Dec 2022 15:08:58 -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=BtaH/R2U9H/FSCFeNcuszPREFemDGP9fQpdb/KT1ZL4=; b=C7V9O9wlS0ZqGt5l1oU5k61g3qz+TqX111q0IY4MrIOUPwJ0HzKG0PwS5RZxd6idEB OzrDijTG2v/haSVNMXFirLa38/vtbZ//96XrexXIOlt3qEOxJxY1TSn1821A4BnGLWhd 9oVw9InlHNpk1wlrT76z6kMtq0sF9+3QTol/4CFmwPdQ9tLe4IE2fjKTR6lGtThubGFt GqdlBmjcD9kgtGgnlcKgfIlX0Lg01VKjvENHVSSzHo02xmQA37AhNOOSloZAw6Q90cX6 muhoVfpBcfbf3R1oL1Ka6FOoF5oPihGgqV9hMjjV+2xa5Pc8Y9kbelsrfd5CF5pBATNX nP/g== X-Gm-Message-State: ANoB5plyQ50sTonTbwyW+QEiWAWvjCUSy563eQiJYJitj5Dj+ALMneZe 8oT8SXizSrJzqEnWQKKC3rBtT84mccSK0jA2f1qQKmK8x6JjeCs+/NZQ9fCYo4uqiUCxPXwnImZ QaRLld3QE9zmkyJ/mf2ISVbOk X-Received: by 2002:a9d:5e0f:0:b0:662:2458:3ef7 with SMTP id d15-20020a9d5e0f000000b0066224583ef7mr34467970oti.150.1669936138147; Thu, 01 Dec 2022 15:08:58 -0800 (PST) X-Received: by 2002:a9d:5e0f:0:b0:662:2458:3ef7 with SMTP id d15-20020a9d5e0f000000b0066224583ef7mr34467958oti.150.1669936137925; Thu, 01 Dec 2022 15:08:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 15:08:57 -0800 (PST) From: Andrew Halaney 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 Subject: [PATCH 4/4] scsi: ufs: ufs-qcom: Use dev_err() where possible Date: Thu, 1 Dec 2022 17:08:10 -0600 Message-Id: <20221201230810.1019834-5-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 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=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751055808146675170?= X-GMAIL-MSGID: =?utf-8?q?1751055808146675170?= dev_err() statements are better to use than pr_err(), so switch to those. In a similar vein, the check on the dev_req_params pointer here is not needed, the two places this function is called never pass in a NULL pointer, so instead of using dev_err() there just remove it. Signed-off-by: Andrew Halaney Reviewed-by: Manivannan Sadhasivam --- drivers/ufs/host/ufs-qcom.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index b1fcff1fad0c..4350c44a6fc7 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -680,12 +680,6 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba, struct ufs_dev_params ufs_qcom_cap; int ret = 0; - if (!dev_req_params) { - pr_err("%s: incoming dev_req_params is NULL\n", __func__); - ret = -EINVAL; - goto out; - } - switch (status) { case PRE_CHANGE: ufshcd_init_pwr_dev_param(&ufs_qcom_cap); @@ -709,7 +703,7 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba, dev_max_params, dev_req_params); if (ret) { - pr_err("%s: failed to determine capabilities\n", + dev_err(hba->dev, "%s: failed to determine capabilities\n", __func__); goto out; }