ftrace: remove redundant test on nsigned
Subsystems (4)
PATCH 1/1 ftrace: remove redundant test on nsigned
Unsigned `cnt' cannot be less than 0.
---
Or should it be `if (!cnt || cnt > MAX)' and what should MAX be then?
kernel/trace/trace_events.c +1 -1
@@ -204,7 +204,7 @@ ftrace_event_write(struct file *file, const char __user *ubuf,char *buf;char ch; -if (!cnt || cnt <0 ) +if (!cnt)return 0 ; ret =tracing_update_buffers ();
PATCH 1/1 spufs: remove redundant test on unsigned
Unsigned `len' cannot be less than 0.
---
Or should it be `if (!buf || len > MAX)' and what should MAX be then?
arch/powerpc/platforms/cell/spufs/sputrace.c +1 -1
@@ -73,7 +73,7 @@ static ssize_t sputrace_read(struct file *file, char __user *buf, {int error =0 , cnt =0 ; -if (!buf || len <0 ) +if (!buf)return -EINVAL ;while (cnt < len) {
Re: [PATCH] spufs: remove redundant test on unsigned
Roel,
Quoted 3 lines
Unsigned `len' cannot be less than 0.
Signed-off-by Roel Kluin <[email protected]>
Thanks for the patch. However, we have a patch from Christoph Hellwig pending that will rework the sputrace code:
http://patchwork.ozlabs.org/patch/28641/
It's currently queued in benh's tree, should be up soon.
Cheers,
Jeremy
Quoted 2 lines · Roel Kluin
Unsigned `cnt' cannot be less than 0.
The patch is fine, but there's a typo in the title s/nsigned/unsigned
Quoted 4 lines
Signed-off-by Roel Kluin <[email protected]>---
Or should it be `if (!cnt || cnt > MAX)' and what should MAX be then?
No, note there is another check:
if (cnt > EVENT_BUF_SIZE) cnt = EVENT_BUF_SIZE;
Quoted 14 lines
kernel/trace/trace_events.c +1
-2@@ -204,7 +204,7 @@ ftrace_event_write(struct file *file, const char __user *ubuf,char *buf;char ch; -if (!cnt || cnt <0 ) +if (!cnt)return 0 ; ret =tracing_update_buffers (); --