linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: John Kacur <jkacur@redhat.com>
Cc: linux-rt-users@vger.kernel.org, Clark Williams <williams@redhat.com>
Subject: Re: [PATCH 3/3] rt-tests: Remove unused status variable
Date: Wed, 21 Mar 2012 07:45:24 -0700	[thread overview]
Message-ID: <4F69E984.4010608@linux.intel.com> (raw)
In-Reply-To: <CAONaPpE-C4W3v1hazzr-gw=4BRCEVuF+5crJCY1gi6N+syxZ_w@mail.gmail.com>



On 03/21/2012 06:35 AM, John Kacur wrote:
> On Tue, Mar 20, 2012 at 8:05 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>> The status variable is not used. Remove it and avoid the warning from gcc.
>>
>> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
>> CC: Clark Williams <williams@redhat.com>
>> 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.
> 

My view was that rather than test status, we are testing the cpu mask
explicitly. That should pick up any error.

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

  reply	other threads:[~2012-03-21 14:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 19:05 [PATCH 1/3] rt-tests: Support user supplied CFLAGS and LDFLAGS Darren Hart
2012-03-20 19:05 ` [PATCH 2/3] rt-tests: Silence unused-but-set warning in rt-migrate-test Darren Hart
2012-03-21 14:05   ` Steven Rostedt
2012-03-21 14:44     ` Darren Hart
2012-03-21 14:56       ` John Kacur
2012-03-21 16:18         ` Steven Rostedt
2012-03-21 16:36           ` Darren Hart
2012-03-21 16:41             ` John Kacur
2012-03-21 16:45               ` Darren Hart
2012-03-21 16:51               ` Steven Rostedt
2012-03-21 16:45             ` Steven Rostedt
2012-03-21 17:11           ` Steven Rostedt
2012-03-21 17:46             ` John Kacur
2012-03-20 19:05 ` [PATCH 3/3] rt-tests: Remove unused status variable Darren Hart
2012-03-21 13:35   ` John Kacur
2012-03-21 14:45     ` Darren Hart [this message]
2012-03-20 19:31 ` [PATCH 1/3] rt-tests: Support user supplied CFLAGS and LDFLAGS Remy Bohmer
2012-03-20 19:45   ` Darren Hart
2012-03-20 19:57     ` Remy Bohmer
2012-03-20 23:58 ` John Kacur
2012-03-21  0:10   ` Darren Hart
2012-03-21 19:10     ` Denys Dmytriyenko
2012-03-21 19:11       ` Darren Hart
2012-03-21 20:16         ` John Kacur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F69E984.4010608@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).