Re: [PATCH v2 4/7] nvmem: simplify locking with guard()

From: Bartosz Golaszewski

Date: Wed Apr 29 2026 - 11:50:34 EST


On Mon, Mar 23, 2026 at 5:35 PM Johan Hovold <johan@xxxxxxxxxx> wrote:
>
> > @@ -1343,11 +1334,9 @@ nvmem_cell_get_from_lookup(struct device *dev, const char *con_id)
> > /* This is the right entry. */
> > nvmem = __nvmem_device_get((void *)lookup->nvmem_name,
> > device_match_name);
> > - if (IS_ERR(nvmem)) {
> > + if (IS_ERR(nvmem))
> > /* Provider may not be registered yet. */
> > - cell = ERR_CAST(nvmem);
> > - break;
> > - }
> > + return ERR_CAST(nvmem);
>
> Please keep the brackets here for readability.
>

I decided to leave it as is unless Srini complains. This is in line
with the kernel coding style and checkpatch.pl doesn't complain. There
are plenty of other cases like this.

Bart