RE: [patch v8 0/3] drivers/platform: replace module x86/mlxcpld-hotplug with mellanox/mlxreg-hotplug
From: Vadim Pasternak
Date: Tue Jan 16 2018 - 03:08:50 EST
> -----Original Message-----
> From: Darren Hart [mailto:dvhart@xxxxxxxxxxxxx]
> Sent: Tuesday, January 16, 2018 5:50 AM
> To: Vadim Pasternak <vadimp@xxxxxxxxxxxx>
> Cc: andy.shevchenko@xxxxxxxxx; gregkh@xxxxxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; platform-driver-x86@xxxxxxxxxxxxxxx; jiri@xxxxxxxxxxx
> Subject: Re: [patch v8 0/3] drivers/platform: replace module x86/mlxcpld-
> hotplug with mellanox/mlxreg-hotplug
>
> On Mon, Jan 15, 2018 at 07:45:11PM -0800, Darren Hart wrote:
> > On Mon, Jan 15, 2018 at 07:42:09PM -0800, Darren Hart wrote:
> > > To follow this email, are two patches which are minor incremental
> > > cleanups, which I'd appreciate your review of before I push them to
> > > testing.
> >
> >
> > From 2c5d26ee913e0f5f7d13c559d85e8da7e4ddcdab Mon Sep 17 00:00:00
> 2001
> > Message-Id:
> >
> <2c5d26ee913e0f5f7d13c559d85e8da7e4ddcdab.1516073719.git.dvhart@infra
> d
> > ead.org>
> > From: "Darren Hart (VMware)" <dvhart@xxxxxxxxxxxxx>
> > Date: Mon, 15 Jan 2018 19:16:36 -0800
> > Subject: [PATCH 1/2] platform/mellanox: mlxreg-hotplug: Simplify exit
> > path
> >
> > Several functions use a "goto access_error" pattern result in a
> > duplicated exit path at the end of the function. Address this by using
> > a single exit path, and checking for (ret) prior to printing the error
> > message. This adds a conditional, but only in the failure case, and
> > simplifies the exit path.
> >
> > Signed-off-by: Darren Hart (VMware) <dvhart@xxxxxxxxxxxxx>
> > Cc: Vadim Pasternak <vadimp@xxxxxxxxxxxx>
Acked-by: Vadim Pasternak <vadimp@xxxxxxxxxxxx>
> > ---
> > drivers/platform/mellanox/mlxreg-hotplug.c | 62
> > ++++++++++++------------------
> > 1 file changed, 25 insertions(+), 37 deletions(-)
> >
> > diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c
> > b/drivers/platform/mellanox/mlxreg-hotplug.c
> > index 9bbaa8c..78056f7 100644
> > --- a/drivers/platform/mellanox/mlxreg-hotplug.c
> > +++ b/drivers/platform/mellanox/mlxreg-hotplug.c
> ...
> > @@ -267,18 +267,15 @@ mlxreg_hotplug_work_helper(struct
> mlxreg_hotplug_priv_data *priv,
> > ret = regmap_write(priv->regmap, item->reg +
> MLXREG_HOTPLUG_EVENT_OFF,
> > 0);
> > if (ret)
> > - goto access_error;
> > + goto out:
>
> Apologies: goto out;
>
> --
> Darren Hart
> VMware Open Source Technology Center