mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Patch v2] lib: test get_count_order/long in test_bitops.c
Date: Fri, 5 Jun 2020 23:06:10 +0000	[thread overview]
Message-ID: <20200605230610.bizp2j23ivyma5rn@master> (raw)
In-Reply-To: <CAMuHMdXnLUS8F4nWJBqDjoKhBmF2_ihfwe4jTGxuZ1e_WKRNPQ@mail.gmail.com>

On Thu, Jun 04, 2020 at 02:51:40PM +0200, Geert Uytterhoeven wrote:
>Hi Wei,
>
>On Thu, Jun 4, 2020 at 2:28 PM Wei Yang <richard.weiyang@gmail.com> wrote:
[...]
>>
>> You mean
>>
>>        {0x0000000000000003,  2},
>>        {0x0000000000000004,  2},
>>        {0x0000000000001fff, 13},
>>        {0x0000000000002000, 13},
>>        {0x0000000050000000, 31},
>>        {0x0000000080000000, 31},
>>        {0x0000000080003000, 32},
>
>Yes, those values.  And those should work with get_count_order_long()
>on both 32-bit and 64-bit.

Hi, Geert

To be frank, I am afraid I lack some of the skill to achieve this. Maybe you
could give some guide.

get_count_order_long() takes one parameter, which is of type unsigned long.
This one has different size on 32bit and 64bit platform. On 32bit platform,
those value would be truncated.

Would you mind giving me a hint on this?

What we may achieve is like the implementation of fls_long(). This one check
the size of unsigned long on running, and choose different function. We could
use ifdef to check the size of unsigned long and use different data to feed
get_count_order_long(). But I don't find a way to feed get_count_order_long()
with 64bit data on 32bit platform.

>
>Gr{oetje,eeting}s,
>
>                        Geert
>
>-- 
>Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
>In personal conversations with technical people, I call myself a hacker. But
>when I'm talking to journalists I just say "programmer" or something like that.
>                                -- Linus Torvalds

-- 
Wei Yang
Help you, Help me

  reply	other threads:[~2020-06-05 23:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 22:37 Wei Yang
2020-06-03  9:18 ` Andy Shevchenko
2020-06-03 13:29   ` Wei Yang
2020-06-04 11:50 ` Geert Uytterhoeven
2020-06-04 12:28   ` Wei Yang
2020-06-04 12:51     ` Geert Uytterhoeven
2020-06-05 23:06       ` Wei Yang [this message]
2020-06-06  0:16         ` Andrew Morton
2020-06-08 22:31           ` Wei Yang
2020-06-09  9:16             ` Andy Shevchenko
2020-06-09 23:02               ` Wei Yang
2020-06-10 10:17                 ` Andy Shevchenko
2020-06-10 22:06                   ` Wei Yang
2020-06-11  7:25                     ` Andy Shevchenko
2020-06-12 14:28                       ` Wei Yang

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=20200605230610.bizp2j23ivyma5rn@master \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®