[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201903141153.x2EBrtKi000133@sdf.org>
Date: Thu, 14 Mar 2019 11:53:55 GMT
From: George Spelvin <lkml@....org>
To: geert@...ux-m68k.org, lkml@....org
Cc: 13@....org, akpm@...ux-foundation.org,
andriy.shevchenko@...ux.intel.com, daniel.wagner@...mens.com,
dchinner@...hat.com, don.mullis@...il.com,
linux-kernel@...r.kernel.org, linux@...musvillemoes.dk,
st5pub@...dex.ru
Subject: Re: [PATCH 1/5] lib/sort: Make swap functions more generic
On Thu, 14 Mar 2019 at 11:41:26 +0100, Geert Uytterhoeven wrote:
> On Thu, Mar 14, 2019 at 11:10 AM George Spelvin <lkml@....org> wrote:
>> On Sat, 09 Mar 2019 at 23:19:49 +0300, Andrey Abramov wrote:
>>>> How about one of:
>>>> swap_bytes / swap_ints / swap_longs
>>>> swap_1 / swap_4 / swap_8
>>>
>>> longs are ambiguous, so I would prefer bit-sized types.
>>
>> I already implemented Andrey's suggestions, which were the exact
>> opposite of yours.
>>
>> Pistols at dawn?
I didn't explain the joke because jokes aren't funny if explained,
but just in case, by suggesting a clearly ridiculous method, I was
saying "I have no idea how to resolve this conflict."
> Prepared to fix all future long vs. int bugs?
In the entire kernel? Or just the one small source file
where these statically scoped helper functions are visible?
In case of uncertainty, the comments and the code are right there
just a few lines away from the one and only call site, so I
don't expect much confusion.
I care a lot about function names when they are exported, but in
this case we're talking about what colour to paint the *inside* of
the bike shed.
I just want to pick some names and move on. Since nothing so far seems
satsify everyone, I'll go with the ponderous but utterly unambiguous:
swap_bytes
swap_4byte_words
swap_8byte_words
Powered by blists - more mailing lists