lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c9f3e69b-1868-0a1f-e5f8-85db7bebfb4d@molgen.mpg.de>
Date:   Fri, 3 Jul 2020 15:52:42 +0200
From:   Paul Menzel <pmenzel@...gen.mpg.de>
To:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Christian König <christian.koenig@....com>
Cc:     Alex Deucher <alexander.deucher@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        amd-gfx@...ts.freedesktop.org
Subject: Re: [PATCH 1/2] moduleparams: Add hex type parameter

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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ