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] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 09 Mar 2019 23:19:49 +0300
From:   Andrey Abramov <st5pub@...dex.ru>
To:     "lkml@....org" <lkml@....org>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>
Cc:     "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "daniel.wagner@...mens.com" <daniel.wagner@...mens.com>,
        "dchinner@...hat.com" <dchinner@...hat.com>,
        "don.mullis@...il.com" <don.mullis@...il.com>,
        "geert@...ux-m68k.org" <geert@...ux-m68k.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux@...musvillemoes.dk" <linux@...musvillemoes.dk>
Subject: Re: [PATCH 1/5] lib/sort: Make swap functions more generic

> Although I'm thinking of:
>
> static bool __attribute_const__
> is_aligned(const void *base, size_t size, unsigned char align)
> {
> unsigned char lsbits = (unsigned char)size;
>
> (void)base;
> #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
> lsbits |= (unsigned char)(uintptr_t)base;
> #endif
> return (lsbits & (align - 1)) == 0;
> }
>
> Any preference?
I think it would be better.

> I find "u32s" confusing; I keep reading the "s" as "signed" rather than a plural. How about one of: swap_bytes / swap_ints / swap_longs swap_1 / swap_4 / swap_8
In my opinion "swap_bytes / swap_ints / swap_longs" are the most readable.

(Good job)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ