# git rev-parse -q --verify 0f1a7b3fac0583083ca19d4de47403511ced3521^{commit} 0f1a7b3fac0583083ca19d4de47403511ced3521 already have revision, skipping fetch # git checkout -q -f -B kisskb 0f1a7b3fac0583083ca19d4de47403511ced3521 # git clean -qxdf # < git log -1 # commit 0f1a7b3fac0583083ca19d4de47403511ced3521 # Author: Linus Torvalds # Date: Wed Oct 2 16:16:07 2019 -0700 # # timer-of: don't use conditional expression with mixed 'void' types # # Randy Dunlap reports on the sparse list that sparse warns about this # expression: # # of_irq->percpu ? free_percpu_irq(of_irq->irq, clkevt) : # free_irq(of_irq->irq, clkevt); # # and honestly, sparse is correct to warn. The return type of # free_percpu_irq() is 'void', while free_irq() returns a 'const void *' # that is the devname argument passed in to the request_irq(). # # You can't mix a void type with a non-void types in a conditional # expression according to the C standard. It so happens that gcc seems to # accept it - and the resulting type of the expression is void - but # there's really no reason for the kernel to have this kind of # non-standard expression with no real upside. # # The natural way to write that expression is with an if-statement: # # if (of_irq->percpu) # free_percpu_irq(of_irq->irq, clkevt); # else # free_irq(of_irq->irq, clkevt); # # which is more legible anyway. # # I'm not sure why that timer-of code seems to have this odd pattern. It # does the same at allocation time, but at least there the types match, # and it makes sense as an expression. # # Reported-by: Randy Dunlap # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld --version # < git log --format=%s --max-count=1 0f1a7b3fac0583083ca19d4de47403511ced3521 # < make -s -j 8 ARCH=arm64 O=/kisskb/build/linus_arm64-allnoconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- allnoconfig # make -s -j 8 ARCH=arm64 O=/kisskb/build/linus_arm64-allnoconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- Completed OK # rm -rf /kisskb/build/linus_arm64-allnoconfig_arm64-gcc8 # Build took: 0:00:42.581514