Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2655409imj; Mon, 11 Feb 2019 06:33:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IaCf6WRbf+rKqUDRj6FLgA44bwoLAWhv7lEQC1GZVj80zRgsTCpplFoSVYK/jpod3nNIf4L X-Received: by 2002:a17:902:aa8c:: with SMTP id d12mr38257938plr.25.1549895582979; Mon, 11 Feb 2019 06:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895582; cv=none; d=google.com; s=arc-20160816; b=jRwIYYmBiehXsNk7ptpDRWuKXla10sCjAT319hlZ6He31DW20acOLcBIQ+nEJYRzzY jrYLugavhNSW8Z9a6wMXNMpEZN0zQhJEVsHKRz2gvFTl0NgcS244QK64SkIifguNv6xM PMAvcLcWIAIIHG0Mn2CoFGUK+UnPfdj922F7KLj5D5ZIJnJlWAJxyn2+PlMKiXfk9WyK Ny2F0JYaKZSa6vR2+83lkoYY2HIftzSPRYTip9b7+HGqff6963yqI1CzgnTwItdCGTkA BjU8qNTesF7txVClTWdpXoCdjVmFZbxZTolqNvgtPHkLxzOKdxolNZ1R3jE4JMAdUF1H iy+A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zQZuwVqHYeYW2MAdV2LyP9bCIUzuwcaVJ0DuL3oDHhY=; b=b/BdfsuSPtIh5+Mf5NKju07hL/05vOO73UIDmUFJz3LLdwMxwLohdzP2uzsYw53Fa6 B2uVI1KP8uGQntIexGXoYIdzZuC6VijVSIxHywbJakp6qmDJMYxIbMPi/9rBThY3QXuY G5KaKdMcn5RsUB9faETdFskO9RVj4LSABDKOfKt6+FMCe+q6lvgl77M25XVOlo2HwQ/4 lkpSwZr1xVnH+qwrNgYY1vd2yFke5+j0ILE/ESU7O6x43xgqSFJyBTO0nu+5rRbjSUQR XBZRD35Y2Jmo4m3/WfvdMEdDTL3vO5DftCQbRL9Y4OO/D9lyom5ZVgIUSd+2b8QIHBaL E/bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e70tdEqm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si4656794pgj.133.2019.02.11.06.32.46; Mon, 11 Feb 2019 06:33:02 -0800 (PST) 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=@kernel.org header.s=default header.b=e70tdEqm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730375AbfBKObu (ORCPT + 99 others); Mon, 11 Feb 2019 09:31:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:38854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728697AbfBKObr (ORCPT ); Mon, 11 Feb 2019 09:31:47 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2045020838; Mon, 11 Feb 2019 14:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895506; bh=yE8GQycKEZ2LBJeUXc0s8SPZGjQn3ijySPemUWfNywg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e70tdEqm2Aicb1R8gio4pI6T8n8vpJHxNGlXO2w+RanS6Oa1gttATZ5njrmg3FV9/ +DHCYx9ZV5ymVy227FA9xfiMdmyLkutE7HhwbuA1XPCdtegoG/+baNc5nn7130h8aN ejRUgsQU9BhcxPIXB2382SdDUB4vkXXSVGTHAMqc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars Ellenberg , Nathan Chancellor , Jens Axboe , Sasha Levin Subject: [PATCH 4.20 228/352] drbd: Avoid Clang warning about pointless switch statment Date: Mon, 11 Feb 2019 15:17:35 +0100 Message-Id: <20190211141901.747733304@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a52c5a16cf19d8a85831bb1b915a221dd4ffae3c ] There are several warnings from Clang about no case statement matching the constant 0: In file included from drivers/block/drbd/drbd_receiver.c:48: In file included from drivers/block/drbd/drbd_int.h:48: In file included from ./include/linux/drbd_genl_api.h:54: In file included from ./include/linux/genl_magic_struct.h:236: ./include/linux/drbd_genl.h:321:1: warning: no case matching constant switch condition '0' GENL_struct(DRBD_NLA_HELPER, 24, drbd_helper_info, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/genl_magic_struct.h:220:10: note: expanded from macro 'GENL_struct' switch (0) { ^ Silence this warning by adding a 'case 0:' statement. Additionally, adjust the alignment of the statements in the ct_assert_unique macro to avoid a checkpatch warning. This solution was originally sent by Arnd Bergmann with a default case statement: https://lore.kernel.org/patchwork/patch/756723/ Link: https://github.com/ClangBuiltLinux/linux/issues/43 Suggested-by: Lars Ellenberg Signed-off-by: Nathan Chancellor Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- include/linux/genl_magic_struct.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/genl_magic_struct.h b/include/linux/genl_magic_struct.h index 5972e4969197..eeae59d3ceb7 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 + case 0: ; } } @@ -209,6 +210,7 @@ static inline void ct_assert_unique_top_level_attributes(void) { switch (0) { #include GENL_MAGIC_INCLUDE_FILE + case 0: ; } } @@ -218,7 +220,8 @@ static inline void ct_assert_unique_top_level_attributes(void) static inline void ct_assert_unique_ ## s_name ## _attributes(void) \ { \ switch (0) { \ - s_fields \ + s_fields \ + case 0: \ ; \ } \ } -- 2.19.1