aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorAndrey Utkin <[email protected]>2014-07-11 15:38:30 +0100
committerGreg Kroah-Hartman <[email protected]>2014-07-11 17:40:06 -0700
commitd2fd4d395abb5c5695fb754c82fc7c20f8537852 (patch)
tree3ae0d9233c4a6faf0854a0362646d421fed10626 /tools/perf/scripts/python
parent389e4dea54e2303059dff4eacd36188d4b6fe6c3 (diff)
staging: comedi: ni_atmio16d.c: remove pointless condition
The issue was discovered with static analysis and has two instances in this file. The code looks like this if (x < 65536000) { ... } else if (x < 655360000) { ... } else if (x <= 0xffffffff /* 6553600000 */) { ... } else if (x <= 0xffffffff /* 65536000000 */) { ... } The meaning of this block is to select appropriate clock frequency for interval timer basing on "x", which is amount of time. Notes: 1. That last condition matches previous one - that's the issue. 2. Decimal numbers in comments don't match hex numbers in expressions. But in first case the numbers have same order, while in the second case the hex number is the same, and the decimal one is 10 times bigger. 3. Actually type of "x" is "unsigned int", so its exact upper limit is not obviously known. 4. There's no "else" block. So it makes sense to make an "else" block from last "else if" case. The code inside the block seems correct for such usage. [ Actually, get rid of the final "else if" case and change the next-to-last "else if" case to an "else" as the upper limit of "x" _is_ known to be 0xffffffff (UINT_MAX), which is less than 6553600000 -- Ian ] Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79871 Reported-by: David Binderman <[email protected]> Signed-off-by: Andrey Utkin <[email protected]> Signed-off-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions