# git rev-parse -q --verify dc1c8034e31b14a2e5e212104ec508aec44ce1b9^{commit} dc1c8034e31b14a2e5e212104ec508aec44ce1b9 already have revision, skipping fetch # git checkout -q -f -B kisskb dc1c8034e31b14a2e5e212104ec508aec44ce1b9 # git clean -qxdf # < git log -1 # commit dc1c8034e31b14a2e5e212104ec508aec44ce1b9 # Author: Linus Torvalds # Date: Sun Jul 28 20:24:12 2024 -0700 # # minmax: simplify min()/max()/clamp() implementation # # Now that we no longer have any C constant expression contexts (ie array # size declarations or static initializers) that use min() or max(), we # can simpify the implementation by not having to worry about the result # staying as a C constant expression. # # So now we can unconditionally just use temporary variables of the right # type, and get rid of the excessive expansion that used to come from the # use of # # __builtin_choose_expr(__is_constexpr(...), .. # # to pick the specialized code for constant expressions. # # Another expansion simplification is to pass the temporary variables (in # addition to the original expression) to our __types_ok() macro. That # may superficially look like it complicates the macro, but when we only # want the type of the expression, expanding the temporary variable names # is much simpler and smaller than expanding the potentially complicated # original expression. # # As a result, on my machine, doing a # # $ time make drivers/staging/media/atomisp/pci/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.i # # goes from # # real 0m16.621s # user 0m15.360s # sys 0m1.221s # # to # # real 0m2.532s # user 0m2.091s # sys 0m0.452s # # because the token expansion goes down dramatically. # # In particular, the longest line expansion (which was line 71 of that # 'ia_css_ynr.host.c' file) shrinks from 23,338kB (yes, 23MB for one # single line) to "just" 1,444kB (now "only" 1.4MB). # # And yes, that line is still the line from hell, because it's doing # multiple levels of "min()/max()" expansion thanks to some of them being # hidden inside the uDIGIT_FITTING() macro. # # Lorenzo has a nice cleanup patch that makes that driver use inline # functions instead of macros for sDIGIT_FITTING() and uDIGIT_FITTING(), # which will fix that line once and for all, but the 16-fold reduction in # this case does show why we need to simplify these helpers. # # Cc: David Laight # Cc: Lorenzo Stoakes # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 dc1c8034e31b14a2e5e212104ec508aec44ce1b9 # make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 allyesconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_KCOV=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=n # Added to kconfig CONFIG_GCC_PLUGIN_SANCOV=n # Added to kconfig CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n # Added to kconfig CONFIG_GCC_PLUGIN_STRUCTLEAK=n # Added to kconfig CONFIG_GCC_PLUGIN_RANDSTRUCT=n # Added to kconfig CONFIG_UML_NET=n # Added to kconfig CONFIG_UML_NET_ETHERTAP=n # Added to kconfig CONFIG_UML_NET_TUNTAP=n # Added to kconfig CONFIG_UML_NET_SLIP=n # Added to kconfig CONFIG_UML_NET_DAEMON=n # Added to kconfig CONFIG_UML_NET_VDE=n # Added to kconfig CONFIG_UML_NET_MCAST=n # Added to kconfig CONFIG_UML_NET_PCAP=n # Added to kconfig CONFIG_UML_NET_SLIRP=n # Added to kconfig CONFIG_GCOV_KERNEL=n # Added to kconfig CONFIG_DEBUG_INFO_BTF=n # Added to kconfig CONFIG_BPF_PRELOAD=n # Added to kconfig CONFIG_SPI_STM32_QSPI=n # < make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 help # make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 olddefconfig .config:14987:warning: override: reassigning to symbol GCC_PLUGIN_LATENT_ENTROPY .config:14991:warning: override: reassigning to symbol UML_NET_ETHERTAP .config:14993:warning: override: reassigning to symbol UML_NET_SLIP .config:14998:warning: override: reassigning to symbol UML_NET_SLIRP # make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 /kisskb/src/lib/iomap.c:156:5: error: no previous prototype for ‘ioread64_lo_hi’ [-Werror=missing-prototypes] 156 | u64 ioread64_lo_hi(const void __iomem *addr) | ^~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:163:5: error: no previous prototype for ‘ioread64_hi_lo’ [-Werror=missing-prototypes] 163 | u64 ioread64_hi_lo(const void __iomem *addr) | ^~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:170:5: error: no previous prototype for ‘ioread64be_lo_hi’ [-Werror=missing-prototypes] 170 | u64 ioread64be_lo_hi(const void __iomem *addr) | ^~~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:178:5: error: no previous prototype for ‘ioread64be_hi_lo’ [-Werror=missing-prototypes] 178 | u64 ioread64be_hi_lo(const void __iomem *addr) | ^~~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:264:6: error: no previous prototype for ‘iowrite64_lo_hi’ [-Werror=missing-prototypes] 264 | void iowrite64_lo_hi(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:272:6: error: no previous prototype for ‘iowrite64_hi_lo’ [-Werror=missing-prototypes] 272 | void iowrite64_hi_lo(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:280:6: error: no previous prototype for ‘iowrite64be_lo_hi’ [-Werror=missing-prototypes] 280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:288:6: error: no previous prototype for ‘iowrite64be_hi_lo’ [-Werror=missing-prototypes] 288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:244: lib/iomap.o] Error 1 make[3]: *** [/kisskb/src/scripts/Makefile.build:485: lib] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/Makefile:1925: .] Error 2 make[1]: *** [/kisskb/src/Makefile:224: __sub-make] Error 2 make: *** [Makefile:224: __sub-make] Error 2 Command 'make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 ' returned non-zero exit status 2. # rm -rf /kisskb/build/linus_allyesconfig_um-x86_64-gcc12 # Build took: 0:19:40.653842