[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8dfff600-5d72-c74f-cb7f-1b3e5b4d7dcc@bmw-carit.de>
Date: Thu, 8 Sep 2016 14:44:29 +0200
From: Daniel Wagner <daniel.wagner@...-carit.de>
To: "Luis R. Rodriguez" <mcgrof@...nel.org>,
Daniel Wagner <wagi@...om.org>
CC: <linux-kernel@...r.kernel.org>, Ming Lei <ming.lei@...onical.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v4 3/4] firmware: Drop bit ops in favor of simple state
machine
On 09/08/2016 03:45 AM, Luis R. Rodriguez wrote:
> On Wed, Sep 07, 2016 at 10:45:07AM +0200, Daniel Wagner wrote:
>> From: Daniel Wagner <daniel.wagner@...-carit.de>
>>
>> We track the state of the loading with bit ops. Since the state machine
>> has only a couple of states and there are only a few simple state
>> transition
>
> And they are all mutually exclusive ?
Yes, I'll updated the commit message
>
>> we can model this simplify.
>>
>> UNKNOWN -> LOADING -> DONE | ABORTED
>
> So why unsigned long ? Why not a u8?
No reason, only a leftover. Changed it to u8.
> return ret;
>> @@ -138,13 +140,11 @@ static int fw_status_wait_timeout(struct fw_status *fw_st, long timeout)
>> static void __fw_status_set(struct fw_status *fw_st,
>> unsigned long status)
>> {
>> - set_bit(status, &fw_st->status);
>> + WRITE_ONCE(fw_st->status, status);
>>
>> if (status == FW_STATUS_DONE ||
>> - status == FW_STATUS_ABORTED) {
>> - clear_bit(FW_STATUS_LOADING, &fw_st->status);
>> + status == FW_STATUS_ABORTED)
>> complete_all(&fw_st->completion);
>> - }
>> }
>>
>> #define fw_status_start(fw_st) \
>
> See if all the above were prefixed with fw_umh or something like it
> it would make this easier to read and tell this is all umh related.
Changed the prefix to fm_umh. Looks much better.
cheers,
daniel
Powered by blists - more mailing lists