From: Kalle Valo <kvalo@codeaurora.org>
To: Ramon Fried <rfried@codeaurora.org>
Cc: k.eugene.e@gmail.com, wcn36xx@lists.infradead.org,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] wcn36xx: reduce verbosity of drivers messages
Date: Tue, 27 Feb 2018 15:43:45 +0200 [thread overview]
Message-ID: <87sh9msg32.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20180227133149.26805-1-rfried@codeaurora.org> (Ramon Fried's message of "Tue, 27 Feb 2018 15:31:49 +0200")
Ramon Fried <rfried@codeaurora.org> writes:
> Whenever the WLAN interface is started the FW
> version and caps are printed.
> The caps now will be displayed only in debug mode.
> Firmware version will be displayed only once on first
> startup of the interface.
>
> Signed-off-by: Ramon Fried <rfried@codeaurora.org>
> ---
> v2: print the firwmare version as info but only
> onetime.
[...]
> static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len)
> {
> + static bool first = true;
> struct wcn36xx_hal_mac_start_rsp_msg *rsp;
>
> if (len < sizeof(*rsp))
> @@ -409,15 +410,17 @@ static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len)
> wcn->fw_minor = rsp->start_rsp_params.version.minor;
> wcn->fw_major = rsp->start_rsp_params.version.major;
>
> - wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
> - wcn->wlan_version, wcn->crm_version);
> -
> - wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
> - wcn->fw_major, wcn->fw_minor,
> - wcn->fw_version, wcn->fw_revision,
> - rsp->start_rsp_params.stations,
> - rsp->start_rsp_params.bssids);
> + if (first) {
> + first = false;
static variables are evil if you have more than one device on the same
host. Sure, I guess all current hardware only have one wcn36xx device
per hardware but still we should not endorse this bad practise. A much
better approach is to add a new field to struct wcn36xx.
--
Kalle Valo
prev parent reply other threads:[~2018-02-27 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 13:31 [PATCH v2] wcn36xx: reduce verbosity of drivers messages Ramon Fried
2018-02-27 13:43 ` 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=87sh9msg32.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=k.eugene.e@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=rfried@codeaurora.org \
--cc=wcn36xx@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.