From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753243AbdBAQ4D (ORCPT ); Wed, 1 Feb 2017 11:56:03 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:57833 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753032AbdBAQ4B (ORCPT ); Wed, 1 Feb 2017 11:56:01 -0500 From: Arnd Bergmann To: Philipp Reisner , Lars Ellenberg Cc: drbd-dev@lists.linbit.com, Arnd Bergmann , Nicolas Dichtel , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH] drbd: avoid clang warning about pointless switch statement Date: Wed, 1 Feb 2017 17:55:02 +0100 Message-Id: <20170201165532.2605534-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:91vx8UvDl8qLu8jKH8ArcId2ChOUZy8aCjiu8F/8fRjMeDbfDLi CApVINgN3Ay97Lb/YhskcaOWMuZMkaeeBhS8n63VEfV4LlujscGduRuTzYB+kUfN0LUH3qI kmCpQuGKQmrjbUOn4aBGR3c1H4aXLJEYjYiRdXotpkzxtlTDyINXVfEteHbTYzGdtLQ9ahT QGsPrv+v/PjvFLxryA50w== X-UI-Out-Filterresults: notjunk:1;V01:K0:y8N/tlo9qqM=:C7WaGwN6LFJcaAjYcsp7Zy CVb7DI3SjDehWXmmEfRLOsAAqpEASe+2q9tOnkyAbM6mHj9T1u8aZWPXos3sH8Bx0w8sgfAvC HMmYGo7qeUp5IctF4mDAN4ofdTkEH7vNx2Tg5og3UlEaeYbtfaW7LvY5mVTLoCejz+FmXth+8 8Lu/q7r5MMzA/twv9zJPqKA1wamJZ8JjgcAitVfqPBMbZ9pgByAbKcQZpyiZ1DiUWYrIpLk3G S2elPU7H04Zk/xZoo6mTpS8IxDn2zlS2cjb6KaKKpl8kpVxLGr4UR8qUwnUglYI767cU3y421 XnjuY9F7CSuzRYtVR93esazs9bJ99f050IjaDEA3h+ApYHKJ+kFqplv22ioLz5wTloZmiTeVW n4YIjjzlkGEtVNLjYa09sN37QGji9Zp45Dg1Q7L3Xpxmzpkk2kfPlhqT1G1pPeED2MW7bzjC6 p21a6RpXTrLcv5UiVHd6eT/rJKdCr2AfL6HQMjcxu5FwTHQxQch53x8/ZEYCS4o8pOgJ6yhuy 7U8feUF8MWPZPOU3mexpBeI+N7UPJmz++YAkpu1bbpr6Svmf9FLqs994tyfkiAtzMCy/R3ko1 B+3Ak+4t5XPW/EtooZtXg3oVU18YTzMUgKKE/ccV03Lrve0SGCP6rhtaEi+d1/LOTBbTJNmR1 I6pqVQ/gLL9wJC8YPNjeJG2cUZkPx7ctbm+ifNGXE7M9zU/PaApEXyrbUEj2+2mnTO6g= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 6270a56e5edc..c6fbafb834f1 100644 --- a/include/linux/genl_magic_struct.h +++ b/include/linux/genl_magic_struct.h @@ -190,6 +190,7 @@ static inline void ct_assert_unique_operations(void) { switch (0) { #include GENL_MAGIC_INCLUDE_FILE + default: ; } } @@ -208,6 +209,7 @@ static inline void ct_assert_unique_top_level_attributes(void) { switch (0) { #include GENL_MAGIC_INCLUDE_FILE + default: ; } } @@ -218,6 +220,7 @@ static inline void ct_assert_unique_ ## s_name ## _attributes(void) \ { \ switch (0) { \ s_fields \ + default: \ ; \ } \ } -- 2.9.0