Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5629203rwd; Mon, 5 Jun 2023 06:30:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6dTjBNa5xbt0CzecrcdQHaItuOecmtW6JNXvPytzduFYnHveNx/BqqinJ97fmpqlxKmnGr X-Received: by 2002:a05:6a20:918f:b0:111:1bc4:cf0a with SMTP id v15-20020a056a20918f00b001111bc4cf0amr3478292pzd.52.1685971845565; Mon, 05 Jun 2023 06:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685971845; cv=none; d=google.com; s=arc-20160816; b=fHxCnlOnhK4rp16XuqFdBLjsxQRDpGbNMwcIZN5JQh1yvoMr3lYkclRHCYUz/+hI6B A66dz5aWYsnm6j+YjjcwON/2IW+8f54Nv8EdaOTWipChdP8YNhC9KmIjd20Bm/4I4RCc 52ZKEyR6x0CRiFy0wopeQSanbPXmPwo/G4g9J/A94np+vyIa1pxkumpfjR3BjBb5VTTo Sy7+F3M6TfyjtqL5C07VxoyUGlZB61D5JqCjb44asjqwuASO21rr2JjiqvNIv0ECYZ1y FG1m6tWIqtEN6rPVZ6R2OXyumZqjsnPeyCTNtBvh9JOXG5K99mxpTtMEbMCbpLY6VnQA C5YA== 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:dkim-signature; bh=j/P2m44Evczh+vcdw4SOqcpPMKCOQFX9JyHN7Iqjb/w=; b=xihymXs5FTtxdegpUx5R2N8QmF8ttULLqolE2vjc2HNU4QLFhkJSorL6TqhZOffyzW my9E16DsA/AloMaYl1hE9FcKFSkd7k717GGlSCywpfQdTU+lOpqm0mnEtPcWdtIE/hOh UwlO7fND7s0VgjUW/pjtd5D+6Qrmzbtgl/lneRgeL15U2Mo97BpVuRAb1CqFV1xY/nK/ 1fVRhzNjYCL1ZysDb9dsU5wAJpLPK/T3ZhfVYXZRxWG6RLvAxN7OJ0rjtGEdS8/r0m+S 9+7Q3+KZPrrHmOzWzm9hximOoMBZJdmmU5ny1pXlEeg7b5HHms0aS7381+o+PvffwOeW YL/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NDVYulSs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r130-20020a632b88000000b0051909d663d8si5544337pgr.656.2023.06.05.06.30.31; Mon, 05 Jun 2023 06:30:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NDVYulSs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233148AbjFENIm (ORCPT + 99 others); Mon, 5 Jun 2023 09:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230488AbjFENIl (ORCPT ); Mon, 5 Jun 2023 09:08:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F728CD; Mon, 5 Jun 2023 06:08:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5C2F61403; Mon, 5 Jun 2023 13:08:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C64A1C433D2; Mon, 5 Jun 2023 13:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685970519; bh=C5s8ZR2SYuPi/f9XTWMiXsaNSj08rkdKfPc4RPMosRw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NDVYulSsKQkpyLLhPz1Bhoru8SLw2qNbDwZWB0sAStvVCcJaHj6fsJCSKzUEN8vRn +5nkLIyfmozMkfEOR/HILic3zHMKC+8u+opd7eIrC/U5dhEV5h6eQfCrRvI4pgGIYD dmcI10vyQ8sGXYSMZvHOG56R8aNlAqJ7wDXOZRb0FBXqrNdMjnAQrEP+nQSlg0IwLA L+lLWGsPlvWTXsAikzFzhmaNlZT1n5NGgs8SrmKLjwfLFjIbM3UtdPRpuB0ZrcIbW1 Jntf/szUDKcxR9CnHlC4kU2tmwWUg1VneP7oLflqFKnjucrHeT/e5BKd+/pb2EpGzT 2SozDp06GIi9A== Date: Mon, 5 Jun 2023 15:08:33 +0200 From: Lorenzo Pieralisi To: Damien Le Moal Cc: Manivannan Sadhasivam , kw@linux.com, kishon@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v6 2/9] PCI: endpoint: Pass EPF device ID to the probe function Message-ID: References: <20230602114756.36586-1-manivannan.sadhasivam@linaro.org> <20230602114756.36586-3-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 02, 2023 at 09:13:25PM +0900, Damien Le Moal wrote: > On 6/2/23 20:47, Manivannan Sadhasivam wrote: > > Currently, the EPF probe function doesn't get the device ID argument needed > > to correctly identify the device table ID of the EPF device. > > > > When multiple entries are added to the "struct pci_epf_device_id" table, > > the probe function needs to identify the correct one. This is achieved by > > modifying the pci_epf_match_id() function to return the match ID pointer > > and passing it to the driver's probe function. > > > > pci_epf_device_match() function can return bool based on the return value > > of pci_epf_match_id(). > > > > Reviewed-by: Kishon Vijay Abraham I > > Signed-off-by: Manivannan Sadhasivam > > [...] > > > static int pci_epf_device_match(struct device *dev, struct device_driver *drv) > > @@ -510,8 +510,12 @@ static int pci_epf_device_match(struct device *dev, struct device_driver *drv) > > struct pci_epf *epf = to_pci_epf(dev); > > struct pci_epf_driver *driver = to_pci_epf_driver(drv); > > > > - if (driver->id_table) > > - return pci_epf_match_id(driver->id_table, epf); > > + if (driver->id_table) { > > + if (pci_epf_match_id(driver->id_table, epf)) > > + return true; > > + else > > + return false; > > You prefer keeping this pattern ? > > return pci_epf_match_id(driver->id_table, epf) != NULL; > > is no much nicer ! s/no/so Yes it is, I can change it myself to spare Mani few cycles. Lorenzo > > Anyway: > > Reviewed-by: Damien Le Moal > > -- > Damien Le Moal > Western Digital Research >