From patchwork Tue Feb 7 01:01:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9559001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CA23602B1 for ; Tue, 7 Feb 2017 01:02:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 582752074F for ; Tue, 7 Feb 2017 01:02:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BD8E269DA; Tue, 7 Feb 2017 01:02:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D63422074F for ; Tue, 7 Feb 2017 01:02:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cauAb-0002ub-DQ; Tue, 07 Feb 2017 01:02:09 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cauAX-0002rk-JA for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2017 01:02:07 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0409A6085E; Tue, 7 Feb 2017 01:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1486429305; bh=50zFpkQUHoSTj2vbJ/jo9cpO3XGUaQp0FB6P+eHDDtg=; h=From:To:Cc:Subject:Date:From; b=o5OupS+/nMAPyumZEMgFNfWcMzEjRNLn4jhdPVspS16h/tQLp2brxcOaM38zaBecS 1J6PdA1fQul694fejpDt3wYHeiBoMimudL2roT/DPwozOMBGT6l3ipGVEckPFhvGEo iOZzZ0YtU3M+L/r5xbWsWFWVOL2RBFJEnFMuGOAc= Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5AFE1607F1; Tue, 7 Feb 2017 01:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1486429304; bh=50zFpkQUHoSTj2vbJ/jo9cpO3XGUaQp0FB6P+eHDDtg=; h=From:To:Cc:Subject:Date:From; b=m5S0iGl5H/vqmHAVMedP8QwkGHzvLHbH0UZRcoS1EAuYMM3A8mhvICYg8ZXmx701/ Tfr4MfmdLnHXQPbnyMekSo3ElZUptzBGpnxJ9mOq0CvoldIHF/yNxrJo6oQFzAis6x /2/3XYl0pQG/8Xl41m4W6/0+Q8jbOrIyJoMK5P4Y= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5AFE1607F1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org From: Stephen Boyd To: Will Deacon , Catalin Marinas Subject: [RFC/PATCH] arm64: Rename macro arguments to silence sparse Date: Mon, 6 Feb 2017 17:01:43 -0800 Message-Id: <20170207010143.22371-1-sboyd@codeaurora.org> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170206_170205_714329_AFC0EAEB X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sparse@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When I compile files with sparse, I get these sorts of warnings: arch/arm64/include/asm/lse.h:14:28: warning: Unknown escape 'l' arch/arm64/include/asm/lse.h:14:37: warning: Unknown escape 'l' arch/arm64/include/asm/alternative.h:172:28: warning: Unknown escape 'o' This is because sparse is trying to tokenize these files and sees a line like this: alternative_insn "\llsc", "\lse", ARM64_HAS_LSE_ATOMICS It gets past alternative_insn part and then sees the start of a string with the double quote character. So sparse starts to parse the string (eat_string() in the sparse code) but the string has an escape character '\' in it. Sparse sees the escape character, so it checks to see if it's an escape sequence, but '\l' isn't. This causes sparse to spit out this warning of an unknown escape sequence 'l'. In reality, sparse isn't going to use these macros anyway because this whole thing is inside an __ASSEMBLER__ ifdef. One hacky solution is to make sparse think it actually is an escape sequence by starting the macro arguments with the 'n' character. Then sparse will see a \n inside a string, which keeps it silent and the assembler doesn't seem to mind either. Cc: Signed-off-by: Stephen Boyd --- arch/arm64/include/asm/alternative.h | 4 ++-- arch/arm64/include/asm/lse.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h index 6e1cb8c5af4d..dd393db554c8 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h @@ -168,8 +168,8 @@ alternative_endif #define _ALTERNATIVE_CFG(insn1, insn2, cap, cfg, ...) \ alternative_insn insn1, insn2, cap, IS_ENABLED(cfg) -.macro user_alt, label, oldinstr, newinstr, cond -9999: alternative_insn "\oldinstr", "\newinstr", \cond +.macro user_alt, label, noldinstr, newinstr, cond +9999: alternative_insn "\noldinstr", "\newinstr", \cond _ASM_EXTABLE 9999b, \label .endm diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h index fc756e22c84c..36206d75943d 100644 --- a/arch/arm64/include/asm/lse.h +++ b/arch/arm64/include/asm/lse.h @@ -10,8 +10,8 @@ .arch_extension lse -.macro alt_lse, llsc, lse - alternative_insn "\llsc", "\lse", ARM64_HAS_LSE_ATOMICS +.macro alt_lse, nllsc, nlse + alternative_insn "\nllsc", "\nlse", ARM64_HAS_LSE_ATOMICS .endm #else /* __ASSEMBLER__ */