From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FC95C433F5 for ; Thu, 9 Sep 2021 14:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53799611CA for ; Thu, 9 Sep 2021 14:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236576AbhIIOvl (ORCPT ); Thu, 9 Sep 2021 10:51:41 -0400 Received: from verein.lst.de ([213.95.11.211]:44669 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232566AbhIIOvj (ORCPT ); Thu, 9 Sep 2021 10:51:39 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 8523F67373; Thu, 9 Sep 2021 16:50:27 +0200 (CEST) Date: Thu, 9 Sep 2021 16:50:27 +0200 From: Christoph Hellwig To: Keith Busch Cc: Jiapeng Chong , axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme: Fix missing error code in nvme_configure_directives() Message-ID: <20210909145027.GA32109@lst.de> References: <1631181021-108687-1-git-send-email-jiapeng.chong@linux.alibaba.com> <20210909144739.GA2464330@dhcp-10-100-145-180.wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210909144739.GA2464330@dhcp-10-100-145-180.wdc.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 09, 2021 at 07:47:39AM -0700, Keith Busch wrote: > On Thu, Sep 09, 2021 at 05:50:21PM +0800, Jiapeng Chong wrote: > > From: chongjiapeng > > > > The error code is missing in this code scenario, add the error code > > '-EINVAL' to the return value 'ret'. > > > > Eliminate the follow smatch warning: > > > > drivers/nvme/host/core.c:786 nvme_configure_directives() warn: missing > > error code 'ret'. > > Nak, the code is correct as-is. Returning a negative error for this > harmless condition will result in disabling the controller when we can > proceed just fine without directives. Oh, indeed. We should probably throw a comment in to make this more clear.