Re: Typecasting a void pointer to unsigned long in zsmalloc.c

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

 



On Thu, Jan 23, 2025 at 05:58:10PM +0000, Alex Hogen wrote:
> >> Shouldn't there be a special type for doing this type of conversion?
> 
> > That type is "unsigned long" :)
> 
> Wouldn't "uintptr_t" be a more explicit type for storing pointer addresses as integers? It seems to me it has the advantage of expressing intent better for us human readers. See <linux/types.h>. Yes, it is currently defined as an "unsigned long."

"unitptr_t" came years, if not decades, after the policy of "a pointer
fits into an unsigned long" was the rule (i.e. from the very first
release of Linux.

And those crazy _t types are for userspace code, don't use them in the
kernel, there's no need.

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux