mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>,
	Jonathan Cameron <jic23@kernel.org>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux@analog.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: adc: ti-ads131m02: Drop redundant NULL check on devm_clk_get_enabled()
Date: Mon, 6 Jul 2026 08:55:37 +0200	[thread overview]
Message-ID: <11ddf106-9b69-4872-8635-aa934e4dc20a@oss.qualcomm.com> (raw)
In-Reply-To: <aktFUqFUR0-Zx8uJ@ashevche-desk.local>

On 06/07/2026 08:04, Andy Shevchenko wrote:
> On Mon, Jul 06, 2026 at 12:37:12AM +0100, Jonathan Cameron wrote:
>> On Sun,  5 Jul 2026 19:24:39 +0200
>> Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:
>>
>>> devm_clk_get_enabled() does not return NULL (only valid clock or ERR
>>> pointer), so simplify the code to drop redundant IS_ERR_OR_NULL().
>>>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>> See the stub.
>>
>> static inline struct clk *devm_clk_get_enabled(struct device *dev,
>> 					       const char *id)
>> {
>> 	return NULL;
>> }
>> Not sure what the reasoning behind that is.  Maybe that
>> clock could be already on?
>>
>> We could I guess make this driver depend on one of the clk
>> related configs, but today it doesn't. So to me this NULL check smells
>> of protection we don't need so I think the change is fine, but the
>> patch description should reflect that stub and it being considered
>> reasonable to plough on regardless.
> 
> Ah, good catch! I have thought for a moment about this possibility, but I gave
> tag anyway as the stub thingy should be addressed separately anyway as there
> are many drivers (I think) that do not check for NULL.

Except these ~8 cases I found (I sent a bunch of patches), no one checks
for NULL...

Best regards,
Krzysztof

  reply	other threads:[~2026-07-06  6:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-05 17:24 Krzysztof Kozlowski
2026-07-05 17:24 ` [PATCH 2/2] iio: adc: ade9000: Drop incorrect kerneldoc marker Krzysztof Kozlowski
2026-07-05 17:37   ` Joshua Crofts
2026-07-05 17:50   ` Maxwell Doose
2026-07-05 23:37     ` Jonathan Cameron
2026-07-05 17:34 ` [PATCH 1/2] iio: adc: ti-ads131m02: Drop redundant NULL check on devm_clk_get_enabled() Joshua Crofts
2026-07-05 23:37 ` Jonathan Cameron
2026-07-06  6:01   ` Krzysztof Kozlowski
2026-07-06  6:04   ` Andy Shevchenko
2026-07-06  6:55     ` Krzysztof Kozlowski [this message]
2026-07-06  7:03       ` Andy Shevchenko
2026-07-06  6:01 ` Andy Shevchenko

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=11ddf106-9b69-4872-8635-aa934e4dc20a@oss.qualcomm.com \
    --to=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=nuno.sa@analog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®