Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1361770imm; Thu, 4 Oct 2018 12:19:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV61gMk3pBqPxyfpRBQYa6pLWfSedHtJ4DfMZcm/kJW1lxYFcKZW1t9BsPe2S94J/NVlst94V X-Received: by 2002:a63:dd0a:: with SMTP id t10-v6mr6956634pgg.379.1538680764226; Thu, 04 Oct 2018 12:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538680764; cv=none; d=google.com; s=arc-20160816; b=caxFvI5bCUboyzO3XvknuhvIHg+JuX9RfXfJ1JG26ruKKQNc6a332pdDnH4wCx/5p1 ZUJxB2byigZRQQ+uDkXG8YiLO0tni7b6wK21FVfQeOiP2iOBhZc9gL8XbdGsY1IaybTt cpGjVNGYiLSXqhwWcAdPktq6sV31wZz/M3TrOsGAQi82nzVN9Qh1N1UGFr2k1a68zZe9 jlsnKTkQ0Ce2bhKp/rXPtnWHCQeLEIIP7RBhh1p6n6TaJmCCo3i86+6h5hyddwij5I8j 6HFn1HINuFX1T3qi+Js3nRcqVnauLl/pJpXO7s7wfAJHSSgmSigiWmsTF6y4rCVPUd3c G0Cw== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=gJOZU2G9npsMt8sbCGivn0hVgOJZA+BjT3B/aTKdDqo=; b=kFCs6qtQkudAxllbX0SjKSj9Z6+sruhJUdEbCovpyOACLpXIA0Z2R1BvKAXFWyVzYg awJqzDzERhDGhpn1FnMkN5w6ugr1quiYA7H1df9VQQMT6KPk/sFscNSTTLsQ2qv3wDOq hbcm5YyeumcS5bUYslldzBsABS9+YY7NXb3iL1eFQ3iSLycANzE77ruSy+5aj9uFJjqY vDw5+Ch7OirtwWaPZAf2a6SMLN+BjKIAVcsXrpEcLuAGA4jr9feYKUlUoVEzzWZ8jWlv XIBHLJ2IcVVu+GBQKA2pVZR0GrZBocV1GQSmxPgvvvzehN5KFCHJGT4fQqs3YEKtmLKa 9ggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linbit-com.20150623.gappssmtp.com header.s=20150623 header.b=XobNOS6C; 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 v17-v6si6202147pfg.157.2018.10.04.12.19.08; Thu, 04 Oct 2018 12:19:24 -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=@linbit-com.20150623.gappssmtp.com header.s=20150623 header.b=XobNOS6C; 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 S1727600AbeJECNh (ORCPT + 99 others); Thu, 4 Oct 2018 22:13:37 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37963 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727536AbeJECNg (ORCPT ); Thu, 4 Oct 2018 22:13:36 -0400 Received: by mail-wr1-f66.google.com with SMTP id a13-v6so11104935wrt.5 for ; Thu, 04 Oct 2018 12:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gJOZU2G9npsMt8sbCGivn0hVgOJZA+BjT3B/aTKdDqo=; b=XobNOS6CsPXexi8EMYSnGgSzFsZFocttzg5XYRaG/gVvL9R4rDY/QOb15oe5a2dg+G Aujvuf7OCwjLRkEoexck51SRQub2qE+CTOmrVFJfei/FW+1oWw03HFPgkkugbcv0e8X/ bEjoqx+WZRK/H2Z8AxPuvTH0UGdl63/J900Xp1Bm7ekRg+5vV9bfJ7S8lSw5dGHDmtf7 3oYj0eoGbMnw3f1j+NKpfChrsYwf4CrNYmictWqx/KJgzJ5TrTsc4fx/a6V+Hno9Rj44 MuJwhy+KJP6kNF4Qfgn7lwzET+MmQGjdvaweqsexa97IZAqgYg2A3cPK5TX7xa401Brw LseA== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=gJOZU2G9npsMt8sbCGivn0hVgOJZA+BjT3B/aTKdDqo=; b=dPmGGFXXvtevZZpahcrUvMiZHrkOBXJ/ZPmQv/Ct/8hCYZnSItKIZNmVMVimT9Z6eh yIlw2qv56N9fPHcUtDo5yh59Mbavet5wLYDnQwVAtJerSQWzu1BJhD49Kl6S/tfJBNKf j1NmYytXiBaRQrkAev0erJgX6bOHsMwrux2+2A7QIt540X4d8rA1AF/UjRKKRm7tQElq hCrR9++2Qx1Xsycyh4gdXMIPe8M1QN1qqiTDe0Tt+hSJ1n7OF7ZNwB4vQmjhOYQq4ybx VCtqtLr7GtLV/rXzrp90IK0k0bkvtwlEWjGfZ7JxL1aN8qasxM7+FpoY9MUMyWL1kdOR KRYg== X-Gm-Message-State: ABuFfojOOlzfVCyPRVFQWbPJn4qr4mAOXMo6K4byzwFp/UkhG6udmKRy rv3xJ8pKHKGJqTDBArqVVKXFbQ== X-Received: by 2002:adf:bc13:: with SMTP id s19-v6mr6262932wrg.255.1538680736512; Thu, 04 Oct 2018 12:18:56 -0700 (PDT) Received: from soda.linbit (212-186-191-219.static.upcbusiness.at. [212.186.191.219]) by smtp.gmail.com with ESMTPSA id j203-v6sm7025261wmd.46.2018.10.04.12.18.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Oct 2018 12:18:55 -0700 (PDT) Date: Thu, 4 Oct 2018 21:18:54 +0200 From: Lars Ellenberg To: Nathan Chancellor 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: <20181004191854.GD10984@soda.linbit> Mail-Followup-To: Nathan Chancellor , Philipp Reisner , Jens Axboe , drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann References: <20181002171447.10765-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181002171447.10765-1-natechancellor@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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