lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdYKY-fZED=ZCjuXD5s0TYYxBsgFwJ2ga-rHkx4k6FE5Bg@mail.gmail.com>
Date: Thu, 6 Feb 2025 19:17:05 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Dipen Patel <dipenp@...dia.com>, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org, timestamp@...ts.linux.dev, 
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH] gpiolib: don't build HTE code with CONFIG_HTE disabled

Hi Bartosz,

On Thu, Feb 6, 2025 at 3:37 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> Hardware timestamping is only used on tegra186 platforms but we include
> the code and export the symbols everywhere. Shrink the binary a bit by
> compiling the relevant functions conditionally.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>

Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

> +static inline int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc,
> +                                              unsigned long flags)
> +{
> +#if !IS_ENABLED(CONFIG_GPIOLIB)
> +       WARN_ON(desc);
> +#endif
> +       return -ENOSYS;

I think you can just:

if (!IS_ENABLED(CONFIG_GPIOLIB))
  WARN_ON()
else
  return -ENOSYS;

here, so it's not so ifdeffy.
The compiler will eliminate the second branch.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ