Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1613302imm; Tue, 2 Oct 2018 10:59:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV61oT/CBGPpMXcnAbz3nSV+f1bWyD5pvL8Ae2ND9hInyFIjB/c3luRVUonp88ZhF6O1Viklf X-Received: by 2002:a62:808c:: with SMTP id j134-v6mr17319643pfd.47.1538503198718; Tue, 02 Oct 2018 10:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538503198; cv=none; d=google.com; s=arc-20160816; b=A9j0ISEk2EeaiFR7cvWSug1XhqylxvmUGsR+qXfPOFcvUhFn2mYRMSYefxClUl0LYc LNh9pnLfYwGyh+bL2fKpuY6fQIaRSg9ZWL2EMvNh9QwugdQ23e+8YeslZoZxju7pKpnv 47v0jsbymM39GBcIxC2tTBhcwScfMNIC0ogQwQemRbECwzU4Hj1sliLS3wDtij0lZqVa mL41qmreWskEky5bz0B5+KM5rKJTj/Ry0lfobl9Yf7fYzrtLIrM+m82BV5r5pMg3Xe8I 6sL8JNN43IKaxKFpvmwr1q+OE7X+PxZpCQjmk1zuh4fjslRvIxgjmTY9gYWLSMtLVAy/ j70A== 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 u12-v6si3365190pfd.66.2018.10.02.10.59.43; Tue, 02 Oct 2018 10:59:58 -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 S1727957AbeJCAEw (ORCPT + 99 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 Content-Transfer-Encoding: 8bit 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(+) 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: \ ; \ } \ } -- 2.19.0