From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 07EED1A05A6 for ; Fri, 31 Jul 2015 16:37:25 +1000 (AEST) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CA20614031E for ; Fri, 31 Jul 2015 16:37:22 +1000 (AEST) Received: by pabkd10 with SMTP id kd10so35843950pab.2 for ; Thu, 30 Jul 2015 23:37:21 -0700 (PDT) From: Daniel Axtens To: linuxppc-dev@ozlabs.org Cc: mpe@ellerman.id.au, benh@kernel.crashing.org, mikey@neuling.org, imunsie@au.ibm.com, Daniel Axtens Subject: [PATCH] cxl: Fix ambiguous else warnings Date: Fri, 31 Jul 2015 16:35:08 +1000 Message-Id: <1438324508-30341-1-git-send-email-dja@axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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) ^ They're annoying. Fix them by inserting the braces. Signed-off-by: Daniel Axtens --- drivers/misc/cxl/irq.c | 5 +++-- drivers/misc/cxl/pci.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c index 121ec48f3ab4..c11e583a15a9 100644 --- a/drivers/misc/cxl/irq.c +++ b/drivers/misc/cxl/irq.c @@ -181,10 +181,11 @@ static irqreturn_t cxl_irq(int irq, void *data, struct cxl_irq_info *irq_info) static irqreturn_t fail_psl_irq(struct cxl_afu *afu, struct cxl_irq_info *irq_info) { - if (irq_info->dsisr & CXL_PSL_DSISR_TRANS) + if (irq_info->dsisr & CXL_PSL_DSISR_TRANS) { cxl_p2n_write(afu, CXL_PSL_TFC_An, CXL_PSL_TFC_An_AE); - else + } else { cxl_p2n_write(afu, CXL_PSL_TFC_An, CXL_PSL_TFC_An_A); + } return IRQ_HANDLED; } diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 6d2e538331b6..29c7e4eb309a 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c @@ -709,10 +709,11 @@ static int sanitise_afu_regs(struct cxl_afu *afu) reg = cxl_p2n_read(afu, CXL_PSL_DSISR_An); if (reg) { dev_warn(&afu->dev, "AFU had pending DSISR: %#.16llx\n", reg); - if (reg & CXL_PSL_DSISR_TRANS) + if (reg & CXL_PSL_DSISR_TRANS) { cxl_p2n_write(afu, CXL_PSL_TFC_An, CXL_PSL_TFC_An_AE); - else + } else { cxl_p2n_write(afu, CXL_PSL_TFC_An, CXL_PSL_TFC_An_A); + } } reg = cxl_p1n_read(afu, CXL_PSL_SERR_An); if (reg) { -- 2.1.4