* [PATCH -next] fpga: dfl: simplify the return expression of fme_perf_pmu_register
@ 2020-09-21 8:24 Liu Shixin
2020-09-21 15:36 ` Wu, Hao
0 siblings, 1 reply; 2+ messages in thread
From: Liu Shixin @ 2020-09-21 8:24 UTC (permalink / raw)
To: Wu Hao, Tom Rix, Moritz Fischer; +Cc: linux-fpga, linux-kernel, Liu Shixin
Simplify the return expression.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
drivers/fpga/dfl-fme-perf.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/fpga/dfl-fme-perf.c b/drivers/fpga/dfl-fme-perf.c
index 531266287eee..e881fbe6d838 100644
--- a/drivers/fpga/dfl-fme-perf.c
+++ b/drivers/fpga/dfl-fme-perf.c
@@ -906,7 +906,6 @@ static int fme_perf_pmu_register(struct platform_device *pdev,
{
struct pmu *pmu = &priv->pmu;
char *name;
- int ret;
spin_lock_init(&priv->fab_lock);
@@ -926,11 +925,7 @@ static int fme_perf_pmu_register(struct platform_device *pdev,
name = devm_kasprintf(priv->dev, GFP_KERNEL, "dfl_fme%d", pdev->id);
- ret = perf_pmu_register(pmu, name, -1);
- if (ret)
- return ret;
-
- return 0;
+ return perf_pmu_register(pmu, name, -1);
}
static void fme_perf_pmu_unregister(struct fme_perf_priv *priv)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH -next] fpga: dfl: simplify the return expression of fme_perf_pmu_register
2020-09-21 8:24 [PATCH -next] fpga: dfl: simplify the return expression of fme_perf_pmu_register Liu Shixin
@ 2020-09-21 15:36 ` Wu, Hao
0 siblings, 0 replies; 2+ messages in thread
From: Wu, Hao @ 2020-09-21 15:36 UTC (permalink / raw)
To: Liu Shixin, Tom Rix, Moritz Fischer; +Cc: linux-fpga, linux-kernel
> Subject: [PATCH -next] fpga: dfl: simplify the return expression of
> fme_perf_pmu_register
>
> Simplify the return expression.
>
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Looks good to me.
Acked-by: Wu Hao <hao.wu@intel.com>
Thanks
Hao
> ---
> drivers/fpga/dfl-fme-perf.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/fpga/dfl-fme-perf.c b/drivers/fpga/dfl-fme-perf.c
> index 531266287eee..e881fbe6d838 100644
> --- a/drivers/fpga/dfl-fme-perf.c
> +++ b/drivers/fpga/dfl-fme-perf.c
> @@ -906,7 +906,6 @@ static int fme_perf_pmu_register(struct
> platform_device *pdev,
> {
> struct pmu *pmu = &priv->pmu;
> char *name;
> - int ret;
>
> spin_lock_init(&priv->fab_lock);
>
> @@ -926,11 +925,7 @@ static int fme_perf_pmu_register(struct
> platform_device *pdev,
>
> name = devm_kasprintf(priv->dev, GFP_KERNEL, "dfl_fme%d", pdev-
> >id);
>
> - ret = perf_pmu_register(pmu, name, -1);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return perf_pmu_register(pmu, name, -1);
> }
>
> static void fme_perf_pmu_unregister(struct fme_perf_priv *priv)
> --
> 2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-21 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 8:24 [PATCH -next] fpga: dfl: simplify the return expression of fme_perf_pmu_register Liu Shixin
2020-09-21 15:36 ` Wu, Hao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).