From: Kalle Valo <kvalo@codeaurora.org>
To: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Andres Rodriguez <andresx7@gmail.com>,
linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
mcgrof@kernel.org, alexdeucher@gmail.com,
ckoenig.leichtzumerken@gmail.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 9/9] brcmfmac: use request_firmware_nowait2 to load firmware without warnings
Date: Mon, 23 Apr 2018 16:54:32 +0300 [thread overview]
Message-ID: <87k1sydo4n.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <5ADAF0A9.2090604@broadcom.com> (Arend van Spriel's message of "Sat, 21 Apr 2018 10:04:57 +0200")
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
prev parent reply other threads:[~2018-04-23 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180417153307.3693-1-andresx7@gmail.com>
[not found] ` <20180417153307.3693-9-andresx7@gmail.com>
2018-04-20 10:19 ` [PATCH 8/9] ath10k: use request_firmware_nowarn to load firmware Kalle Valo
[not found] ` <20180417153307.3693-10-andresx7@gmail.com>
2018-04-20 10:26 ` [PATCH 9/9] brcmfmac: use request_firmware_nowait2 to load firmware without warnings Kalle Valo
2018-04-20 19:33 ` Andres Rodriguez
2018-04-21 7:19 ` Kalle Valo
2018-04-21 8:04 ` Arend van Spriel
2018-04-23 13:54 ` Kalle Valo [this message]
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=87k1sydo4n.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=alexdeucher@gmail.com \
--cc=andresx7@gmail.com \
--cc=arend.vanspriel@broadcom.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@kernel.org \
/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).