Bug 77551

Summary: powerpc/platforms/powernv/opal-msglog.c: 2 * pointless check
Product: Platform Specific/Hardware Reporter: David Binderman (dcb314)
Component: PPC-32Assignee: platform_ppc-32
Status: CLOSED CODE_FIX    
Severity: normal CC: joel, michael
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.15 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-06-09 13:47:14 UTC
[linux-3.15/arch/powerpc/platforms/powernv/opal-msglog.c:65]: (style) Checking if unsigned variable 'ret' is less than zero.
[linux-3.15/arch/powerpc/platforms/powernv/opal-msglog.c:82]: (style) Checking if unsigned variable 'ret' is less than zero.

Local variable "ret" is of type size_t. This is always unsigned,
so it is pointless to check if it is less than zero.

Suggest code rework.
Comment 1 Joel Stanley 2014-06-14 06:09:23 UTC
Fixed in caf69ba62768d3bae4fa8e6ad734cd5565207bd4

 powerpc/powernv: Fix reading of OPAL msglog

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/powerpc/platforms/powernv?id=caf69ba62768d3bae4fa8e6ad734cd5565207bd4

Thanks!
Comment 2 Michael Ellerman 2017-11-24 03:53:58 UTC
Thanks David & Joel.