From patchwork Fri Jul 26 11:27:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 11060815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0643813AC for ; Fri, 26 Jul 2019 11:28:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E968A28A75 for ; Fri, 26 Jul 2019 11:28:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBDEF28A8C; Fri, 26 Jul 2019 11:28:20 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 85DFA28A75 for ; Fri, 26 Jul 2019 11:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5IzGf51xnRAyo4wcQpW8KL0KqjquSS/cpJZyKtQhcns=; b=UvLpFeujyVSFB/ PP/Q2xuHC9WNYZXRm62Z9cbm8yrSDzD1+7ecn33GvPXHI9DNt7ngYajLy6tHbu9+cfQPZQk/oEYlf 8asagx48bl0xOhwX9PQPsAybLijOXMRaTYOZzCmtyToR66buEUwu+lQSoDH6j9Qd/U2PmMrD1pFsL AWuk436h4FlLn20wYlIwM4ONmWlowccPQZhk9sm9NeLEWvfySnv7frDqL7z3FPPD69Ln6qwJgfUV7 u8wq6KOH5Q6dKqRlSwhNPSqCBBhV+ykFFh0SP5aIKZoLSMyNTXggQqKubRPxJe6LzSRmFfdXdELM5 0lwVOhXoLj2JZg9FM7oA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hqyOY-0002K1-Vq; Fri, 26 Jul 2019 11:28:19 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hqyNi-0001fq-TA for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2019 11:27:28 +0000 Received: by mail-lj1-x244.google.com with SMTP id x25so51208318ljh.2 for ; Fri, 26 Jul 2019 04:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mD75t+URGZsK68zObcoQDgfEcM4EggmUqFsamz8uvA8=; b=v/lqe97aY/6DKYSisz+Bh2DOxmrmfqzDS78mI5csTH9jAkHOsQf3u/nQHsbpw6wuAR bMIIYx1fPDpnl3RkTb4wAx50nibsu3pMG3MYUzUX1qaqyy5QzU784Z/rxIp2Hs3i7Z2/ JGvxNlWagTD1QUHKl1n/cx6w1ei6w0SlS5IlDrMUXjfcqn0d9fhA+3gSJ33IQ4H6YSpW MDfW5F/MG4dpu8ozAK5L5RxmRx+lzrsoLICfH8V2EWH83o9rfP4uTHnxHp428YRXL0LL jP4u4B9D5If5HLU5D4h+FgCmFq4bEx7gwQ+OOIanHaMGdYIeCPvqox1hd4jukUHDmmG8 7wSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mD75t+URGZsK68zObcoQDgfEcM4EggmUqFsamz8uvA8=; b=NMaKW8U6QYSDwIi3ZqD5ZyHjerrwsjPLb3P3sFvmu0gndBSS5QuGjh8FPdoxqN3SOK U1KktZq4A2AB8n/r2JvZcekYu4xKcyj19cUU/4F9PKGFlPHmnI/o8kdzNNQrmOKyXx/e cCFRObUh91sxxTPhqzAYwM+zDQHukiMJFPwCm7OQlkXLpFOI2jype9hKXbaUWKdU42F+ vBY5oQxwvs1PVlX92mQMOlCDAqSkYEhr+QW1hLltDlU0SPWe7v3DFyHekL3MbVHVTtBx 5c4x/yGPsw/KOzIp9XzBke89X16Nr7YHt1j0CcUwE32A9vZaiOSeBjx5EXiADtw3TOqn FamQ== X-Gm-Message-State: APjAAAVCRLZgXmI6NkJYRRgQQWYw4Pa3UrFSz8qgKlgubGfHxYkfHnFA pxtWzA3sR72BHY0aFu1uHz5/X3KD+Zoh8w== X-Google-Smtp-Source: APXvYqy1Iy6b2yOwjFSIa/VBUa/31LvNZNgxAzQlPOq9T/Kdpd5y1geOUuOJ4C07BdR6g4ervbZ1PQ== X-Received: by 2002:a2e:8396:: with SMTP id x22mr50602259ljg.135.1564140445364; Fri, 26 Jul 2019 04:27:25 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id i9sm8365620lfl.10.2019.07.26.04.27.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 04:27:24 -0700 (PDT) From: Anders Roxell To: catalin.marinas@arm.com, will@kernel.org Subject: [PATCH 2/3] arm64: module: Mark expected switch fall-through Date: Fri, 26 Jul 2019 13:27:21 +0200 Message-Id: <20190726112721.19154-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190726_042727_137782_3AD848C2 X-CRM114-Status: UNSURE ( 7.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Anders Roxell , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 fall-through warnings was enabled by default the following warnings was starting to show up: ../arch/arm64/kernel/module.c: In function ‘apply_relocate_add’: ../arch/arm64/kernel/module.c:316:19: warning: this statement may fall through [-Wimplicit-fallthrough=] overflow_check = false; ~~~~~~~~~~~~~~~^~~~~~~ ../arch/arm64/kernel/module.c:317:3: note: here case R_AARCH64_MOVW_UABS_G0: ^~~~ ../arch/arm64/kernel/module.c:322:19: warning: this statement may fall through [-Wimplicit-fallthrough=] overflow_check = false; ~~~~~~~~~~~~~~~^~~~~~~ ../arch/arm64/kernel/module.c:323:3: note: here case R_AARCH64_MOVW_UABS_G1: ^~~~ Rework so that the compiler doesn't warn about fall-through. Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning") Signed-off-by: Anders Roxell --- arch/arm64/kernel/module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c index 46e643e30708..03ff15bffbb6 100644 --- a/arch/arm64/kernel/module.c +++ b/arch/arm64/kernel/module.c @@ -314,18 +314,21 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, /* MOVW instruction relocations. */ case R_AARCH64_MOVW_UABS_G0_NC: overflow_check = false; + /* Fall through */ case R_AARCH64_MOVW_UABS_G0: ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 0, AARCH64_INSN_IMM_MOVKZ); break; case R_AARCH64_MOVW_UABS_G1_NC: overflow_check = false; + /* Fall through */ case R_AARCH64_MOVW_UABS_G1: ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 16, AARCH64_INSN_IMM_MOVKZ); break; case R_AARCH64_MOVW_UABS_G2_NC: overflow_check = false; + /* Fall through */ case R_AARCH64_MOVW_UABS_G2: ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 32, AARCH64_INSN_IMM_MOVKZ); @@ -393,6 +396,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, break; case R_AARCH64_ADR_PREL_PG_HI21_NC: overflow_check = false; + /* Fall through */ case R_AARCH64_ADR_PREL_PG_HI21: ovf = reloc_insn_adrp(me, sechdrs, loc, val); if (ovf && ovf != -ERANGE)