diff mbox series

powerpc/ps3: remove an unneeded NULL check

Message ID 20180123083318.GB10091@mwanda (mailing list archive)
State Accepted
Headers show
Series powerpc/ps3: remove an unneeded NULL check | expand

Commit Message

Dan Carpenter Jan. 23, 2018, 8:33 a.m. UTC
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>

Comments

Geoff Levand Jan. 23, 2018, 6:25 p.m. UTC | #1
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
diff mbox series

Patch

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);