[PATCH] cxl: Fix ambiguous else warnings

Andreas Schwab schwab at linux-m68k.org
Fri Jul 31 19:16:52 AEST 2015


Daniel Axtens <dja at axtens.net> writes:

> Every time I build cxl I see the following warnings:
>
> /scratch/dja/linux-capi/drivers/misc/cxl/pci.c: In function ‘sanitise_afu_regs’:
> /scratch/dja/linux-capi/drivers/misc/cxl/pci.c:712:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
>    if (reg & CXL_PSL_DSISR_TRANS)
>       ^
> /scratch/dja/linux-capi/drivers/misc/cxl/irq.c: In function ‘fail_psl_irq’:
> /scratch/dja/linux-capi/drivers/misc/cxl/irq.c:184:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
>   if (irq_info->dsisr & CXL_PSL_DSISR_TRANS)
>      ^

Why are they ambigous?  Why doesn't cxl_p2n_write(afu, CXL_PSL_TFC_An,
CXL_PSL_TFC_An_AE) expand to a proper statement?

#define cxl_p2n_write(afu, reg, val) \
	out_be64(_cxl_p2n_addr(afu, reg), val)

Andreas.

-- 
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


More information about the Linuxppc-dev mailing list