Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4951746ybi; Tue, 30 Jul 2019 11:03:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiF1OzXg98nRfJ/DUeMrF6dgx+jwZJyEoYt3PoiOOLLMXWOhZbInM6Ho+Zs6MYCIE5rSWd X-Received: by 2002:a17:902:8d97:: with SMTP id v23mr113465563plo.157.1564509796577; Tue, 30 Jul 2019 11:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564509796; cv=none; d=google.com; s=arc-20160816; b=ydHHRBwnG71xSulC5sPb2uHtQBfZ5dSWx62t1DEVpnTCDfOlOvYrvlkmuzO5wAb+dq 7zsp3Q0rEzjD3X9t5uFyuniwhp7Q8cWAEmsC38K2rYmO3MzvHcGvvJCgYdqLNfvhptQO WJ0c5xmhVlp8Mv2dqBEzV2rfpPFTcr2AoXJWlxpys/hVwjbw06quIzFyiDcjNZcNsFOx OFWwZvmkPbYVwCUPOnHEJTgkN14vc5pABxZ7E0w1nTXEoNIrTMsmUg8MDw8jCjTvZJUv BHfUZbY9IbLxiLuO1+9NZdvKxSj4olThhNIghJxKeJfzbBPfSzVOWdn7xH1Mx6xaEsDG v+Sw== 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=7Bm8TrbVGw472rHZ96Q2MRXayJlnL67ZSjInVLj2+c0=; b=YsF6jJuLpUY7ClJBkHXVTOJlIwBVyo46ZHkfOiH+Pk104qTsQvRffrpGS8se0JD5gZ g8KUZtnaZT1scV1mJSPmFSANd4LTGj+gDuwgGOPckI1MSxc5LwD7H/S+coeS9ILoQ56N 00+TmIFjHFPo+0W78GyXh8F4mZ+j/3cUH85Zelwq8B7pCyeogyJmZsEXYRu9+3O/Ub6R lesptBFV+q6TZyA8plLmJeCyQxfSopI21zxXwJYmvIWu8zMQ9YFIUxvRCcEfpAo37/4B vDvaHbA5/o+tobcaNMlg1DJt98DcHw7skbHtCADLUXFLNwnaoi7BmbnJc9wZFIf5dWSi b2Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jnDSm1kT; 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 h3si30853325pld.32.2019.07.30.11.02.52; Tue, 30 Jul 2019 11:03:16 -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=jnDSm1kT; 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 S1731960AbfG3PU0 (ORCPT + 99 others); Tue, 30 Jul 2019 11:20:26 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41825 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729727AbfG3PU0 (ORCPT ); Tue, 30 Jul 2019 11:20:26 -0400 Received: by mail-lj1-f194.google.com with SMTP id d24so62465298ljg.8 for ; Tue, 30 Jul 2019 08:20:24 -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=7Bm8TrbVGw472rHZ96Q2MRXayJlnL67ZSjInVLj2+c0=; b=jnDSm1kThBj9/KTO+yzj/l4jRVeijOOMciJDemA7qx5oWy2BpzWea2X6F5jthNRmCw hfSr2Qo5grf2ao4WI/Rv/6+JTx8Lp2t8YQx1HHN4CC4S9uuRVtlR2o7K9LcnXvuZEkSw ec1Ra6Ri4dsy/dQyYDxBu/SQQy1IvuJ5YSJ3iiW0rRp2izDyYu/4SYd/rAXB1yQcv7ct KV1w1w6hnwy/LLNozmJxpZK29XuUCZbPtjkCgyfhrcrZfvjz4pREBM71j9UO/xGx0rzO dZBHBS0BHiPTLjCzdPBdV3ZJfizcSx3il5IcKCZLDwkvQXjY19CQe0JDNTqtdDwr3wUo wkFw== 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=7Bm8TrbVGw472rHZ96Q2MRXayJlnL67ZSjInVLj2+c0=; b=tEd3VRVgqExeE5us7hcMBz95ScQtSPxma9fED6NBbYB/O2Y+h+HyjU94xqZr6Th5vg Ww4JRgASXHB+Bl3VGupKtQsnw+qwXQ3GgEiS9eOONGZqxV7Oo+rQ3TuwKOPpup+7TaJc KeUymzpxYA4fQZZsm6IDknUYvYCCoxzTg4pGMQn2Qc/lNd67pShUAF/xiv3KZob2o2J3 djHngNNMHL934tmPTfn2pSDuiJh23mj4Hn6hLHumeMISdVOnw0NhNmoC8BRzXWnuFesB H8VURwCTWQ59pspd1C/NM6+n9lav4iovtaApzNcdQFpm03fO46ldUhP9qWCRPTaCnXmb 9w3A== X-Gm-Message-State: APjAAAWeoMmRRSUgiqqHx0q8EKkwjjG0g1CWVeT+Jid7PmYeHY2zn/fY esTj0n7i11A3n8s47xQRzrlmhA== X-Received: by 2002:a2e:65ca:: with SMTP id e71mr1547102ljf.61.1564500024139; Tue, 30 Jul 2019 08:20:24 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id q17sm11266522lfn.71.2019.07.30.08.20.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 08:20:23 -0700 (PDT) From: Anders Roxell To: will@kernel.org, joro@8bytes.org Cc: linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, robin.murphy@arm.com, Anders Roxell Subject: [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through Date: Tue, 30 Jul 2019 17:20:11 +0200 Message-Id: <20190730152012.2615-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that -Wimplicit-fallthrough is passed to GCC by default, the following warning shows up: ../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’: ../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (disable_bypass) ^ ../drivers/iommu/arm-smmu-v3.c:1191:3: note: here default: ^~~~~~~ Rework so that the compiler doesn't warn about fall-through. Make it clearer by calling 'BUG_ON()' when disable_bypass is set, and always 'break;' Signed-off-by: Anders Roxell --- drivers/iommu/arm-smmu-v3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index a9a9fabd3968..c5c93e48b4db 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1186,8 +1186,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid, ste_live = true; break; case STRTAB_STE_0_CFG_ABORT: - if (disable_bypass) - break; + BUG_ON(!disable_bypass); + break; default: BUG(); /* STE corruption */ } -- 2.20.1