Re: [PATCH] m68k: Fix kernel_clone_args.flags in m68k_clone()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sat, 10 Aug 2024, Geert Uytterhoeven wrote:

        /* regs will be equal to current_pt_regs() */
        struct kernel_clone_args args = {
-               .flags          = regs->d1 & ~CSIGNAL,
+               .flags          = (lower_32_bits(regs->d1) & ~CSIGNAL),

While other architectures (nios2, sparc, generic code) do use
lower_32_bits() in similar code[*], IMHO this is misleading here, as
regs->d1 is never 64-bit.  What you really want is to avoid the sign
extension in the promotion from signed 32-bit to unsigned 64-bit.
So I think a cast to u32 makes more sense?


Yes, I think your solution is better.




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux