Re: [PATCH] soc: qcom: geni: Make version macros simpler
From: Doug Anderson
Date: Mon May 21 2018 - 14:36:45 EST
Hi,
On Fri, May 18, 2018 at 3:47 PM, Stephen Boyd <swboyd@xxxxxxxxxxxx> wrote:
> This macro doesn't work, because it hides a local variable inside of the
> macro to hold the version and that variable name is called 'ver' and
> 'version' sometimes.
>
> Let's change this to be more explicit. Introduce three macros for the
> major, minor, and step of the version, and require callers to pass the
> version in to get the part of the version out. This way we don't hide
> local variables inside macros and things are less evil overall.
>
> Cc: Karthikeyan Ramasubramanian <kramasub@xxxxxxxxxxxxxx>
> Cc: Sagar Dharia <sdharia@xxxxxxxxxxxxxx>
> Cc: Girish Mahadevan <girishm@xxxxxxxxxxxxxx>
> Signed-off-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
> ---
> include/linux/qcom-geni-se.h | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
FWIW I agree that Stephen's patch makes things more readable.
Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>