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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdWieP=Tk=Qgii=6mrpZNd5Mp4epSGufs5QD26tLg4joMA@mail.gmail.com>
Date: Mon, 11 Aug 2025 10:55:04 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: kernel test robot <lkp@...el.com>, axboe@...nel.dk, akpm@...ux-foundation.org, 
	ming.lei@...hat.com, dlemoal@...nel.org, jack@...e.cz, 
	oe-kbuild-all@...ts.linux.dev, linux-block@...r.kernel.org, 
	linux-kernel@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com, 
	johnny.chenyi@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v3 1/2] lib/sbitmap: convert shallow_depth from one word
 to the whole sbitmap

Hi Kuai,

On Thu, 7 Aug 2025 at 23:37, Yu Kuai <yukuai1@...weicloud.com> wrote:
> 在 2025/08/06 17:41, kernel test robot 写道:
> > All error/warnings (new ones prefixed by >>):
> >
> >     In file included from ./arch/sparc/include/generated/asm/div64.h:1,
> >                      from include/linux/math.h:6,
> >                      from include/linux/kernel.h:27,
> >                      from include/linux/cpumask.h:11,
> >                      from arch/sparc/include/asm/smp_32.h:15,
> >                      from arch/sparc/include/asm/smp.h:7,
> >                      from arch/sparc/include/asm/switch_to_32.h:5,
> >                      from arch/sparc/include/asm/switch_to.h:7,
> >                      from arch/sparc/include/asm/ptrace.h:120,
> >                      from arch/sparc/include/asm/thread_info_32.h:19,
> >                      from arch/sparc/include/asm/thread_info.h:7,
> >                      from include/linux/thread_info.h:60,
> >                      from arch/sparc/include/asm/current.h:15,
> >                      from include/linux/sched.h:12,
> >                      from lib/sbitmap.c:7:
> >     lib/sbitmap.c: In function '__map_depth_with_shallow':
> >     include/asm-generic/div64.h:183:35: warning: comparison of distinct pointer types lacks a cast
> >       183 |         (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
> >           |                                   ^~
> >     lib/sbitmap.c:222:20: note: in expansion of macro 'do_div'
> >       222 |         reminder = do_div(shallow_word_depth, sb->depth);
> >           |                    ^~~~~~
>
> /* The unnecessary pointer compare is there
>   * to check for type safety (n must be 64bit)
>   */
> # define do_div(n,base) ({
>
> I didn't notice that under specific arch, do_div() will require the fist
> paramater to be 64bit.

do_div() is strictly meant for a 64-by-32 div/mod operation.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ