Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1413342ybj; Fri, 20 Sep 2019 10:03:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqybeCVBYG2Pm+onkg4f7TudwsY5jnu9gpnxQE3XJO/6T5hSN7k7pehC4jmIauix0h1FJ9C9 X-Received: by 2002:a50:95a3:: with SMTP id w32mr22983979eda.211.1568999013084; Fri, 20 Sep 2019 10:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568999013; cv=none; d=google.com; s=arc-20160816; b=V4sIzgg/WHZ+3jkPHC3K8Hfq9zMmEaoq1c29bnQogYQJTxhGsmSsjOAOcNbQfpEXze JkBMO0aT90+rL0YIyDpYqsyGE5PcckJ62hb2HaZ2XMyrK1YYp0iyHy9Ux+c0pNYSNvTx FQKUcKD9Ylfp2D25QT76BSankHESlzukx2lfNzGpM4ODdgzbm6yR+ABrk9DhX762szlz yX/35VeIFdNeDf2fyMC3d6diZ1YT6MLKkoGt6nFoJxUr9WaYSOF02FE6TKNu99P8BJAS 3BZ8M3a2N72sBQCDKF75cavxlpzLt8MjoWleoWQeodoTuSEaxOUP1oWRlAyuiw6dbl+W BAWw== 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=cED18m1mvjZ+niHvjAeZ+v1xJ6oH9Dol7OSVjJcLyuU=; b=u2DMnvn5B02RmovOogA6qCjZjLp40JHzB+q08stlRzTondRAsV+pb92dCOP4k+kjSS 1i2AFXnvCuFGvh+9hQWvvClanKl8d5htQ3IKb89gkbhSCZtgOvT11pDIcKC+fnMWwS4e 0XQvapZQHh/7+Ih8YzqyGRg7GTtkvVb5xf6avWAyc7VElgfBVK6weVld17dAg1D5Dqv3 h3qx97yA32PwDn5d5bpaPnwnmoNwPHY7gCveozgF94tPZ0uvO5S19Crz+G2hH6WKv9oW u107WnAfQvItE3eDotTw3vJdt6/ZTymOau+9+xMadkOoaUXvpDpYjX0R+iBjKf3rXqt0 +sQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EmDdv0Lz; 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 g22si1724232edf.398.2019.09.20.10.03.08; Fri, 20 Sep 2019 10:03:33 -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=EmDdv0Lz; 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 S2408226AbfITGFK (ORCPT + 99 others); Fri, 20 Sep 2019 02:05:10 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44661 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404716AbfITGFI (ORCPT ); Fri, 20 Sep 2019 02:05:08 -0400 Received: by mail-wr1-f66.google.com with SMTP id i18so5399965wru.11; Thu, 19 Sep 2019 23:05:06 -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=cED18m1mvjZ+niHvjAeZ+v1xJ6oH9Dol7OSVjJcLyuU=; b=EmDdv0Lzck9qjY3AmMNK8VHhZlfh9YkKN0+gv6DY6FojUJnC560+vgvJ7nnaWZSUrz s4cHXnPkVuduXEWZJ2pf6L/Rbje7VwoPtHY+AzUlKmeylLsbT/I5OpyLNgh9TZm0weED ur3d56IgMs0pQ1X6/0R890LmIgohd5ULnBYZ7A+mpxEEIdPUvVB6J1Uz6ocIP+EOZQ1a P6dKhenrIdziB4pZpv2ehc8RVlZcGIIjE2ghmLpjMRcqGDxgU2lAtqZuTejYVnq3fFi+ HAfSuu0/6Z+DZS77Md7dLvNFq9URNo3Tw2lFkEt/QBx1jBDTk7+SfvSXNHrWt1x9cVp+ Az5Q== 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=cED18m1mvjZ+niHvjAeZ+v1xJ6oH9Dol7OSVjJcLyuU=; b=HM2zl29nIMnWJ/fDesL2XzVNFTb+sEJmPOB22RWz0c3V61CA8ZsxiXMxbNqCUCKLE5 BipHiPuALizQFtHRaWEzk0fTfcJrBCpebp4GAAmnwTyKfuCFfHagicBBYXIrdA+7l5mk yujMSblZaiSwmJTN1U3BUWHh2EsvYRou1seygwCJx0sbn5FL9hpBfBpIdHMjnl0lFCW0 GMnUoCYZ+Vsgez5Zb53U5Hrom2RE7yRX5cYRaKhhA9R9vIslXgeuzh3hFZLkw+9pwrWi S4iIy/029uMb2lGfIubB/hUbIm0JrtyO3dM7TaEIg2PaKlv9hPAlNdn0k7po93qK9olU haww== X-Gm-Message-State: APjAAAUjQr33l64uJbcqt+v8z2hpHxTxMh0YQvZr2p2+V27nmp0TqwOg iuvsDaHOaEtasuv/mCVHEXSkLm2rk2E= X-Received: by 2002:adf:e7ca:: with SMTP id e10mr5806942wrn.234.1568959505815; Thu, 19 Sep 2019 23:05:05 -0700 (PDT) Received: from archlinux-threadripper ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id h125sm913513wmf.31.2019.09.19.23.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 23:05:04 -0700 (PDT) Date: Thu, 19 Sep 2019 23:05:03 -0700 From: Nathan Chancellor To: Arnd Bergmann Cc: Jens Axboe , Christoph Hellwig , "Martin K. Petersen" , Max Gurtovoy , Chaitanya Kulkarni , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] block: t10-pi: fix -Wswitch warning Message-ID: <20190920060503.GA130425@archlinux-threadripper> References: <20190919135725.1287963-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190919135725.1287963-1-arnd@arndb.de> User-Agent: Mutt/1.12.1 (2019-06-15) 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 03:57:19PM +0200, 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 > --- > 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) > -- > 2.20.0 I didn't have the break in my local patch but I think this is more correct based on the description of the enums. Like Nick pointed out, there is no functional change because this value is not used in this file. Reviewed-by: Nathan Chancellor