Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1366384imm; Thu, 4 Oct 2018 12:24:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV63+7ixkANBlayTEBilnpMa1Pa4pFDLtu9xGk29ftHxV0JmqVcj6toRo4SpyMVSrwmxA3vDE X-Received: by 2002:a62:9586:: with SMTP id c6-v6mr8146246pfk.234.1538681051925; Thu, 04 Oct 2018 12:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538681051; cv=none; d=google.com; s=arc-20160816; b=YJDO8oJ41X3bcHbDesLvuuzGlhHQMKgAQ39QBdKNfYrdxXdJhyMC5TNjpeYYsck2iS BWbN2uEv094qBcW1pREEJ4IPpsIYLMCmZ95pFZikWwQ5HY4en0lVJXGW0VBCCQkupKqM YXdUdh3BI66H55rfXGa4LldccZvAD2a82cLu7cShv21CpvuB7svonGLekuWDoLpo068X j1CK+CQF4pzPl5vrY0JZlkwEE5sQEvCakcdGz9WTS3Ug3B9AMFZSQ6rEz++rH6oMrNvE fTEUujCMwV3HmAs3dZzfauRm656mWDukfEwWKNzkSQM9DWSeh7lBaHIkPcsGdWpTaxy0 W7CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PDAXGuik59FtHdBSCQdlM93BjbA1AEBUywHJ+lxA/7U=; b=S8nS4Sb2Ozl0HBlW9xr3hrQsmX/uLyc7i1NZn6ATgYneMAiAi6l7G7pMPj9D8ocKtV 4UYy8GvQJtd5y3xsBHrV0doUXt6j0zMUJ8NqESkj1bEXcm5IbNUlkn2oC5LUFCnbMiGy GXHxU2rI2dCUHM9KtL1OANuONvMwlMdslZ6/TOYaSLgGItE0xCVr2xWxwb+6AUL6nUBa T4nLXXMpWwxHTBZ7rSuwR2ybqHdZRlwhlc4s6bGA1eftmnLnoNa8JSO3q7VpVRprO2Kq IT+8yr+0D/beO6rDvtkF9NOrpC0lXtLAGaL4Pzg85uCbnnLyd9OBW8eGe1b0+JaQo5ve gJmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oM5gJI97; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17-v6si6202147pfg.157.2018.10.04.12.23.56; Thu, 04 Oct 2018 12:24:11 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=oM5gJI97; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727551AbeJECRQ (ORCPT + 99 others); Thu, 4 Oct 2018 22:17:16 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41382 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727436AbeJECRP (ORCPT ); Thu, 4 Oct 2018 22:17:15 -0400 Received: by mail-pl1-f193.google.com with SMTP id q17-v6so5645041plr.8; Thu, 04 Oct 2018 12:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PDAXGuik59FtHdBSCQdlM93BjbA1AEBUywHJ+lxA/7U=; b=oM5gJI97IxjkitgBa0JxU8Ymsk5jTMN5bTgFmLSetFmI7RLaAHarqWkplPpfOxAcW7 DCoWd0t4GOF/iY+UxZTuDakT1pk6O9VwhyJ8WP5doNBk8ct+ITsQkbh3erznNvMIG8Gl RNbYGgsdoOXQ6URpiQ4fxm5O2uYO3Rh9zAMrnNzX43gf+cUowoo/ZhPrSPzOJAoQ8gqT cUz/1iImoJX0inIXr3uTEtTqD8c7N56VhN1soqcGtsESqmipeZxlA8fkBZGMiCp4Ou66 cimJpyvDx5ZxgBTqYGX9vejCgA8B/ySM4vLtwEHVVxYh60an+InEnJnaj6jZ3H7bDtOv 65ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PDAXGuik59FtHdBSCQdlM93BjbA1AEBUywHJ+lxA/7U=; b=UhhXkUtTsU8XwzMPi0ZgdmaOtIjVKNmA6AhQxTwjw56nKEmCRhu9JP8LKWt0GBuWCd nWjtRhZ2V0sTYAPru4X+1QO2GaAnH1KJxSIP24PNmjeEzqB2G3n6PCBeymy38Ejo70rL yesmXLHRzQ597xyraqFAgZ2SUD2MZuCGLZN8nIqwIu0fHFMpgH80NSVoR+YkFFJrs0Ne W1ChlGwLKK5QN2zIoE04fHENvnwIIpUopYds0gLdg4f7/cGQ/9aS0P0MIiMBCZY6Wj16 mmUByfJC4d7ZVqgHUpm4q1ispmH3EYX1gf3u9JmbltZHmPjxswS5senU+Nn7mXMMb2mw LBTg== X-Gm-Message-State: ABuFfoijPiAJ7iLoptDZKGnrlX6gqEPWtUqNVqLipK5t3HT/AFky3cBv 0x14OfM+vr+YNrJFaWyvOTtSX4zY8jIsxw== X-Received: by 2002:a17:902:b484:: with SMTP id y4-v6mr7986220plr.262.1538680955853; Thu, 04 Oct 2018 12:22:35 -0700 (PDT) Received: from localhost ([82.102.30.219]) by smtp.gmail.com with ESMTPSA id p64-v6sm8189883pfa.47.2018.10.04.12.22.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Oct 2018 12:22:35 -0700 (PDT) Date: Thu, 4 Oct 2018 12:22:31 -0700 From: Nathan Chancellor To: Lars Ellenberg Cc: Philipp Reisner , Jens Axboe , drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH RESEND] drbd: avoid clang warning about pointless switch statement Message-ID: <20181004192231.GA29744@localhost> References: <20181002171447.10765-1-natechancellor@gmail.com> <20181004191854.GD10984@soda.linbit> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181004191854.GD10984@soda.linbit> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 04, 2018 at 09:18:54PM +0200, Lars Ellenberg wrote: > On Tue, Oct 02, 2018 at 10:14:48AM -0700, Nathan Chancellor wrote: > > From: Arnd Bergmann > > > > 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. > > Actually, I think I'd prefer a "case 0:" instead of the "default:", > because that would assert that we don't use a 0 for op or field numbers. > > As at least some people seem to care, I suggest we bundle up > this and the other clang warning you just resent the patch for > with whatever else we may come up with for the next merge window > and send a pull request to Jens then. > In case we forget, please send a friendly reminder. > > Thanks, > > Lars > Hi Lars, I will go ahead and test that change shortly and send it over for review. Thanks for the quick reply! Nathan