Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3697026imu; Mon, 28 Jan 2019 09:12:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN5B6j5b3MpOE6ErZcY4+8Mbz0s1z6TTVjtXCvPlNv0eNIbdomDvmUJrrYFadsoPi8WfZ3CU X-Received: by 2002:a62:c28e:: with SMTP id w14mr22614908pfk.115.1548695573597; Mon, 28 Jan 2019 09:12:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695573; cv=none; d=google.com; s=arc-20160816; b=Dac9s3/Lau3mbrS6XdOFPOuBP1HON5xscLSRZTi2ZzQ/5ngdm2D5zAdeBonUz4LPGi U/ZUo7mswpjNjT4hJ7N2T4U3Am70hM16XCfQff368fxZ1VLa3Pnmoh6v9EH83Qwt00xI FMiaY4IcWYXEnl/4lds8mOJKNfFMEpEBa2VnjTNfnlD8WHJGR/LcpQkR59ObGAuNfr5c mQrjAgDK39XbptX0TAREjRx/Qfhj3GBRQWO+X6Vs5ilsu7tOEj2umOZtGzd/vjwrfn2x tSLoYsk/zwQcfSYtduAqNeA3g0EtCQuxS5nl4Mmvbm2H9NPimcVXZcd+DLVdUgT3YN9C o6Qg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OZiPuFv7ePlAsnQT0TOGwjJY0txeldhnW9cbwv63/cQ=; b=LqAccfY4z7NXjKHxiqeDATLZosMDdEMmz3nkN2PxbOKdpDPM1EcASkJL6wjEEQtu7c FvupdDGSUKbBqu2ZMiKzsmL+m+Qk7bxfhNnCzRanflrJm+rxv7ypgxYs1jSHSnyoocjD E5Mkmt7ZMabNW+82+w10J6TEPMhbgBZuUX48kIgPmL93R83eXfqjVp2J7/79QPVpeuKz Eh5czvoW5UynpcuEDaV0RhClFy9JISPSJ7bAlyZ2qKOZDOgdn5EUFPz/TrDGIrz+ZgtV Hx7V5xAsOuYs+MjevlkR5dSZ+1gkad90pQdQFSFyXiFRu8LOst3WrK/kva1WS6WW7eqc 9bUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jg8G45Mj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si31549059plo.363.2019.01.28.09.12.37; Mon, 28 Jan 2019 09:12:53 -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=Jg8G45Mj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732533AbfA1QJD (ORCPT + 99 others); Mon, 28 Jan 2019 11:09:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:33138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732523AbfA1QJB (ORCPT ); Mon, 28 Jan 2019 11:09:01 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 230722084A; Mon, 28 Jan 2019 16:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691740; bh=F95uzW5aA4HOsG1tNEdwlq3ZdENQRrRJosWhBaKlnZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jg8G45MjWN9EEk5ZSTZgYcQHFtFdHoXRF8yUl/UqrtgB/czgVbv+MTFy4kz+kZOQZ l95HjHJtdldDqAGJoOGSN+WGO4loVbBRDus4a21mkbiP1CBnl+zlfEmn55rMb0k14B R317owoWli4BK17r0iPvkZOCH5N1rYNuHq+iTh0U= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Jens Axboe , Sasha Levin Subject: [PATCH AUTOSEL 4.19 202/258] drbd: Avoid Clang warning about pointless switch statment Date: Mon, 28 Jan 2019 10:58:28 -0500 Message-Id: <20190128155924.51521-202-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ 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