mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
synced 2025-11-07 19:54:57 +10:00
Left-shifting past the size of your datatype is undefined behaviour in C. The literal 34 gets the type `int`, and that one is not big enough to be left shifted by 26 bits. An `unsigned` is long enough (on any machine that has at least 32 bits for their ints.) For uniformity, we mark all the literals as unsigned. But it's only really needed for HUGETLB_FLAG_ENCODE_16GB. Thanks to Randy Dunlap for an initial review and suggestion. Link: https://lkml.kernel.org/r/20220905031904.150925-1-matthias.goergens@gmail.com Signed-off-by: Matthias Goergens <matthias.goergens@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
||
|---|---|---|
| .. | ||
| auxvec.h | ||
| bitsperlong.h | ||
| bpf_perf_event.h | ||
| errno-base.h | ||
| errno.h | ||
| fcntl.h | ||
| hugetlb_encode.h | ||
| int-l64.h | ||
| int-ll64.h | ||
| ioctl.h | ||
| ioctls.h | ||
| ipcbuf.h | ||
| Kbuild | ||
| kvm_para.h | ||
| mman-common.h | ||
| mman.h | ||
| msgbuf.h | ||
| param.h | ||
| poll.h | ||
| posix_types.h | ||
| resource.h | ||
| sembuf.h | ||
| setup.h | ||
| shmbuf.h | ||
| siginfo.h | ||
| signal-defs.h | ||
| signal.h | ||
| socket.h | ||
| sockios.h | ||
| stat.h | ||
| statfs.h | ||
| swab.h | ||
| termbits-common.h | ||
| termbits.h | ||
| termios.h | ||
| types.h | ||
| ucontext.h | ||
| unistd.h | ||