Thread (24 messages) flat view 24 messages, 5 authors, 2012-03-21

Re: [PATCH 3/3] rt-tests: Remove unused status variable

From: John Kacur <jkacur@redhat.com>
Date: 2012-03-21 13:35:59

On Tue, Mar 20, 2012 at 8:05 PM, Darren Hart [off-list ref] wrote:
quoted hunk ↗ jump to hunk
The status variable is not used. Remove it and avoid the warning from gcc.

Signed-off-by: Darren Hart <redacted>
CC: Clark Williams <redacted>
CC: John Kacur <jkacur@redhat.com>
---
 src/pi_tests/pi_stress.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index 0940567..b89dec8 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -596,10 +596,9 @@ void *reporter(void *arg)
 int verify_cpu(int cpu)
 {
-       int status;
       cpu_set_t mask;

-       status = sched_getaffinity(0, sizeof(cpu_set_t), &mask);
+       sched_getaffinity(0, sizeof(cpu_set_t), &mask);

       if (CPU_ISSET(cpu, &mask))
               return SUCCESS;
--
Don't you think it would be smarter to test the return status of
sched_getaffinity, than to shut-up the warning by removing the status
variable? I say we leave the variable in to remind us that we're not
finished.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help