Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp459050ybj; Thu, 19 Sep 2019 17:41:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrp/igXIAhGTJfpsrAEJbsOT/NBPG5RKS+5CFmcIs5qA1xJ0KFC7GvKKlKqxAltnPO/w76 X-Received: by 2002:a50:e719:: with SMTP id a25mr19077239edn.258.1568940080479; Thu, 19 Sep 2019 17:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568940080; cv=none; d=google.com; s=arc-20160816; b=d8aGXCMQZduxFR0TdfnmIyNJFGDh20FaSDLOZsFV8DVBnwKmK9ez3FMFFKNM0tTc/F ylqNdqlhI9YzaW+3ylgVnRcl0UPDrB6U/M8Y7sST8xd6jE7AFGXZNqi4d+j/Uizrbone g7V2dIvWJJpT30eV9nVTbjczmmXv/22hicYiWCenii0v3As2OX2NbqYp7MAp82ZLVcFd hFnoxv7vIfUaNNODW2kp1VhIttScl68PFuV+IA6HTCpoqTMA5k8h6rocwpP3GDHvr5oZ exNmAXuV0ttCWCR5vrgMC/YfKB4nM+9MQcTff0k7qituLWCLXBSrlaGrB53nrzejHrUM fs3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DLElX6prsemmI7+wc0Ol+UL4D1Wa4vwan9SjKgoiFhY=; b=nO9XiRT8DloBixrepTSGTVlBzAdS+oVzq5VtJdZOKDMk+EKCWtu0yqrC2y4/G2ls1g bkGJuvlsCEADQXmiOT1DmuT+VZdJpVbHfj2FLUYb6WXg7/ocVjQh4tlv+wUw4pus0ftf LZuT9BthiLhzdwgmm+HzTOP5wMAisAz5eSD5iSZLAgryCtSHU9AHWgywGPF15rlAqztC pVV7FrBipdxsnkEyyDFTbOXmkjvbisWs+Be+AXmtPu3UliVOr/F8/7qIhaE4wYZSc5XE Ftt7o3CZbFWB7EZAsOzdGy0fJYrYcxYodjs8cdDBa79DpacFJY86iN1b7YG+aTZ79GFb Eyzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jMp6N6eF; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22si239895edf.398.2019.09.19.17.40.42; Thu, 19 Sep 2019 17:41:20 -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=@google.com header.s=20161025 header.b=jMp6N6eF; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404254AbfISQV0 (ORCPT + 99 others); Thu, 19 Sep 2019 12:21:26 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46198 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403833AbfISQV0 (ORCPT ); Thu, 19 Sep 2019 12:21:26 -0400 Received: by mail-pf1-f194.google.com with SMTP id q5so2609455pfg.13 for ; Thu, 19 Sep 2019 09:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DLElX6prsemmI7+wc0Ol+UL4D1Wa4vwan9SjKgoiFhY=; b=jMp6N6eFq6jQzuKpk6LGVgXz/S9TP47yGUWsOQsmv3xsq5S9u+jNmxuTo95dRVFNrQ 94RsctbWhbXCRKVIDU4V3dNX1Lm7RBMmKwruC2/HH68wJByUsD8pMEuCwvoiw7TuSLcY mM44SSo5uSeSL1dqE9gscBIEMegZKliZ/hYgFPzjY4jRKUosd3wQy7ivwomcBJzLZjym 1oH4z09PzqslgJ1Z1DUGOl2M0vYtFhQDfcfnrzyVkZfVHJGgvjrZDSYDuVSNkQ1IbC/R uCxN3R9nHOxvKTpgSuqdtFUbQZn2legL4RGJkoOlaQL0CyYazUdvXXuOTWCAdoubX35e 0x1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DLElX6prsemmI7+wc0Ol+UL4D1Wa4vwan9SjKgoiFhY=; b=kgkJiucxGkSKVfwAXATmExrjCXPa91WwJmtM0fedzOyCpqDUoxwQKDu+dfFkg6/OA9 bNkBsF85OO/qsr0ljz11KtOeyx+PagUCltSRtTQhhuwvQ6xALP3E6k1jVo0lsBFUffGh ux+GIZH5EudjZ6O0EIBXeay+4WKb/16mAFjGjVKwfiwqevvdy5Ica0tcpabXDcQvpSPe X25LAtRzPmZVfPsKhxkBcCunal1tp2Gp65dIAEOPIDbEQbW6V4cfC0P+2v9H3gi9z1kf 27+ZTActtRepvqH/ZbBrh/T5aH9Q++MiV3vj/hMCDShKdKk1Mw2RFFOQ5bXcv1AvP6Ar SV2A== X-Gm-Message-State: APjAAAUcYe+Yh4DB95L6K++z9MN6egA8JNYyiS4Xwfz+Hh9ZfV30GST/ 4XfE3ttOWm79qA6r4klRoCC+OOfrMlHSrs/l/d6wRA== X-Received: by 2002:a62:5fc1:: with SMTP id t184mr11250186pfb.84.1568910085164; Thu, 19 Sep 2019 09:21:25 -0700 (PDT) MIME-Version: 1.0 References: <20190919135725.1287963-1-arnd@arndb.de> In-Reply-To: <20190919135725.1287963-1-arnd@arndb.de> From: Nick Desaulniers Date: Thu, 19 Sep 2019 09:21:14 -0700 Message-ID: Subject: Re: [PATCH] block: t10-pi: fix -Wswitch warning To: Arnd Bergmann Cc: Jens Axboe , Christoph Hellwig , "Martin K. Petersen" , Max Gurtovoy , Chaitanya Kulkarni , linux-block@vger.kernel.org, LKML , clang-built-linux , Nathan Chancellor , kbuild-all@01.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 19, 2019 at 6:57 AM Arnd Bergmann wrote: > > Changing the switch() statement to symbolic constants made > the compiler (at least clang-9, did not check gcc) notice that > there is one enum value that is not handled here: > > block/t10-pi.c:62:11: error: enumeration value 'T10_PI_TYPE0_PROTECTION' not handled in switch [-Werror,-Wswitch] > > Add another case for the missing value and do nothing there > based on the assumption that the code was working correctly > already. > > Fixes: 9b2061b1a262 ("block: use symbolic constants for t10_pi type") > Signed-off-by: Arnd Bergmann Reported-by: kbuild test robot https://groups.google.com/forum/#!topic/clang-built-linux/awgY7hmSCCM Hard to say what's the right thing to do here, there's not a lot of other switches on this variable. That enum value barely even shows up in the kernel. Since this is no functional change: Acked-by: Nick Desaulniers Thanks for sending the patch. > --- > block/t10-pi.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/block/t10-pi.c b/block/t10-pi.c > index 0c0120a672f9..055fac923946 100644 > --- a/block/t10-pi.c > +++ b/block/t10-pi.c > @@ -60,6 +60,8 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter, > __be16 csum; > > switch (type) { > + case T10_PI_TYPE0_PROTECTION: > + break; > case T10_PI_TYPE1_PROTECTION: > case T10_PI_TYPE2_PROTECTION: > if (pi->app_tag == T10_PI_APP_ESCAPE) > -- -- Thanks, ~Nick Desaulniers