Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2687442imj; Mon, 11 Feb 2019 07:02:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IYU56R2WAnlPioYLYItat1qmmHpe5jaUZPAGhb+sq+sR+eGCn8f0J0B8OFItziNBce2H6m1 X-Received: by 2002:a62:ed15:: with SMTP id u21mr177793pfh.38.1549897379492; Mon, 11 Feb 2019 07:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897379; cv=none; d=google.com; s=arc-20160816; b=gB4Um9b5Hr5E/lc3pP1/FOhx2HstAueKZT2tXkSW16cCJQWUmK4rSCOTSaaSHXKt2G yjGc/1K2zxgCoixxvIg7UJdenqrjaf4slYYoZBjBx4MuZg1uBzJ96b/hJ9mm3jnnajOX 6Gpci+Z+wAd+0nv6CHaCZXHFFhJo+nnYzvU1/DAFmkkwPs27np82LUwHdl7bQI7xblcB zC3k0hGuD3TfIZJKV5+P0Q9xb99Uflsd2Nm3ZrWm6hkZ6qVFRp9mYE2Mz2sxQpZc6V+w cEHz0dYoWfx0fJ+wIFTINNmc1jlZ5gjRakunnp+noAucwjDIFTCqBo8D9F4Zn6FaXPAz eN0Q== 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=u7CZxv44jtRH21SYFkTwdCCbpg+zRRvrnSgFPe8CRjo=; b=Dk/EcRbC5TLDVVmxz5iF/cyghQ1ALL3rPMrkUNT/AFOdgObEIY2m8eaY7yY7yM/6ZC at5WmAhGpIJZNlHcoDO+aYCCmFx7ZPlvlXDt6I8kjeTHbBgf6Z4Uf6ga/aM2M46iRIp5 84D7FkgS9YM1Hjf9lvZA4ZFd98XneSalwzqWPQBTq+683VK2MmZQsjMDRvnb0yVZBmIp 4/oH2H4ymNsl1omOgOv1oteSycJFFkYbR6OgKDGfdTc/FSiv5sz/B6E/5ONhc8tK74Vh EGjEDn6vsafRQDQqZzmQB+rwG/K5Oi30oeRb0nnaULD1Si1XvBXGZwaWnZYiZlhHCPCB zPIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QIu8pt5J; 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 r1si9960172pfb.118.2019.02.11.07.02.32; Mon, 11 Feb 2019 07:02:59 -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=QIu8pt5J; 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 S2390214AbfBKPBd (ORCPT + 99 others); Mon, 11 Feb 2019 10:01:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:49520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390206AbfBKPBa (ORCPT ); Mon, 11 Feb 2019 10:01:30 -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 A03B3222A6; Mon, 11 Feb 2019 15:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897289; bh=KWxsmT2AJG7d0oMP2hceH5pxbx4YTwsBjSoQHUnlZso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QIu8pt5JjEBCDfFQA3MJ1hkKVdiyuGJjldRneuBQiTxDm25BRFZjyBaHgIQ8ZZAXq nzSQF+C+bpCAs7hjBl/IYpUzEMhCJR/tLpGpi04fxv3g7oDa9bAnRUm/bNHgwdnKJc NkC3W+UHx812++bHmvcr92j6BN8bejj7NbP06FL4= 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.14 121/205] drbd: Avoid Clang warning about pointless switch statment Date: Mon, 11 Feb 2019 15:18:39 +0100 Message-Id: <20190211141836.370224286@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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