Joel Stanley <j...@jms.id.au> writes: > On Tue, 4 Aug 2020 at 00:57, Oliver O'Halloran <ooh...@gmail.com> wrote: >> >> When building with W=1 we get the following warning: >> >> arch/powerpc/platforms/powernv/smp.c: In function ‘pnv_smp_cpu_kill_self’: >> arch/powerpc/platforms/powernv/smp.c:276:16: error: suggest braces around >> empty body in an ‘if’ statement [-Werror=empty-body] >> 276 | cpu, srr1); >> | ^ >> cc1: all warnings being treated as errors >> >> The full context is this block: >> >> if (srr1 && !generic_check_cpu_restart(cpu)) >> DBG("CPU%d Unexpected exit while offline srr1=%lx!\n", >> cpu, srr1); >> >> When building with DEBUG undefined DBG() expands to nothing and GCC emits >> the warning due to the lack of braces around an empty statement. >> >> Signed-off-by: Oliver O'Halloran <ooh...@gmail.com> >> --- >> We could add the braces too. That might even be better since it's a >> multi-line >> if block even though it's only a single statement. > > Or you could put it all on one line, now that our 120 line overlords > have taken over.
Yeah I think that one may as well be one line. > Reviewed-by: Joel Stanley <j...@jms.id.au> > > Messy: > > $ git grep "define DBG(" arch/powerpc/ |grep -v print > arch/powerpc/kernel/crash_dump.c:#define DBG(fmt...) > arch/powerpc/kernel/iommu.c:#define DBG(...) > arch/powerpc/kernel/legacy_serial.c:#define DBG(fmt...) do { } while(0) > arch/powerpc/kernel/prom.c:#define DBG(fmt...) .. Yeah, gross old cruft. The vast majority of those should just be replaced with pr_devel() and/or pr_debug(). The pnv_smp_cpu_kill_self() case is one where we probably do want to stick with udbg_printf(), because I don't think it's kosher to call printk() from an offline CPU. cheers