Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2044330pxb; Fri, 17 Sep 2021 00:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuIvH5k9kx7ZHsOHXRb5ODRiI6Ykx8A4OmH7yQVWaJ0jGu4Yi6opo7+vSoieo9gGrAnFlQ X-Received: by 2002:a05:6638:14cd:: with SMTP id l13mr7699647jak.90.1631863358282; Fri, 17 Sep 2021 00:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631863358; cv=none; d=google.com; s=arc-20160816; b=OTdQ4Xd/xuQduJmBXOoTQMORHazIv2nzNDvyJdkn3grZsYZt3ZaeVUpx1jwBNlRwmo a6UafoQ9MoDSxIcY1uIduTIqnGwX9xFRthEBWeG4o3QUDS3ZhBTbsXcdTyvNDmXzamog RJRWzISLvuB0YrYF8hJjlhf0RoNagC6js5tHAf6IteKUZUv9I6FATKvgpmmk7KbilL77 6IorZZuKOs0vXc44R00cRvTAK+8PsriWRVnBnSIThXwe1m9ZV5K9QkhIjpDUOHGQ1kWh OAbiwLEn72UlzQBAZh9+EwNUn0Rthe6VMbbnFWvSCgOmOLXOeny7uomdlOQBMz1tcN5I chYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Hyj6KAsKyBSZt8Igibw1Ppx1/7Phj4Vw+yzte/ZURkc=; b=xClRFsyy75iHBUy10g/lRwVUr0MXnuoKQ4eIrTQajujmwNn2Ip51o0mOyuu5MByE4l PpYI7sJd5p/9lghknhvJEUQsaeeV/xBg9h6q08FEirKzNxV1OYrNt0UzDWjeaX8Hqwaa d5Yl8VQ3yW8dbui5llN/MN/2RzpvoFHN3HAOG9sw8lJO6ndbs3bDNYNjI/3tjqo2iyFw q+5QJwHDHDEO/E52g0e3QmNtidu1BiY4vGd+NBT7Ed/8zXvQj/Ho8oYKh8UTJvg5m3AJ gcZGaUvn8aT9lMN06glm0pj+uacwIEg9w9Xq+SC5wCN80zKHPG1ztZ4zyqUN2A/cJttG 4KXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v189si5044529iof.75.2021.09.17.00.22.27; Fri, 17 Sep 2021 00:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241349AbhIPW7U (ORCPT + 99 others); Thu, 16 Sep 2021 18:59:20 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:34545 "EHLO mail-wr1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235315AbhIPW7T (ORCPT ); Thu, 16 Sep 2021 18:59:19 -0400 Received: by mail-wr1-f44.google.com with SMTP id t8so4976809wri.1; Thu, 16 Sep 2021 15:57:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Hyj6KAsKyBSZt8Igibw1Ppx1/7Phj4Vw+yzte/ZURkc=; b=gXuyfZtcY42T3tq6daVdnbcj+l+F/I811wXtXZwqc5xlDH7aAtqAWQ79vRA4pFzkRz v65wce9Hyzv9z/1p4YWsY6dDvGfDEmET913Ayw3LUIVgvqyN1GxBqcqQHNDCc6zRAsr9 U83sCk+pKiooZtGwutQaOnl7QzGR5fdg59rQf2HX45gW+eyciTRW8vvu50IYtD/8PpS/ gcTUSZsffZvXIBO0d4pfsrvOQOsGe9avCGr2rfu/wI/l3iTVgZwsATqJsNYH8cSvHVVt vbFXLj3oeHgqfSeZjkQWDo+qmp4sOMXHxaRiyMJzPqrd3kicPIqwQnOnp9yZVDLFP3g2 dLMA== X-Gm-Message-State: AOAM532m0zOFVAOR3S+0bFz5tuDlJG94Di88shFiPomahDazv0GptNap bBGuuARb4nBiEpWMiJZRI3k= X-Received: by 2002:adf:e88d:: with SMTP id d13mr8641203wrm.91.1631833076915; Thu, 16 Sep 2021 15:57:56 -0700 (PDT) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id b188sm4704115wmd.39.2021.09.16.15.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 15:57:56 -0700 (PDT) Date: Fri, 17 Sep 2021 00:57:55 +0200 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: brookxu Cc: jonathan.derrick@intel.com, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] PCI: vmd: Assign a number to each VMD controller Message-ID: <20210916225755.GA1511623@rocinante> References: <1631675273-1934-1-git-send-email-brookxu.cn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1631675273-1934-1-git-send-email-brookxu.cn@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xu, Thank you for sending the patch over! A small nitpick below, so feel free to ignore it. [...] > @@ -769,28 +773,48 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) > { > unsigned long features = (unsigned long) id->driver_data; > struct vmd_dev *vmd; > - int err; > + int err = 0; > > - if (resource_size(&dev->resource[VMD_CFGBAR]) < (1 << 20)) > - return -ENOMEM; > + if (resource_size(&dev->resource[VMD_CFGBAR]) < (1 << 20)) { > + err = -ENOMEM; > + goto out; > + } > > vmd = devm_kzalloc(&dev->dev, sizeof(*vmd), GFP_KERNEL); > - if (!vmd) > - return -ENOMEM; > + if (!vmd) { > + err = -ENOMEM; > + goto out; > + } I assume that you changed the above to use the newly added "out" label to be consistent given that you also have the other label, but since there is no clean-up to be done here, do we need this additional label? > vmd->dev = dev; > + vmd->instance = ida_simple_get(&vmd_instance_ida, 0, 0, GFP_KERNEL); > + if (vmd->instance < 0) { > + err = vmd->instance; > + goto out; > + } Similarly to here to the above, no clean-up to be done, and you could just return immediately here. What do you think? Also, I think we might have lost a "Reviewed-by" from Jon Derrick somewhere along the way. Given that you only updated the commit log and the subject like, it probably still applies (unless Jon would like to give his seal of approval again). Krzysztof