From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbdCNVVD (ORCPT ); Tue, 14 Mar 2017 17:21:03 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:58781 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbdCNVVC (ORCPT ); Tue, 14 Mar 2017 17:21:02 -0400 From: Arnd Bergmann To: Lars Ellenberg , "David S. Miller" , Nicolas Dichtel Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [RESEND PATCH] drbd: avoid clang warning about unmatched switch statement Date: Tue, 14 Mar 2017 22:20:18 +0100 Message-Id: <20170314212045.3557048-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:uG+0WNKkyeJda3UwzT+Ix89bD8bGbiKjq9JbEytv6lJZuN0WhQu +dwAl/4kBekh8JBVvdNQiFAxCLH6Dks3nYH2vxQb31TkG982juuQ0j8A07g/sFy4kpm1hTq NP6In3fxSIyMr31a7kA0wKHqitbHdxI0i65foNdYtzwFBNvzFEONxcBwh8J8MMhipPWpY3J 2yxczxAXKwxtcpNhwZEjQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:PRpARI/JAc0=:O/QIF9iM7KRTTs0VO/O3+Q fA9pa2GAsw8teK5MO/U6vvMbaKkHDa13QEow0s+7LyH3v0zLwGS5oYYPSNY1xcplyidDHMCzt N2uKuZl7c+UI1ddYXG6yPHEnLvKgwDlRGHNjvRpPxiQQgJMR7FFcvpUTZk+UmSOeAIxnBiM7W hmTW+ONNsqoxQ1fz2IbN1xvmAtAL2tDx7KRg7hhhLyT1O9fS3LJLlKS7gedEAnv5HLXvcv8zy VLy8xbSKibDgWIlAkXvXraWZMSwvpve3uzwOF0HhS+v5PHb8xI0lZWGqUc2wSz6fYbFCz1bt0 Uztiru0mQrsPlQ6kZEXBb50W32HgBxbgk2XD7A7xdEebEngQh7P2cTR0DsxkokZnSAF7cE2rH hUVwjNWPvGuWE9ANynKq0p/rTNSfDsiovMm9opROFOZ5xPI9SdH8F+PmSHrbzapy10Hr+HgLl h0oFPxT8tg83v1ZQ8al8WZKwVaV3IMBM/tnyn54LRye1oJhHbDvwsLmp74t2n/iW8o1PkR1Ak nx+s4ble5Ic0sLz4uVa6eDjrROeEmRyMs/7z0cTwuJBKYUJ8NL/rHkw7aDSC6BjCRxjJYcExn ZcJJ57IM5XNqgD+6sxtsfpTT+93JM7m9LBoO6UyG6jylNs90rj7mvkNWgSbyVnX/iCuc26+9r m7jOHcymAIZNVi1Prxn4g5/MfdSpTm2jJV6Bx3Ut1O1iEgkJBWPsKAmUcYYu/7ydO0sA= 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 Acked-by: Lars Ellenberg --- Originally submitted on Feb 1, but not yet merged into v4.11-rc2 --- 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