Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp263964rdh; Thu, 23 Nov 2023 03:30:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFATzzdfOvOYEWHlo9hfbCE/K9MfKcCiGHgUa1AZ3q7usuNiTlRkvh4/W2oNH1Piw5ggIM2 X-Received: by 2002:a05:6a20:e588:b0:186:7842:ad0c with SMTP id ng8-20020a056a20e58800b001867842ad0cmr4882868pzb.35.1700739004851; Thu, 23 Nov 2023 03:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700739004; cv=none; d=google.com; s=arc-20160816; b=w2iGK5dvQ9MyBDGCCxa4yvdrtkR3L7gmoXbJicohG0OzVVT5NG8puKLF0nCS+GCgrH rH0jA14R9Ygqo+IbJCk7p+RLf4KUIfIP/VSvxSUmxUzEW+jYR0vuR9qjg6WNz5H0vdxl 9+ON16QSiqRKWEOhK7rjuucGZAERj6wjnOeS4nCQ0Z9WyvX4wIwYUOIkhrib4cPbvvUH Ad9N64hV893mvMyQ2gLVIDEoAEn/zA3Nx42GxB5EKsObTw9I/sPziyOYryQBhPWzgcBZ f11ohkE8SFz44iBwaMMlbNTvt8viZub8qfYLUnGlI7fll5kRCd88lm9VhvJzEWqXTn3D IHDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=4DADDyurmUQIFRVQCS5Z4uwPVx0p1E38yfvyPzSILiE=; fh=mOqrdtzLxfRdhx+JUcCLIFZwj5ZpRA4B+MTwRGfrWMA=; b=owQvep0EaUQ/64+g4paBtIkxOLJxh5LIzTQcKupNChMeDt2OkZv3MpJR6Z6uZhuFea RtKpNhABmNjVpfIjT+sXapysXbhRPVE6EA7EjJQJaz99IaAGDntf2/aJ/zlHx75kFEpT 4eROlqwPkIR1nZ9NfuwyV1aeSKR8aLrkQxz7iOV6+cD3v0gEOm7Gg4jJAtNDlyfBZCD7 P4StK8eYISS6ENOBc5CVwvZCFZyF7LJYYq6GhW6t2XQVvIbqZklgyoEXmiiX5z6ijZHt 7U5Wyzk6jAmSqMsSuW+doS51S4wgjzdqZWcNWkp0/bNEQFuZ/U3jwNnEspnfARaM8Ml2 Zvog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EgALf7NX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d3-20020a17090a6f0300b002851546ab95si1126853pjk.116.2023.11.23.03.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 03:30:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EgALf7NX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2DB738074E0D; Thu, 23 Nov 2023 03:30:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345038AbjKWL3q (ORCPT + 99 others); Thu, 23 Nov 2023 06:29:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345034AbjKWL3p (ORCPT ); Thu, 23 Nov 2023 06:29:45 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 996DA19D; Thu, 23 Nov 2023 03:29:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700738992; x=1732274992; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=PzOs9RB9syyjScUbFTKb+4Hn+6cSUNDGPYqCzqbe+8c=; b=EgALf7NXYPH+SqMjyo3h6j5Coli6X8UqkLz+LRJ9GOe6iHs2uvFx1Jrs EnaT0DalLCDOU3ObHRbvJk5oHBfxTt4rFmFMM8m3c9XXCKsH+fAwcu8sj 0K1TOMDplnqSpelkdj25CnFJOpklCais3PlCrNzUb5LpICAT4TMFJ1bBF Pikwzl87IYUcK3p4Q3KUmATB+XXxPj8wJkj3SPzT2OgegTURrcGhD/X4x x8k+xFOR15QmU2HY/dIyNzdq3kvZ6ZXRBKYU92a5roP9lCMI/9aU3avs3 eWf91DNBvz11QWkz/TvLVFBb9K+q67iic+qO5G0BmxUlJTnP/t1OC+j8m w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="13805425" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="13805425" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 03:29:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="717029985" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="717029985" Received: from mstrobel-mobl.ger.corp.intel.com ([10.252.40.70]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 03:29:34 -0800 Date: Thu, 23 Nov 2023 13:29:32 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: "David E. Box" cc: LKML , platform-driver-x86@vger.kernel.org, rajvi.jingar@linux.intel.com Subject: Re: [PATCH V5 05/20] platform/x86/intel/vsec: Assign auxdev parent by argument In-Reply-To: <20231123040355.82139-6-david.e.box@linux.intel.com> Message-ID: References: <20231123040355.82139-1-david.e.box@linux.intel.com> <20231123040355.82139-6-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1384371482-1700738975=:1676" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 03:30:02 -0800 (PST) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1384371482-1700738975=:1676 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Wed, 22 Nov 2023, David E. Box wrote: > Instead of checking for a NULL parent argument in intel_vsec_add_aux() and > then assigning it to the probed device, remove this check and just pass the > device in the call. Since this function is exported, return -EINVAL if the > parent is not specified. > > Signed-off-by: David E. Box > --- > V5 - New patch > > drivers/platform/x86/intel/vsec.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c > index 7dc3650f2757..7a717183c58b 100644 > --- a/drivers/platform/x86/intel/vsec.c > +++ b/drivers/platform/x86/intel/vsec.c > @@ -103,6 +103,9 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent, > struct auxiliary_device *auxdev = &intel_vsec_dev->auxdev; > int ret, id; > > + if (!parent) > + return -EINVAL; > + > mutex_lock(&vsec_ida_lock); > id = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL); > mutex_unlock(&vsec_ida_lock); > @@ -124,9 +127,6 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent, > return ret; > } > > - if (!parent) > - parent = &pdev->dev; > - > auxdev->id = id; > auxdev->name = name; > auxdev->dev.parent = parent; > @@ -212,7 +212,7 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he > * Pass the ownership of intel_vsec_dev and resource within it to > * intel_vsec_add_aux() > */ > - return intel_vsec_add_aux(pdev, NULL, no_free_ptr(intel_vsec_dev), > + return intel_vsec_add_aux(pdev, &pdev->dev, no_free_ptr(intel_vsec_dev), > intel_vsec_name(header->id)); > } Reviewed-by: Ilpo J?rvinen -- i. --8323329-1384371482-1700738975=:1676--