Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2460991imj; Mon, 18 Feb 2019 06:26:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IbVD6/1asejmnnPkFNDwMc7VazUk91AskS8//DiYYQjS1mRInuwdXjk/Ja8A3TBhAoKjgjb X-Received: by 2002:a63:d507:: with SMTP id c7mr11554007pgg.105.1550499975693; Mon, 18 Feb 2019 06:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550499975; cv=none; d=google.com; s=arc-20160816; b=A3ClYeTFJrKWWQuwRnsFun2dmj1qj9YiZbfH9ZFW5tx1o3SHQAhuIXiDvCLU9oo8TM zy4FZ+pWdydVuZIVopzBuShK7V4MiHCOHS57exL6zwMiyMgodsERHWdcVUcWmMjrEJ3o Drx5K5sfMzX+/2b1gt2kSEVCiBDl46iDB5J4rWBc66aZbq4BBlI+8Abu53JE+f+0kr2n dgUqhm4KNChuNuEk4q0+HeV6OZHmqnGe440q0U8r5gEhg2QDavzumbIAD9hJTBmBkAYF s/akyeaAJCboclNPXA5Yfns0G/81dNOLx9a23nSvKjj5nq7YUfZ++bf50iVdEAGOdQaU nJaw== 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=rDi9lrSbY0Ht7Smcv0txMiufVZzlC5l4lIA1mhzx0Wc=; b=NIa5F9YWTJWjOUomvrxRWNt3s1s/Okdu8IcAtchNEmw0gp1rgrmBsUMHGMTzn2Zwxq zrIkJlYZiiZKP1LOmhYJLui2g5rdX5ZYHGfvUDGJfYTA8uxFpkGfOmJB2CehpSehrjHW PzK6NMoArMnUJrmB6PrBwr/ZYpdWkhGpLyivHCOGOptOIxrkoAlpoJbpql/fOwPk4R8z 2sOz3a+rBgI9grvOa0Lb/1AHjJNwqVef2vLOQqNbiqimV0hgGobwZ+mhOTplNBE78LTd t2crcEamJk9gW9H62Wy6UdGbyKcdX+KlSlgdij99lwuNZDkwGGiai5f8UScgaj53LkLj 6NZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lH1GHTbC; 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 d37si14421643plb.140.2019.02.18.06.26.00; Mon, 18 Feb 2019 06:26:15 -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=lH1GHTbC; 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 S2390117AbfBROYk (ORCPT + 99 others); Mon, 18 Feb 2019 09:24:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:46076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389792AbfBRODz (ORCPT ); Mon, 18 Feb 2019 09:03:55 -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 063002190C; Mon, 18 Feb 2019 14:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498634; bh=ohcfmo9Q8e4x0zp2U3Ttqh+oxvdauxp8NDskXxH52bY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lH1GHTbCD91/40ZWv68ASC6DKyIzbH0mA+ydcnbkNREeN4/Qo27ZjYTiarE+s0tT2 ftq6xyPJ68Cpz7T5dQGrhTBn6uQ2aHvxa05Rumt/U5FBwZCZKfk2MOUzyNhhRhTNyL cxc4lHARm7OKHQoTKCstlCgJBDqf6bfJ2Sx/22Ys= 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.4 049/143] drbd: Avoid Clang warning about pointless switch statment Date: Mon, 18 Feb 2019 14:42:57 +0100 Message-Id: <20190218133530.922408834@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133529.099444112@linuxfoundation.org> References: <20190218133529.099444112@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.4-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 eecd19b37001..250e9be65e74 100644 --- a/include/linux/genl_magic_struct.h +++ b/include/linux/genl_magic_struct.h @@ -185,6 +185,7 @@ static inline void ct_assert_unique_operations(void) { switch (0) { #include GENL_MAGIC_INCLUDE_FILE + case 0: ; } } @@ -203,6 +204,7 @@ static inline void ct_assert_unique_top_level_attributes(void) { switch (0) { #include GENL_MAGIC_INCLUDE_FILE + case 0: ; } } @@ -212,7 +214,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