Bug 77551 - powerpc/platforms/powernv/opal-msglog.c: 2 * pointless check
Summary: powerpc/platforms/powernv/opal-msglog.c: 2 * pointless check
Status: CLOSED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: PPC-32 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: platform_ppc-32
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-09 13:47 UTC by David Binderman
Modified: 2017-11-24 03:54 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.15
Tree: Mainline
Regression: No


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.