Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1577371 > unrolled thread
| Started by | Mars Cheng <mars.cheng@mediatek.com> |
|---|---|
| First post | 2017-02-09 09:40 +0100 |
| Last post | 2017-02-09 11:20 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] perf/core: remove useless cast when comparing Mars Cheng <mars.cheng@mediatek.com> - 2017-02-09 09:40 +0100
Re: [PATCH] perf/core: remove useless cast when comparing Peter Zijlstra <peterz@infradead.org> - 2017-02-09 11:20 +0100
| From | Mars Cheng <mars.cheng@mediatek.com> |
|---|---|
| Date | 2017-02-09 09:40 +0100 |
| Subject | [PATCH] perf/core: remove useless cast when comparing |
| Message-ID | <t8SqJ-3R5-9@gated-at.bofh.it> |
since nr_cpu_ids and cpu are both int, remove the casting
Signed-off-by: Mars Cheng <mars.cheng@mediatek.com>
---
kernel/events/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index ab15509..3482342 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9085,7 +9085,7 @@ static void account_event(struct perf_event *event)
struct hw_perf_event *hwc;
long err = -EINVAL;
- if ((unsigned)cpu >= nr_cpu_ids) {
+ if (cpu >= nr_cpu_ids) {
if (!task || cpu != -1)
return ERR_PTR(-EINVAL);
}
--
1.7.9.5
[toc] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2017-02-09 11:20 +0100 |
| Message-ID | <t8TZv-4SY-7@gated-at.bofh.it> |
| In reply to | #1577371 |
On Thu, Feb 09, 2017 at 04:25:46PM +0800, Mars Cheng wrote: > since nr_cpu_ids and cpu are both int, remove the casting Please as to learn C before playing. Consider negative numbers.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web