From patchwork Fri Jul 26 11:28:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 169819 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp12909381ilk; Fri, 26 Jul 2019 04:28:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCJs+kXMxci6WSsxnKFbRaanxG8SOkKBAX0IO7VQpOMM4uzWWxAhxMvhCXy4FPy9GyjZQ2 X-Received: by 2002:a65:690e:: with SMTP id s14mr77871966pgq.47.1564140491887; Fri, 26 Jul 2019 04:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140491; cv=none; d=google.com; s=arc-20160816; b=lWYI7X3NDRxpv2DLJvFuRWXzpr5uN8XPVFWFjCILczaoauCoY9tQ2CDh4Uf/2G/dn2 18P8hdv3VSG8I5PHr6vaWPfMU50q/q43TXGzaZhfrADpDq71xLBpv5h/W/BP10yKEGBs Rgul5l7hqAQUkhDFOKs1N4ghlchT6ZxACFOpMRpmf+shDcovzyML4pjTFuV8xI270gqm 0N52us5sQb+TdBU4tl35RCZWtvbYs1xos0AipTLb/sHgIihBuXrvr+jifneDDbaIzVGT oQd2ygCNrKs3ZgnO3x9/hsuqEEZbV5IKNBMGsxlVix0b5bewxKjSEjk8w0uRvLJM46or h/yg== 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=RBXqC7DkQwKqkOuJceKqqWGtbn5TCwbm7RbUyvhZTFE=; b=NSjOeR7PhhIcO+0A2WYiYH4WtiNFT4Bql3i6Q+0ZEAdKyN2kQxpFhERNmniDA+D2Yo BYyfe0gEAqaTxBhOpdKNVXmmQDNxwPUDCvG32yXbkdIjLu5bHiFQyw0Ggpwr47OeIeq0 otq+hDiSzBTvD8hcpB4hyT8CIAjttQTzMMHNUnDF/RRUhxke8IAEALM+u/yx14syEbvL ggZjZGFHzRoti3x5F++XQdz4MQmyQDhv3WnH8OfJO3mazRtJQSUbnUczdnXDGrIKJnF7 dhbWClQSkoRyZkPw0ErXKfa1J0CfzD6lvDtJnc9yS2GwZRFRj8CRu/s816Sn7IsLBJQm Rmfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+2C7W+3; 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 d37si20468886plb.351.2019.07.26.04.28.11; Fri, 26 Jul 2019 04:28:11 -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=S+2C7W+3; 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 S1726973AbfGZL2K (ORCPT + 29 others); Fri, 26 Jul 2019 07:28:10 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46786 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726191AbfGZL2J (ORCPT ); Fri, 26 Jul 2019 07:28:09 -0400 Received: by mail-lf1-f66.google.com with SMTP id z15so32570268lfh.13 for ; Fri, 26 Jul 2019 04:28:07 -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=RBXqC7DkQwKqkOuJceKqqWGtbn5TCwbm7RbUyvhZTFE=; b=S+2C7W+37ohe6bGgtuXYTdXJGM8T5ohSQlHPAzmsrvk398LEdPoWhPV/m/nzghQI5v W/ynOWka+ROdXjq3wZx0SU5bXSkI8xsvR7m9JeSogoFZ9okwuGEnqPEjlGjROjHjGIva mB1VipwLDzpthrV0Oe/nYMqcKcnKgfaK0ocaFXs9wuRQrGEiGE8p5MAwmLKboL370EQ/ 7HsqDSPXh0uLWTzNzKXAhZdPAy50RxUyeN8iSN7WJUVHNXAAbGEFRYbwtye13r4H0RN6 d1O6oWzPXvPJVyEhSHBHvBtoWervTtRey3wpMXYA9PJrRYUAwaiQ/LmzqdeBN4YwXTPw dL3w== 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=RBXqC7DkQwKqkOuJceKqqWGtbn5TCwbm7RbUyvhZTFE=; b=VIQCyeJej6PkwI9x2jiPm50f00fUm9yCGaCuoJOWuRaVrsuE5CUhoJhaJXXTv1ukP2 J6vVJ2sSFSBYIyQ4Csgvf1kNWE6vyY3anSvbjnSBhoIUC1xfUUyBXia1z8Yh1fZhsw57 XpIW2mIDB8ixu5tAi/EZMXgW7HGdkGe48C6GHBGgLb+38IWx+mXNdT1R+vtZHqDG2jfI fCcNUVU2idPI8f2KrosE/Sln6oX1XnzrnX3Pi/Ea+NHyplOOJbPtMSqA3AizjQnWqJbW nktvOyFFDMO2HoYZMNK4+U1t2dz6PVSKKheid53A3wGy8Pt0m/WCCNPcQfxUPOS9W7aP 45SA== X-Gm-Message-State: APjAAAXZzr7WXvf9wXWoNnAv3HYQmYveg+CyzDWGah5Ts9oBXXKp2qZB HyqRbLgOJZxVKcukK2gVHq1zmaEtbBRVKQ== X-Received: by 2002:ac2:48a5:: with SMTP id u5mr45521185lfg.62.1564140487096; Fri, 26 Jul 2019 04:28:07 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id z25sm8306560lfi.51.2019.07.26.04.28.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 04:28:06 -0700 (PDT) From: Anders Roxell To: airlied@linux.ie, daniel@ffwll.ch, wens@csie.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH 1/2] drm: sun4i: sun6i_mipi_dsi: Mark expected switch fall-through Date: Fri, 26 Jul 2019 13:28:02 +0200 Message-Id: <20190726112802.19563-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 warning was starting to show up: ../drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c: In function ‘sun6i_dsi_transfer’:../drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:992:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (msg->rx_len == 1) { ^ ../drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:997:2: note: here default: ^~~~~~~ Rework so that the compiler doesn't warn about fall-through. Change the if-statement so that we can move out 'break;' one level. Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning") Signed-off-by: Anders Roxell --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 472f73985deb..40ed21e527f9 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -992,8 +992,10 @@ static ssize_t sun6i_dsi_transfer(struct mipi_dsi_host *host, case MIPI_DSI_DCS_READ: if (msg->rx_len == 1) { ret = sun6i_dsi_dcs_read(dsi, msg); - break; + } else { + ret = -EINVAL; } + break; default: ret = -EINVAL; From patchwork Fri Jul 26 11:27:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 169809 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp12908545ilk; Fri, 26 Jul 2019 04:27:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzT9wlHcUmTGCqhFmrrsmYXnJi35pKjGcmAyHL9MYwOoFlLzkQbltN8u4doCAKg+GdBQ7hn X-Received: by 2002:a65:448a:: with SMTP id l10mr65747928pgq.327.1564140440800; Fri, 26 Jul 2019 04:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140440; cv=none; d=google.com; s=arc-20160816; b=y3LOlGy301YoBTAqbsLtchHOoxyd1OidNQbEKexcGridfCxyCh944c2BmYqBWTqvku xHbxni6pEw8wZ7kYVYoen+sUfz3ZEHTLyCBuMmYPULgs/PfiVixv7Udr/51xu6Mc4HTG KzARLe5NyzFXb3SxxZEdf2owxRh7/ZYUb3qkRcGWct+5gKHE8nTHUChPokAxcafrkcm9 0XyPZcOoIR8o0dPuRC4wloCjUjA6Aw2DsC2leYFH6HlMvL/X8ulJeYAeY7DK5GcRO2EA 9euUhByRCjSclKh54f3Atsd6DdLXJOcl4HjlW+e8drIx11juVuXqxZsWdd8LHtY3ExbJ KGeg== 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=Z9HY70wJXKPs0Bv25UYCD9x0V9nBKcfnlqiIvTFUOZc=; b=teAkWei9vf4fti+tkuc+cYRTlo4bakiPZACkS2yb7gMtdw29eqsyIXaFHhUWJU1OYQ BDRc27nvavSTwUfveWyVHGS8snxhuT/ogFn61wZ27wtPYShzy4M4doPY9qDOdIuq578B PrM81FNDxzmXmSvt09n/zBoTdzAaHcTy1S2vBthZXJKZRVOsj57nJxvGfP0X38H8Dsrz veDJhdc4MQTfESeikfQgSiD9whYwMZXNgNI2wdt5tU5YDIlNc3j7+tDzS4pRwR3UueuV ZYBjC8rCncx2FbHu8SCOsfUA6uIE7lB0fyfvpEF8NFmXfeL7qi10tlAO8B9yW/3NlNCJ WxKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c91SAV8u; 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 v5si23744042pgs.285.2019.07.26.04.27.20; Fri, 26 Jul 2019 04:27:20 -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=c91SAV8u; 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 S1726862AbfGZL1T (ORCPT + 29 others); Fri, 26 Jul 2019 07:27:19 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:40482 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbfGZL1T (ORCPT ); Fri, 26 Jul 2019 07:27:19 -0400 Received: by mail-lf1-f68.google.com with SMTP id b17so36864385lff.7 for ; Fri, 26 Jul 2019 04:27:17 -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=Z9HY70wJXKPs0Bv25UYCD9x0V9nBKcfnlqiIvTFUOZc=; b=c91SAV8uhLOcljWjQ8Ab9ri7kVRPcfAovbVniOu6W3Y7+7Si7G3ZkkP7PwDPvbwwZO tXE9mCuBPj28+YfwZhE9ZBUX0mlLJ2ZhgHnb9RoKMsj9lqK6gzK9osC9DQ1o3CBtbldM THIcpaGSet5VHt7d07KdP9xi4rTQVkmqyt5Q4dRIphqGXVuJvxTFnVBLNL7Ln/5KT/79 KN/XJg9iOqLN/Ht9Lmb0TwwZ6uPeZjdsSlivfBcZSR5tO3redUCcob0WqfNxyx/iHSOh ZlUePfMRzln5doV68I92erwnugKUcHqGY/U+5iwOMomiq5Tco6Z3dJtXLTcJ/2JbF9ru d+Cg== 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=Z9HY70wJXKPs0Bv25UYCD9x0V9nBKcfnlqiIvTFUOZc=; b=WnxDWWfP2KyVqRVSTnjM74izqzXS19QU9PqEKZWyd14KiBvoBhQaGpZsGrQjSpKOtk OeHopQb1pSxjyx7D4UwmcbBaRcuFK4lQYN4oaxIHPSpKK1QIUton0IGNix1KNk1n6ge5 V6ycDw9dI9dOC7plsQUU7h3k/8myqP4F8PkyqtNrFXHOf35sCFuxIFMMzNRCldY4RwhA OkZWJvgWcYbGpwQLITyMw7OYsHtmfFm5mKHINnvhviWs5AQ2XEgqU/BSqr+WYPJIr0bd QPcO0BGFahNs5/tPGrScVqC0ZCdr9IJcWTtrYxlw2zUXp2yvHmySX8C8TINssC1WyEDe kPng== X-Gm-Message-State: APjAAAUWo0KSs9L3yItmfQw1tXwNoANgz9q7lGcoCJvjyWJPDny9YVyf ZWJiz0n4MJCHiN9CLHkU2a3cug== X-Received: by 2002:ac2:419a:: with SMTP id z26mr44458557lfh.21.1564140436505; Fri, 26 Jul 2019 04:27:16 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id j90sm9987780ljb.29.2019.07.26.04.27.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 04:27:15 -0700 (PDT) From: Anders Roxell To: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH 2/2] arm64: KVM: hyp: debug-sr: Mark expected switch fall-through Date: Fri, 26 Jul 2019 13:27:10 +0200 Message-Id: <20190726112710.19051-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/kvm/hyp/debug-sr.c: In function ‘__debug_save_state’: ../arch/arm64/kvm/hyp/debug-sr.c:20:19: warning: this statement may fall through [-Wimplicit-fallthrough=] case 15: ptr[15] = read_debug(reg, 15); \ ../arch/arm64/kvm/hyp/debug-sr.c:113:2: note: in expansion of macro ‘save_debug’ save_debug(dbg->dbg_bcr, dbgbcr, brps); ^~~~~~~~~~ ../arch/arm64/kvm/hyp/debug-sr.c:21:2: note: here case 14: ptr[14] = read_debug(reg, 14); \ ^~~~ ../arch/arm64/kvm/hyp/debug-sr.c:113:2: note: in expansion of macro ‘save_debug’ save_debug(dbg->dbg_bcr, dbgbcr, brps); ^~~~~~~~~~ ../arch/arm64/kvm/hyp/debug-sr.c:21:19: warning: this statement may fall through [-Wimplicit-fallthrough=] case 14: ptr[14] = read_debug(reg, 14); \ ../arch/arm64/kvm/hyp/debug-sr.c:113:2: note: in expansion of macro ‘save_debug’ save_debug(dbg->dbg_bcr, dbgbcr, brps); ^~~~~~~~~~ ../arch/arm64/kvm/hyp/debug-sr.c:22:2: note: here case 13: ptr[13] = read_debug(reg, 13); \ ^~~~ ../arch/arm64/kvm/hyp/debug-sr.c:113:2: note: in expansion of macro ‘save_debug’ save_debug(dbg->dbg_bcr, dbgbcr, brps); ^~~~~~~~~~ Rework to add a 'break;' where the compiler warned about fall-through. Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning") Signed-off-by: Anders Roxell --- arch/arm64/kvm/hyp/debug-sr.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) -- 2.20.1 diff --git a/arch/arm64/kvm/hyp/debug-sr.c b/arch/arm64/kvm/hyp/debug-sr.c index 26781da3ad3e..0fc9872a1467 100644 --- a/arch/arm64/kvm/hyp/debug-sr.c +++ b/arch/arm64/kvm/hyp/debug-sr.c @@ -18,40 +18,70 @@ #define save_debug(ptr,reg,nr) \ switch (nr) { \ case 15: ptr[15] = read_debug(reg, 15); \ + /* Fall through */ \ case 14: ptr[14] = read_debug(reg, 14); \ + /* Fall through */ \ case 13: ptr[13] = read_debug(reg, 13); \ + /* Fall through */ \ case 12: ptr[12] = read_debug(reg, 12); \ + /* Fall through */ \ case 11: ptr[11] = read_debug(reg, 11); \ + /* Fall through */ \ case 10: ptr[10] = read_debug(reg, 10); \ + /* Fall through */ \ case 9: ptr[9] = read_debug(reg, 9); \ + /* Fall through */ \ case 8: ptr[8] = read_debug(reg, 8); \ + /* Fall through */ \ case 7: ptr[7] = read_debug(reg, 7); \ + /* Fall through */ \ case 6: ptr[6] = read_debug(reg, 6); \ + /* Fall through */ \ case 5: ptr[5] = read_debug(reg, 5); \ + /* Fall through */ \ case 4: ptr[4] = read_debug(reg, 4); \ + /* Fall through */ \ case 3: ptr[3] = read_debug(reg, 3); \ + /* Fall through */ \ case 2: ptr[2] = read_debug(reg, 2); \ + /* Fall through */ \ case 1: ptr[1] = read_debug(reg, 1); \ + /* Fall through */ \ default: ptr[0] = read_debug(reg, 0); \ } #define restore_debug(ptr,reg,nr) \ switch (nr) { \ case 15: write_debug(ptr[15], reg, 15); \ + /* Fall through */ \ case 14: write_debug(ptr[14], reg, 14); \ + /* Fall through */ \ case 13: write_debug(ptr[13], reg, 13); \ + /* Fall through */ \ case 12: write_debug(ptr[12], reg, 12); \ + /* Fall through */ \ case 11: write_debug(ptr[11], reg, 11); \ + /* Fall through */ \ case 10: write_debug(ptr[10], reg, 10); \ + /* Fall through */ \ case 9: write_debug(ptr[9], reg, 9); \ + /* Fall through */ \ case 8: write_debug(ptr[8], reg, 8); \ + /* Fall through */ \ case 7: write_debug(ptr[7], reg, 7); \ + /* Fall through */ \ case 6: write_debug(ptr[6], reg, 6); \ + /* Fall through */ \ case 5: write_debug(ptr[5], reg, 5); \ + /* Fall through */ \ case 4: write_debug(ptr[4], reg, 4); \ + /* Fall through */ \ case 3: write_debug(ptr[3], reg, 3); \ + /* Fall through */ \ case 2: write_debug(ptr[2], reg, 2); \ + /* Fall through */ \ case 1: write_debug(ptr[1], reg, 1); \ + /* Fall through */ \ default: write_debug(ptr[0], reg, 0); \ }