linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Joe Perches <joe@perches.com>
Cc: <ath6kl-devel@qca.qualcomm.com>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] ath6kl: print firmware capabilities
Date: Tue, 5 Mar 2013 20:19:38 +0200	[thread overview]
Message-ID: <871ubtemkl.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1362506794.1759.2.camel@joe-AO722> (Joe Perches's message of "Tue, 5 Mar 2013 10:06:34 -0800")

Joe Perches <joe@perches.com> writes:

> On Tue, 2013-03-05 at 18:38 +0200, Kalle Valo wrote:
>> Printin the  firmware capabilities during the first firmware boot makes it easier to find out what
>> features firmware supports.
> []
>> diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
> []
>> +static void ath6kl_init_fw_capas(struct ath6kl *ar, char *buf, size_t buf_len)
>> +{
> []
>> +		if (buf_len - len < 4) {
>> +			ath6kl_warn("firmware capability buffer too small!\n");
>> +			strncpy(buf, "<error>", buf_len);
>
> 4 is an odd size to use.

I have to admit that I was lazy here. I think "< 2" (or "== 1") would be
the correct value to use but I didn't check that and just used 4 to be
on the safe side :)

> It seems weird to overwrite the known bits.

I did that just to make sure that the truncation won't be missed.

> why not just add ...?

You mean to the end of buffer? Like "first,second,th..."? Looks good,
I'll do that.

-- 
Kalle Valo

  reply	other threads:[~2013-03-05 18:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 16:38 [PATCH] ath6kl: print firmware capabilities Kalle Valo
2013-03-05 18:06 ` Joe Perches
2013-03-05 18:19   ` Kalle Valo [this message]
2013-03-05 18:31 ` Marcel Holtmann
2013-03-05 18:35   ` Kalle Valo
  -- strict thread matches above, loose matches on Subject: below --
2013-03-06  6:56 Kalle Valo
2013-03-18 11:34 ` Kalle Valo

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=871ubtemkl.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath6kl-devel@qca.qualcomm.com \
    --cc=joe@perches.com \
    --cc=linux-wireless@vger.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).