qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 5/6] fdc_test: update media_change test


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v6 5/6] fdc_test: update media_change test
Date: Mon, 25 Jun 2012 10:49:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Am 24.06.2012 08:16, schrieb Blue Swirl:
> On Fri, Jun 22, 2012 at 10:33 AM, Pavel Hrdina <address@hidden> wrote:
>> After rewrite DSKCHG bit handling the test has to be updated. Now
>> is needed to seek to different track to clear DSKCHG bit.
>>
>> Signed-off-by: Pavel Hrdina <address@hidden>
>> ---
>>  tests/fdc-test.c |   29 +++++++++++++++++++++--------
>>  1 files changed, 21 insertions(+), 8 deletions(-)
>>
>> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
>> index 610e2f1..5280eff 100644
>> --- a/tests/fdc-test.c
>> +++ b/tests/fdc-test.c
>> @@ -156,19 +156,20 @@ static uint8_t send_read_command(void)
>>     return ret;
>>  }
>>
>> -static void send_step_pulse(void)
>> +static void send_step_pulse(bool chg_cyl)
>>  {
>>     int drive = 0;
>>     int head = 0;
>> -    static int cyl = 0;
>> +    int cyl = 0;
>> +
>> +    if (chg_cyl)
>> +        cyl = (cyl + 1) % 4;
> 
> Missing braces, please use checkpatch.pl to avoid these issues.
> 
> % 4 could be turned into & 3, maybe with a separate patch.

I wouldn't do that. It's not something like a mask for a bitfield, but
just a way to let counting start from the beginning after a while. If
you have two way to express the same, choose the one that expresses the
clearest what the real intention is. The compiler will optimise it (not
that this optimisation in a test case like this really mattered...)

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]