From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E04BC433DF for ; Mon, 17 Aug 2020 14:27:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B2E32067C for ; Mon, 17 Aug 2020 14:27:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="Znz/AOSI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728737AbgHQO1y (ORCPT ); Mon, 17 Aug 2020 10:27:54 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:33190 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728669AbgHQO1w (ORCPT ); Mon, 17 Aug 2020 10:27:52 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597674472; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=6e6Bqrm2jR07xHEe5aaNgE6JVEUspYK2v6jUh9M+BAk=; b=Znz/AOSIiDnYD6ThIMupaL7drpeUxs1p3PDHzwrb2muVU1KBS7ZUrqxgpxgoRq3iVYddyu8p M/Y9jeOJrUXkWLeHYzhWBl4FpRTnMG42leOhkwOHBc1vdOwxfQe6+XcHpiv3N78lVZVf8/85 OlhVKe6PtVDQImhyrn3dUqFbii4= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n09.prod.us-east-1.postgun.com with SMTP id 5f3a93b3247ccc308ca301cc (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 17 Aug 2020 14:26:59 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BBF7BC433CB; Mon, 17 Aug 2020 14:26:58 +0000 (UTC) Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 527C0C433C6; Mon, 17 Aug 2020 14:26:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 527C0C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Tang Bin Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, Zhang Shengju Subject: Re: [PATCH] ath10k: fix the status check and wrong return References: <20200814144844.1920-1-tangbin@cmss.chinamobile.com> Date: Mon, 17 Aug 2020 17:26:54 +0300 In-Reply-To: <20200814144844.1920-1-tangbin@cmss.chinamobile.com> (Tang Bin's message of "Fri, 14 Aug 2020 22:48:44 +0800") Message-ID: <87y2mdjqkx.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Tang Bin writes: > In the function ath10k_ahb_clock_init(), devm_clk_get() doesn't > return NULL. Thus use IS_ERR() and PTR_ERR() to validate > the returned value instead of IS_ERR_OR_NULL(). Why? What's the benefit of this patch? Or what harm does IS_ERR_OR_NULL() create? > Signed-off-by: Zhang Shengju > Signed-off-by: Tang Bin > --- > drivers/net/wireless/ath/ath10k/ahb.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c > index ed87bc00f..ea669af6a 100644 > --- a/drivers/net/wireless/ath/ath10k/ahb.c > +++ b/drivers/net/wireless/ath/ath10k/ahb.c > @@ -87,24 +87,24 @@ static int ath10k_ahb_clock_init(struct ath10k *ar) > dev = &ar_ahb->pdev->dev; > > ar_ahb->cmd_clk = devm_clk_get(dev, "wifi_wcss_cmd"); > - if (IS_ERR_OR_NULL(ar_ahb->cmd_clk)) { > + if (IS_ERR(ar_ahb->cmd_clk)) { > ath10k_err(ar, "failed to get cmd clk: %ld\n", > PTR_ERR(ar_ahb->cmd_clk)); > - return ar_ahb->cmd_clk ? PTR_ERR(ar_ahb->cmd_clk) : -ENODEV; > + return PTR_ERR(ar_ahb->cmd_clk); > } devm_clk_get() can return NULL if CONFIG_HAVE_CLK is disabled: static inline struct clk *devm_clk_get(struct device *dev, const char *id) { return NULL; } -- https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches