All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Tang Bin <tangbin@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	davem@davemloft.net, ath10k@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ath10k: fix the status check and wrong return
Date: Tue, 18 Aug 2020 12:08:42 +0300	[thread overview]
Message-ID: <87lficjp7p.fsf@codeaurora.org> (raw)
In-Reply-To: <e53ee8ca-9c2b-2313-6fd7-8f73ae33e1a2@cmss.chinamobile.com> (Tang Bin's message of "Tue, 18 Aug 2020 09:42:03 +0800")

Tang Bin <tangbin@cmss.chinamobile.com> writes:

> 在 2020/8/17 22:26, Kalle Valo 写道:
>>> 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?
>
> Thanks for you reply, the benefit of this patch is simplify the code,
> because in
>
> this function, I don't think the situation of 'devm_clk_get() return
> NULL' exists.
>
> So please think about it, thanks.

I think you missed my comment below:

>> 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;
>> }

So I think this patch just creates a new bug and does not improve
anything.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@codeaurora.org>
To: Tang Bin <tangbin@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	davem@davemloft.net, ath10k@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ath10k: fix the status check and wrong return
Date: Tue, 18 Aug 2020 12:08:42 +0300	[thread overview]
Message-ID: <87lficjp7p.fsf@codeaurora.org> (raw)
In-Reply-To: <e53ee8ca-9c2b-2313-6fd7-8f73ae33e1a2@cmss.chinamobile.com> (Tang Bin's message of "Tue, 18 Aug 2020 09:42:03 +0800")

Tang Bin <tangbin@cmss.chinamobile.com> writes:

> 在 2020/8/17 22:26, Kalle Valo 写道:
>>> 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?
>
> Thanks for you reply, the benefit of this patch is simplify the code,
> because in
>
> this function, I don't think the situation of 'devm_clk_get() return
> NULL' exists.
>
> So please think about it, thanks.

I think you missed my comment below:

>> 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;
>> }

So I think this patch just creates a new bug and does not improve
anything.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  parent reply	other threads:[~2020-08-18  9:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 14:48 [PATCH] ath10k: fix the status check and wrong return Tang Bin
2020-08-14 14:48 ` Tang Bin
2020-08-14 16:40 ` Tom Psyborg
2020-08-14 16:40   ` Tom Psyborg
2020-08-17 14:26 ` Kalle Valo
2020-08-17 14:26   ` Kalle Valo
2020-08-18  1:42   ` Tang Bin
2020-08-18  1:42     ` Tang Bin
2020-08-18  4:40     ` Steve deRosier
2020-08-18  4:40       ` Steve deRosier
2020-08-18  9:08     ` Kalle Valo [this message]
2020-08-18  9:08       ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lficjp7p.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath10k@lists.infradead.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tangbin@cmss.chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.