* [PATCH] powerpc/ps3: remove an unneeded NULL check
@ 2018-01-23 8:33 Dan Carpenter
2018-01-23 18:25 ` Geoff Levand
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-01-23 8:33 UTC (permalink / raw)
To: Geoff Levand
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, kernel-janitors
Static checkers don't like the inconsistent NULL checking on "ops".
This function is only called once and "ops" isn't NULL so the check can
be removed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/ps3/sys-manager-core.c b/drivers/ps3/sys-manager-core.c
index c429ffca1ab7..a5a6def77bb9 100644
--- a/drivers/ps3/sys-manager-core.c
+++ b/drivers/ps3/sys-manager-core.c
@@ -43,7 +43,7 @@ void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops)
{
BUG_ON(!ops);
BUG_ON(!ops->dev);
- ps3_sys_manager_ops = ops ? *ops : ps3_sys_manager_ops;
+ ps3_sys_manager_ops = *ops;
}
EXPORT_SYMBOL_GPL(ps3_sys_manager_register_ops);
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] powerpc/ps3: remove an unneeded NULL check
2018-01-23 8:33 [PATCH] powerpc/ps3: remove an unneeded NULL check Dan Carpenter
@ 2018-01-23 18:25 ` Geoff Levand
0 siblings, 0 replies; 2+ messages in thread
From: Geoff Levand @ 2018-01-23 18:25 UTC (permalink / raw)
To: Dan Carpenter
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, kernel-janitors
Hi Dan,
On 01/23/2018 12:33 AM, Dan Carpenter wrote:
> @@ -43,7 +43,7 @@ void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops)
> {
> BUG_ON(!ops);
> BUG_ON(!ops->dev);
> - ps3_sys_manager_ops = ops ? *ops : ps3_sys_manager_ops;
> + ps3_sys_manager_ops = *ops;
This seems to be a left over from when I was adding the modular
system-manager support. It doesn't really make sense if you
look at how the ps3_sys_manager_ops variable is used.
I added your patch to my ps3-queue branch. Thanks for the
contribution.
-Geoff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-23 18:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 8:33 [PATCH] powerpc/ps3: remove an unneeded NULL check Dan Carpenter
2018-01-23 18:25 ` Geoff Levand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox