Re: [PATCH] gpio: sim: fix hogs with custom chip labels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 8, 2022 at 8:34 PM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> We always assign the default device name as the chip_label in hog
> structures which makes it impossible to assign hogs to chips. Let's
> first check if a custom label was set and then copy it instead of the
> default device name.

...

> +       return (bank->label && (strlen(bank->label) > 0));

It can be simply

  return bank->label && strlen(bank->label);

Or even w/o strlen() call:

  return bank->label && *bank->label; // or bank->label && bank->label[0]

Either way the code LGTM,
Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux