lkml.org 
[lkml]   [2018]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 9/9] brcmfmac: use request_firmware_nowait2 to load firmware without warnings
Date
Arend van Spriel <arend.vanspriel@broadcom.com> writes:

> On 4/20/2018 12:26 PM, Kalle Valo wrote:
>> Andres Rodriguez <andresx7@gmail.com> writes:
>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
>>> index 091b52979e03..26db3ebd52dc 100644
>>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
>>> @@ -503,8 +503,9 @@ static void brcmf_fw_request_code_done(const struct firmware *fw, void *ctx)
>>> goto done;
>>>
>>> fwctx->code = fw;
>>> - ret = request_firmware_nowait(THIS_MODULE, true, fwctx->nvram_name,
>>> - fwctx->dev, GFP_KERNEL, fwctx,
>>> + ret = request_firmware_nowait(THIS_MODULE, true, false,
>>
>> A perfect example why enums should be in function calls instead of
>> booleans, that "true, false" tells nothing to me and it would be time
>> consuming to check from headers files what it means. If you had proper
>> enums, for example "FIRMWARE_MODE_FOO, FIRMWARE_STATE_BAR", it would be
>> immediately obvious for the reader what the parameters are. Of course
>> the first boolean was already there before, but maybe change the new
>> boolean to an enum?
>
> I can not fully agree here. While being a bit more descriptive even
> with enums wrong enum values can be used due to copy-paste errors for
> instance.

Well, you can also copy paste booleans wrong. I would claim that it's
even easier to copy paste booleans wrong than enums.

> Also when reviewing code, sometime looking up function prototypes and
> type definitions are part of the fun. Tools like ctags or elixir
> website make it pretty easy.

Hehe :) But when reviewing patches ctags doesn't really help. But yeah,
booleans vs enums in function parameters is just a matter of taste. I
prefer enums but I'm sure there are people who prefer booleans.

--
Kalle Valo

\
 
 \ /
  Last update: 2018-04-23 15:55    [W:3.727 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site