Skip to contentSkip to conversation

powerpc/ps3: remove an unneeded NULL check

PATCH In review Dan Carpenter 2 participants 2 messages Jan 23, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/ps3: remove an unneeded NULL check

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.

drivers/ps3/sys-manager-core.c +1 -1
index c429ffca1ab7..a5a6def77bb9 100644
@@ -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);
 
maintainer
#1 lore raw

Hi Dan,

drivers/ps3/sys-manager-core.c void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops) · line 46

Quoted 6 lines · Dan Carpenter
drivers/ps3/sys-manager-core.c +1 -1
@@ -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