All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Akshay Jindal <akshayaj.lkd@gmail.com>
Cc: anshulusr@gmail.com, jic23@kernel.org, dlechner@baylibre.com,
	nuno.sa@analog.com, andy@kernel.org, shuah@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] iio: light: ltr390: Implement runtime PM support
Date: Wed, 3 Sep 2025 13:37:36 +0300	[thread overview]
Message-ID: <aLgacK0MMojkaKuW@smile.fi.intel.com> (raw)
In-Reply-To: <CAE3SzaTnNckFDRMDqGPDAg471bRskJ=_n5C_qSLKQeq3F-Lu_g@mail.gmail.com>

On Wed, Sep 03, 2025 at 09:15:53AM +0530, Akshay Jindal wrote:
> On Tue, Sep 2, 2025 at 6:27 PM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > On Tue, Sep 02, 2025 at 12:12:36AM +0530, Akshay Jindal wrote:

...

> > >       /* Ensure that power off and interrupts are disabled */
> > > -     if (regmap_clear_bits(data->regmap, LTR390_INT_CFG,
> > > -                             LTR390_LS_INT_EN) < 0)
> > > -             dev_err(&data->client->dev, "failed to disable interrupts\n");
> > > +     if (data->irq_enabled) {
> > > +             if (regmap_clear_bits(data->regmap, LTR390_INT_CFG,
> > > +                                     LTR390_LS_INT_EN) < 0)
> >
> > Wrong indentation, hard to read line, either one line, or do better.
> > Actually why not assign it to ret? The above not only simple style issue,
> > but also makes readability much harder as the semantics of '0' is
> > completely hidden. This style is discouraged.
> Earlier did not use ret here, because powerdown function is of type void.
> But if readability is the issue, I have used ret.
> 
> Regarding clubbing into 1 line, I have my reservations there. I think we
> should not violate the 80 char line limit.

Shouldn't != mustn't, esp. when it's about readability.

> Also since the line is already 1-level indented (begins at 9th column, due to
> if(data->irq_enabled) check), the spillover will be too much. The readability
> does not seem to be taking a substantial hit here. Let me know if this is
> non-negotiable for you. Will happily make the changes.

		ret = regmap_clear_bits(data->regmap, LTR390_INT_CFG, LTR390_LS_INT_EN);

only 88 characters. One can make it shorter, yes

	struct regmap *map = data->regmap;

		ret = regmap_clear_bits(map, LTR390_INT_CFG, LTR390_LS_INT_EN);


79 characters.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-09-03 10:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 18:42 [PATCH v4] iio: light: ltr390: Implement runtime PM support Akshay Jindal
2025-09-02 12:57 ` Andy Shevchenko
2025-09-02 12:59   ` Andy Shevchenko
2025-09-03  3:45   ` Akshay Jindal
2025-09-03 10:37     ` Andy Shevchenko [this message]
2025-09-03 11:27       ` Akshay Jindal

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=aLgacK0MMojkaKuW@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=akshayaj.lkd@gmail.com \
    --cc=andy@kernel.org \
    --cc=anshulusr@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=shuah@kernel.org \
    /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.