From patchwork Tue Oct 2 17:14:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 148011 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5420419lji; Tue, 2 Oct 2018 10:20:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV63fkhGExGuhj0iu0YL5BOIjJp8sz0WoGkeblmKVUQ2yc7vqA+iITwkDUtOfQ4kX7hjXcqK/ X-Received: by 2002:a63:9d01:: with SMTP id i1-v6mr14792323pgd.98.1538500829982; Tue, 02 Oct 2018 10:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538500829; cv=none; d=google.com; s=arc-20160816; b=rOem2d2eQjf0kXFBNZ15N/bzmtUVB9fxXU+QvHGLf306UD5N8gwbANw4TPHHrBijzd hE4ieB2tR6i6fCo2+epyVnJtbmBmh6LyONu/dTBaXfOWVRdJH0DOUtnLHAA16gYmb4yB 7hmJOM/E1uD9bbM89IgyzeLg+e6WHxPNjHb+8spiWpGKY3L5Tf5erSAmFDaBChdyWiaa qyyp32FlyffjKsviVSi9uVTN8/vSLjzTxdWoLspD0hEOIq5AYWJP1NlHXdoML/NZQvRZ jntIunaSnre4eb8E/erVgX1351LUed9UL9jQyDGoQrA11ueX9Vx5v3js0aBFpy7kvsLe l/aA== 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=UEX6dGxZs5jBMbrm6UyBsjP37qpkhDhyVt/DYXLWISk=; b=e7QnJ32QcGUBzST1aNTx1rNIXBo3/F5rRhRXQfkAJJtmITX6lEs0PJiOvXMH8c7WNZ 1Bwn28YINXgNNki+chDMyQVzYdlh3PVVtsFWCWsn+TvoX+b2Ur9E+xE42l04jsShD6hX KDqozf/tEiAiqPPzbaMLwQ+X1AYItXkwfPgqrO4cONji8/Xok4Af9CklLz8rcMAdfNpN 6El8PPDFon+J0zcOHH7bbuULhti9od3G5HJ0tvKbJQoHZmUpWbU4pSOIDZOqHzshaXeK PYF4bFMj2Bx/6skbGcnlNvXFKvXw6tP7HKmtL0bxi5BoWctOaFMc5yvwuAWyd53F8Q0m QyXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="fZCqx2/F"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64-v6si17139416plb.262.2018.10.02.10.20.29; Tue, 02 Oct 2018 10:20: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=@gmail.com header.s=20161025 header.b="fZCqx2/F"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728413AbeJCAEw (ORCPT + 32 others); Tue, 2 Oct 2018 20:04:52 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53055 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726679AbeJCAEv (ORCPT ); Tue, 2 Oct 2018 20:04:51 -0400 Received: by mail-wm1-f66.google.com with SMTP id 189-v6so3070684wmw.2; Tue, 02 Oct 2018 10:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UEX6dGxZs5jBMbrm6UyBsjP37qpkhDhyVt/DYXLWISk=; b=fZCqx2/FAm6EYQkl7cU8cOGfog+Gukc7dX3d/5QeeumkFwNo1Ze2Z9bc9E6QJDdi/W FmZgJF8J08Eaf6Rnyq6Yk3etCBR4k21kvolzqWWe8OKkdfE0sJDqOE3AGw8hKTmjtDHg eP2TQTqvCJ2UMvNABig0MtC99jnK7SMFHzCvTUwewtabJjP+pj9xb0y6Jh413qYQQDLv KJc9gBvAbuzNvH1mLbP59PMOkLNBTXQDS3FOPR0WLlNZJr+PiZ1mZNVYGNdHtMVTzj7U OuRvQJIX/Po4glVyR5SUqwwlOZvBOPMe7sC2Qo/H5G49KBcp72XtUtEVpu8KcagvEvxg nDzw== 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=UEX6dGxZs5jBMbrm6UyBsjP37qpkhDhyVt/DYXLWISk=; b=XbQ+JqnlMdw4t5ZOcF4SyDLEnionizHXa5E08nDCoENP4OqcxzUfoK7UfzaCKdaQEo Yz/qnmwJFOYQApu1abB9i/EyxcAO7cR4pNmaCu5lyC25b/KQEmPdE2wBAsWsmPa9fTpK pVrNiYvnmgC2W22684vQ7PDk8wdSUd/gbmdRngWf/zntDE8lF6PR/ig7q+1Oq7ITw8AP txbr7cuDed2B8/mYCAk0iPQlLtyKKv0XqBH6kDkQuTSzXh5+u6KHpreizKJE+ViUavxb +XS39fDGOnYT0wJ1/XSbwciyWPxJLIiVtdyBzwzzHXQZv80Fsu7szT1EADulY1DCUo5E PhUg== X-Gm-Message-State: ABuFfogFJbJWo+pwtdvg29WF9i+p7oZHyk1fdzipohv2ma7S6N3w6JeY RnChrYnsbwHWY2MRMrfghzGNlLtyaRSagQ== X-Received: by 2002:a1c:a187:: with SMTP id k129-v6mr2650091wme.111.1538500822422; Tue, 02 Oct 2018 10:20:22 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id x186-v6sm28115019wmx.24.2018.10.02.10.20.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 10:20:21 -0700 (PDT) From: Nathan Chancellor To: Philipp Reisner , Lars Ellenberg , Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Nathan Chancellor Subject: [PATCH RESEND] drbd: avoid clang warning about pointless switch statement Date: Tue, 2 Oct 2018 10:14:48 -0700 Message-Id: <20181002171447.10765-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The drbd code causes warnings that we cannot easily disable when building with clang: In file included from drivers/block/drbd/drbd_debugfs.c:10: In file included from drivers/block/drbd/drbd_int.h:48: In file included from include/linux/drbd_genl_api.h:53: In file included from include/linux/genl_magic_struct.h:237: include/linux/drbd_genl.h:300:1: warning: no case matching constant switch condition '0' There is nothing wrong with the code, and adding 'default:' labels in the right place is enough to let clang shut up about the warning. Fixes: ec2c35ac1ea2 ("drbd: prepare the transition from connector to genetlink") Signed-off-by: Arnd Bergmann Signed-off-by: Nathan Chancellor --- This was recently resent by Philipp Klocke but the attribution on it was incorrect (had Arnd's signoff but no From: line) and linux-block wasn't cc'd, who presumably should take this patch since this file was introduced by commit ec2c35ac1ea2 ("drbd: prepare the transition from connector to genetlink"). If that is the case, perhaps these files should be added to the drbd MAINTAINERS entry since they were introduced by drbd and have been the only consumers since; I'd be happy to send a patch if others agree. It was acked by Lars on https://lore.kernel.org/patchwork/patch/756723/ so I don't know if this patch should carry Acked-by: Lars Ellenberg or not. I'll leave that up to the maintainer to decide. Thanks! Nathan include/linux/genl_magic_struct.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.19.0 diff --git a/include/linux/genl_magic_struct.h b/include/linux/genl_magic_struct.h index 5972e4969197..c11f42179c63 100644 --- a/include/linux/genl_magic_struct.h +++ b/include/linux/genl_magic_struct.h @@ -191,6 +191,7 @@ static inline void ct_assert_unique_operations(void) { switch (0) { #include GENL_MAGIC_INCLUDE_FILE + default: ; } } @@ -209,6 +210,7 @@ static inline void ct_assert_unique_top_level_attributes(void) { switch (0) { #include GENL_MAGIC_INCLUDE_FILE + default: ; } } @@ -219,6 +221,7 @@ static inline void ct_assert_unique_ ## s_name ## _attributes(void) \ { \ switch (0) { \ s_fields \ + default: \ ; \ } \ }