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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZTuf5fk8PV/LqHwr@smile.fi.intel.com>
Date:   Fri, 27 Oct 2023 14:32:53 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Linhua Xu <Linhua.xu@...soc.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Orson Zhai <orsonzhai@...il.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
        lh xu <xulh0829@...il.com>,
        Zhirong Qiu <zhirong.qiu@...soc.com>,
        Xiongpeng Wu <xiongpeng.wu@...soc.com>
Subject: Re: [PATCH V3 2/6] pinctrl: sprd: Fix the incorrect mask and shift
 definition

On Fri, Oct 27, 2023 at 03:14:22PM +0800, Linhua Xu wrote:
> From: Linhua Xu <Linhua.Xu@...soc.com>
> 
> Pull-up and pull-down are mutually exclusive. When setting one of them,
> the bit of the other needs to be clear. Now, there are cases where pull-up
> and pull-down are set at the same time in the code, thus fix them.

...

> Fixes:<1fb4b907e808> ("pinctrl: sprd: Add Spreadtrum pin control driver")
> 
> Signed-off-by: Linhua Xu <Linhua.Xu@...soc.com>

Same comment  about the Fixes: tag.

...

> -#define SLEEP_PULL_DOWN_MASK		0x1
> +#define SLEEP_PULL_DOWN_MASK		GENMASK(1, 0)
>  #define SLEEP_PULL_DOWN_SHIFT		2

No, this is an incorrect (prone to errors and confusion) change.
You need to introduce new mask for both of them and use in the code.

#define SLEEP_PULL_UP_DOWN_MASK		GENMASK(1, 0)
#define SLEEP_PULL_UP_DOWN_SHIFT	2

...

> -#define PULL_DOWN_MASK			0x1
> +#define PULL_DOWN_MASK			(GENMASK(1, 0) | BIT(6))
>  #define PULL_DOWN_SHIFT			6

Ditto.

#define PULL_UP_DOWN_MASK		(GENMASK(1, 0) | BIT(6))
#define PULL_UP_DOWN_SHIFT		6

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ