From patchwork Tue Jul 30 15:20:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 11065991 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 5BEE31399 for ; Tue, 30 Jul 2019 15:20:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B2352879C for ; Tue, 30 Jul 2019 15:20:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F8832880F; Tue, 30 Jul 2019 15:20:30 +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 8A51E2879C for ; Tue, 30 Jul 2019 15:20:29 +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=b24qhe/348P+NU5Q6Dy8aGdJVd81kzmdnERalTzZCfY=; b=ItXeqR82Yo6hUa O9N/mAxu+pL+sHgHyBCgZYh+bzQ8Ms3pZdLPqWGJTih7dzuyA2WmNTxR+lKtVZfnnYITbsEIB7a/V D21kq/txbacQ6FEOOKz85E/lU5I28xizZIvGk7x77cKGU/G3wCu9oguYahDWfIvvUcdPqcC9SgcZH fn9h3ZavDVIY7mvCrL3i7e6dYX044bIcNeAzD5ANF/hZAKNX3TpX2snRQ2mCCS00bsT/E6t3sSagn Iv948mNyHuDSfemMdweSbghJX0VWf5va0cyrhRFoMA5gE+UoeNrst8T6nBweINHVj1UTWqvJn1jy4 vKztJyFEYZKCb7nk1JMQ==; 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 1hsTvR-00079Z-6Q; Tue, 30 Jul 2019 15:20:29 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hsTvO-00079A-1m for linux-arm-kernel@lists.infradead.org; Tue, 30 Jul 2019 15:20:27 +0000 Received: by mail-lj1-x241.google.com with SMTP id z28so8232996ljn.4 for ; Tue, 30 Jul 2019 08:20:25 -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=jEwt5rf267S+GprUOarU7d1yv7KIXjnrnpfFAvQvnb/7RbUGHrdIrLKc/Yigo+bkti y2u3IGSrPF9fRCUkXAm0pmiGGUW9y5mdRaUfO1Oirvi+wlqHg/+K8oR9vQ8kNM+1+AWy EcwQgzycz6LW4Ltf684O9SvZ+6KwubREM273DjluOqxY8hPV9brTXfaROMQmaw93Ll4g FnyO2AQGhEFVsNOR2foCinwNb/RoyTcRhValYqH6PXiyKhRHCCDoZbAva8L2U2B22MIz aSYYzeZ1//QtDDVB3jVq95vaeqzISBU8zdG5vhJ6arjFif2vj6MSmCy/4otjU1yChyg7 SoMg== X-Gm-Message-State: APjAAAVb3x3X8AhF/4AVqOhry1ukBES4Hk0p+MnM4RRDYOW3J01h5Ex2 O6fbcYjAmRwoeQ4tMpcor9rkoQ== X-Google-Smtp-Source: APXvYqw8cNQwIuVo3MyhmOP8pwoiYmj+MEq273fNs7PYTrH2vLKbLF+Kndi+zZObbX2ZtiI8cgVutg== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190730_082026_117058_FAA7BE55 X-CRM114-Status: GOOD ( 10.64 ) 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: Anders Roxell , iommu@lists.linux-foundation.org, robin.murphy@arm.com, 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 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 Acked-by: Will Deacon --- 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 */ }