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: <ZgP/p2Lx4QKl5zjH@kuha.fi.intel.com>
Date: Wed, 27 Mar 2024 13:14:47 +0200
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Jameson Thies <jthies@...gle.com>
Cc: linux-usb@...r.kernel.org, pmalani@...omium.org, bleung@...gle.com,
	abhishekpandit@...omium.org, andersson@...nel.org,
	dmitry.baryshkov@...aro.org, fabrice.gasnier@...s.st.com,
	gregkh@...uxfoundation.org, hdegoede@...hat.com,
	neil.armstrong@...aro.org, rajaram.regupathy@...el.com,
	saranya.gopal@...el.com, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org, Benson Leung <bleung@...omium.org>
Subject: Re: [PATCH v4 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros

On Tue, Mar 05, 2024 at 02:58:01AM +0000, Jameson Thies wrote:
> Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for
> plug type and updating the modal support macro for consistent naming.
> 
> Fixes: 3cf657f07918 ("usb: typec: ucsi: Remove all bit-fields")
> Cc: stable@...r.kernel.org
> Reviewed-by: Benson Leung <bleung@...omium.org>
> Reviewed-by: Prashant Malani <pmalani@...omium.org>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> Signed-off-by: Jameson Thies <jthies@...gle.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>

> ---
> Changes in v4:
> - None.
> 
> Changes in v3:
> - Fixed CC stable.
> 
> Changes in v2:
> - Tested on usb-testing branch merged with chromeOS 6.8-rc2 kernel.
> 
>  drivers/usb/typec/ucsi/ucsi.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
> index 7e35ffbe0a6f2..469a2baf472e4 100644
> --- a/drivers/usb/typec/ucsi/ucsi.h
> +++ b/drivers/usb/typec/ucsi/ucsi.h
> @@ -259,12 +259,12 @@ struct ucsi_cable_property {
>  #define UCSI_CABLE_PROP_FLAG_VBUS_IN_CABLE	BIT(0)
>  #define UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE	BIT(1)
>  #define UCSI_CABLE_PROP_FLAG_DIRECTIONALITY	BIT(2)
> -#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	((_f_) & GENMASK(3, 0))
> +#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	(((_f_) & GENMASK(4, 3)) >> 3)
>  #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_A	0
>  #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_B	1
>  #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_C	2
>  #define   UCSI_CABLE_PROPERTY_PLUG_OTHER	3
> -#define UCSI_CABLE_PROP_MODE_SUPPORT		BIT(5)
> +#define UCSI_CABLE_PROP_FLAG_MODE_SUPPORT	BIT(5)
>  	u8 latency;
>  } __packed;
>  
> -- 
> 2.44.0.rc1.240.g4c46232300-goog

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ