From: Paul Menzel <pmenzel@molgen.mpg.de>
To: "Linus Torvalds" <torvalds@linux-foundation.org>,
"Christian König" <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] moduleparams: Add hex type parameter
Date: Fri, 3 Jul 2020 15:52:42 +0200 [thread overview]
Message-ID: <c9f3e69b-1868-0a1f-e5f8-85db7bebfb4d@molgen.mpg.de> (raw)
In-Reply-To: <CAHk-=wimBucBdC+tzFEuFJU5X1UFTVWo+AHMvQTSkCcVnTT-ww@mail.gmail.com>
Dear Linus, dear Christian,
Am 02.07.20 um 21:42 schrieb Linus Torvalds:
> On Thu, Jul 2, 2020 at 7:42 AM Christian König <christian.koenig@amd.com> wrote:
>>
>> I'm just not sure how well this is received upstream because it only
>> covers u32
>>
>> On the other hand that is probably also the most used.
>
> Not necessarily true. I'd argue that "unsigned long" is equally
> possible for some bit mask (or other hex-likely) type.
>
> So don't call it just "hex". Call it "hexint" (the hex does imply
> "unsigned", I feel - showing hex numbers with a sign sounds insane).
>
> That way, if somebody ends up wanting it for unsigned long values,
> we're not stuck.
Good idea. Don.e
> Another option is to just say that hex values always have bit _sizes_.
> So "hex32" and "hex64" would also make sense as names to me.
I went for int to be consistent in the naming, and kstrtouint is used in
the macro.
> While at it, should the hex numbers always be padded out to the size?
> The example Paul used doesn't have that issue (high bit being set).
>
> Bbut often it may make sense to show a 32-bit hex number as "%#08x"
> because it really makes things clearer when you're looking at high
> bits, say.
>
> It's really hard to tell the difference between "just bit 27 set" and
> "just bit 31" set otherwise, and that's not all that uncommon when the
> bitmasks are sparse.
Also good idea. Done.
I just sent out the v2.
Kind regards,
Paul
prev parent reply other threads:[~2020-07-03 13:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 14:01 [PATCH 1/2] moduleparams: Add hex type parameter Paul Menzel
2020-07-02 14:01 ` [PATCH 2/2] drm/amdgpu: Change type of module param `ppfeaturemask` to hex Paul Menzel
2020-07-02 14:42 ` [PATCH 1/2] moduleparams: Add hex type parameter Christian König
2020-07-02 19:42 ` Linus Torvalds
2020-07-03 13:52 ` Paul Menzel [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=c9f3e69b-1868-0a1f-e5f8-85db7bebfb4d@molgen.mpg.de \
--to=pmenzel@molgen.mpg.de \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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).