From: Pavel Roskin <proski@gnu.org>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org
Subject: Re: [RFC][PATCH] b43: correctly display longer chipsets ids
Date: Mon, 18 Jul 2011 12:58:23 -0400 [thread overview]
Message-ID: <4E24662F.2020705@gnu.org> (raw)
In-Reply-To: <1310860329-6855-1-git-send-email-zajec5@gmail.com>
On 07/16/2011 07:52 PM, Rafał Miłecki wrote:
> Some of the newer Broadcom chipsets have longe names like BCM43224,
> BCM43225, etc. However Broadcom decided to keep using u16 for storing
> them. Use %X or %d depending on chip_id value to avoid BCMA8D8, etc.
> ---
> Is there any nicer way of doing that? Currently I have whole string
> duplicated. Can we define part of the format using condition? Like
> (chip_id> 0x9999) ? "%d" : "%04X"
The standard way is snprintf(). The hacky way would be to convert
numbers over 0x9999 to the numbers that would display in hex as the
original numbers would show in decimal.
If we are only going to use those numbers in one place, I'd use
snprintf(). If there are chances that the number would be used in many
places, perhaps having the hex id representation would be justified.
--
Regards,
Pavel Roskin
prev parent reply other threads:[~2011-07-18 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-16 23:52 [RFC][PATCH] b43: correctly display longer chipsets ids Rafał Miłecki
2011-07-18 16:58 ` Pavel Roskin [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=4E24662F.2020705@gnu.org \
--to=proski@gnu.org \
--cc=b43-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=zajec5@gmail.com \
/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).