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: <CACRpkdZKuiR7jaa-gsVTc=w64yhXv_Pny9u_zOkHDjcyXaXSeA@mail.gmail.com>
Date: Wed, 23 Apr 2025 10:38:13 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Yen-Chi Huang <jesse.huang@...twell.com.tw>
Cc: hdegoede@...hat.com, ilpo.jarvinen@...ux.intel.com, brgl@...ev.pl, 
	wim@...ux-watchdog.org, linux@...ck-us.net, linux-kernel@...r.kernel.org, 
	platform-driver-x86@...r.kernel.org, linux-gpio@...r.kernel.org, 
	linux-watchdog@...r.kernel.org, jay.chen@...onical.com
Subject: Re: [PATCH v5] platform/x86: portwell-ec: Add GPIO and WDT driver for
 Portwell EC

Hi Yen-Chi,

thanks for your patch!

On Fri, Apr 18, 2025 at 10:24 AM Yen-Chi Huang
<jesse.huang@...twell.com.tw> wrote:

> Adds a driver for the ITE Embedded Controller (EC) on Portwell boards.
> It integrates with the Linux GPIO and watchdog subsystems to provide:
>
> - Control/monitoring of up to 8 EC GPIO pins.
> - Hardware watchdog timer with 1-255 second timeouts.
>
> The driver communicates with the EC via I/O port 0xe300 and identifies
> the hardware by the "PWG" firmware signature. This enables enhanced
> system management for Portwell embedded/industrial platforms.
>
> Signed-off-by: Yen-Chi Huang <jesse.huang@...twell.com.tw>
(...)

> +static int pwec_gpio_get(struct gpio_chip *chip, unsigned int offset)
> +{
> +       return (pwec_read(PORTWELL_GPIO_VAL_REG) & (1 << offset)) ? 1 : 0;

I would use BIT(offset) instead of open-coding (1 << offset) in all of these
instances.

The main reason we use it is that the BIT() macro hardwires U (unsigned)
to the parameter so no mistakes can be made (even if you have
no mistakes here obviously, it's a good habit).

Either way this is not a big deal so:
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ