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: 169811 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp12908664ilk; Fri, 26 Jul 2019 04:27:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxa+dbouJTkmYhZQ31CkMMm+q3owo1iZ3X3vObiDSC9d+/WLZnsz/tGFxnEiBjdGJSSoaRs X-Received: by 2002:a17:902:a40c:: with SMTP id p12mr95804860plq.146.1564140449687; Fri, 26 Jul 2019 04:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140449; cv=none; d=google.com; s=arc-20160816; b=fPeURgNYgL8iWwh8JRpuSM/Q2KekgB2wfB25SJuM7QTY9G/jZBJCN1K9QjHVTHs5Mt S4i+Qj25rY0wKxTGMkDcyy8ZytDGU5HAIwO7ItPV7Ek1z9d8MDRx3GaWEUwmxXDZZbO0 jvnu2RM6xG80P+3fsYLoQE6p1MKcUug1UJKttlIHY1+vMAZiKgIASivWsdxvB/MEYFBn PN8Z87OWSAR6E84YNLmiNzWpDg325TmWaNpah0FkUxEow0NEzjW7CGZ88Lxq2ar7Ov56 IeIhVWUV7BNLWCQrLmjEU96o8nEzyaltQwrEY7utckHxrjBnoIpQqKQuxKAPli/htgnx phkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mD75t+URGZsK68zObcoQDgfEcM4EggmUqFsamz8uvA8=; b=p/WIEXL6+mCvt+uU5W0Fh3CaZTuKL7GOZLa4o3C5/k+IZpNcjcXOJ1LH4u/sUMxb5W K2u4U6gzk5zPEK/WZAKFE+DUp41TGnSpEkk/zmzhgLsCWCD9VO5prce7DmPf5DG2CNvn Udk9ItASwTpnKnm9Dl7PgBL8BOpbJtQZPHbaM3EwnqSGhlwABpV10bcj8+rN67o4aB2g aa/6M+x/DrfuWXPhWhV+nB8sH+hboP5oAVuwviRUhBtyge//zfuvMILgAKgsShvkY4e0 olyk5lPqPxZQPA/fz4nWnb7SU/oca2W3EhtAznl4PuoxaghEerHpcttsaLk9uo2ghQ6G Bwog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="v/lqe97a"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cp2si19854400plb.437.2019.07.26.04.27.29; Fri, 26 Jul 2019 04:27:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="v/lqe97a"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbfGZL12 (ORCPT + 29 others); Fri, 26 Jul 2019 07:27:28 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36077 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbfGZL11 (ORCPT ); Fri, 26 Jul 2019 07:27:27 -0400 Received: by mail-lj1-f193.google.com with SMTP id i21so51173692ljj.3 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=KVeRC5IUoccF31slE9DM1zi61GzzKR9UAMhnZZJQ/95ArDdEeka3w5wK7Jp4XJFJ3Q U37mLdOkyl7EG4SvVII8v0SCSrFc0fJT+sTi2UbB4h+w7Kfb6fljvJDs3L7/MajO3G9j K4xlyEBdu2b3ubsk/clyYWea0jriatw21C0kbBYP1w28Ax/e55AlA8mjUClelcIxGsiy BoQJAPdZfbsSsFFNOt91oY9WptCesWI4WRmjjF7lOAm5x10O00hrtxn+KGsMHjJwk8Cd vxNiQba8yV9ZTn/mLFIX+SNqpbvwWxg7AOoR6pcg0iY1n66LhGWwqOdJn9Fr+9eB+YjA lGfw== X-Gm-Message-State: APjAAAUfljdAJuRFaOy5tM2M+FGXu9B3GSz0tBQw66+iGutKrTVDcA5d 5MSiS9AsNK95htdS/YVaSbuyMg== 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 Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Anders Roxell 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.20.1 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)