From nobody Fri May 3 02:33:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1630338826; cv=none; d=zohomail.com; s=zohoarc; b=FBbqhhMCYBmU7k4U1wZ8NGW0kP1x3WJuOdZ5Tp0LKapP+E77eqxyk2dAfLdeYY2NWwUxy3ZWkhpzLEFv1z9elDlm+WQByTOoriPXC0B16gWG4kPHsfa8wQYemQNEYHxYygX19TszPl0Q/+s9V3SfAp5QxG0SPhKQx/uS6oVJ02s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630338826; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LZTTwFJF+zvGHdyibVGAvdJNHkDefebmF2ya6xkkbwE=; b=OoUUpBH1CuzUIweM5EAxaU09NtLGz1elPkDBagX5Pl/8pQYR8oO4TVtXMk35sGEhF1j8rQEAgbdEzAl+FFJXLVl/XZgSinpRXOebs+Yzm05PbYbGjUObw8IW3C2RcaDWemADLzL9bXq+5fo76SiVyRQ52mPui/d5lR22n7QEM0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1630338826587724.2028773728799; Mon, 30 Aug 2021 08:53:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.175178.319206 (Exim 4.92) (envelope-from ) id 1mKjbI-0001uU-3n; Mon, 30 Aug 2021 15:53:32 +0000 Received: by outflank-mailman (output) from mailman id 175178.319206; Mon, 30 Aug 2021 15:53:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mKjbI-0001uN-0m; Mon, 30 Aug 2021 15:53:32 +0000 Received: by outflank-mailman (input) for mailman id 175178; Mon, 30 Aug 2021 15:53:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mKjbH-0001uH-At for xen-devel@lists.xenproject.org; Mon, 30 Aug 2021 15:53:31 +0000 Received: from mail-ej1-x631.google.com (unknown [2a00:1450:4864:20::631]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 25290de2-625f-49b0-af51-b935c6ac61d5; Mon, 30 Aug 2021 15:53:30 +0000 (UTC) Received: by mail-ej1-x631.google.com with SMTP id mf2so32136849ejb.9 for ; Mon, 30 Aug 2021 08:53:30 -0700 (PDT) Received: from localhost.localdomain (host-79-37-188-60.retail.telecomitalia.it. [79.37.188.60]) by smtp.gmail.com with ESMTPSA id o26sm6982569eje.24.2021.08.30.08.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 08:53:29 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 25290de2-625f-49b0-af51-b935c6ac61d5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LZTTwFJF+zvGHdyibVGAvdJNHkDefebmF2ya6xkkbwE=; b=OrrCxmJej7+ig4i1srOE7VMVkeDpS9cakUwSxm2PgKW0SKIhtk9YTr8Kjvt8STi+mf x9o/QFBriMovGg3TMJpTwWYB9dEC9pDYyILpbrlSivt5HNxVeG0NihF+uux9vNUA6CcC QZ0S4+/ZA9UjECBx3ztjhnTbWnpaTEExsr2R0oqiKJ7lW77S5S6su5QEzC1c+cR0E3pW gQ5y8RGdXc+Sgzzk1AJPm/5exbEEXvqBYjTTowg74polMwbz22etysgrPnX06h8reEUu tKM4hC7j0jxHaa44aS/cOeeKczpkmIbyvN1+SWJRwRjihDnaRjnFaXs23sL2LonBsG4T 8zyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LZTTwFJF+zvGHdyibVGAvdJNHkDefebmF2ya6xkkbwE=; b=P2C09/MNFP6uAq0mMnHelkzHaZBvmOCeXCl9hwrptdk0J0ijIU1r46HsYQETwTsDoP l6ejsE+SvTBfulwK2eTmf2yoLuxGXi4Xrb1IqwtQL/Q82C/WRJsydTsFQBAOlDtGWDW0 epZZP9649G3QQjJDS6jxBAFhg2r5lKSDpD90moFiU15sZEAAkHmuVYDn7r77gOrEXtH8 K6q9MVbPQLoO06UMrfZ08qRaNkjUKXaKVZ+/fKIl7HCfZkHXyljF/SI0JZbMjR2fAsIl KKkdJX24AOaKgx2iq2oecA4lCorRHQs3Ki2K0PKoxgqHliF+tbGZRRQiOrJci1B1wcwO kGWQ== X-Gm-Message-State: AOAM530PAjVCib0pH4uH3QQQIGbhvLzc9Vswq01g7TdoOzAODjJZsWRM J8SJNcTfijm3V4foSHNpm/Q= X-Google-Smtp-Source: ABdhPJybPVfFJ0VfPXkN/ghxef8t28WfmUnSzRrbQ4yuUnvBgvPKJyy8F7HZBA+jg9ihxbpVb2YQCw== X-Received: by 2002:a17:906:a044:: with SMTP id bg4mr25947563ejb.312.1630338809554; Mon, 30 Aug 2021 08:53:29 -0700 (PDT) From: "=?UTF-8?q?Sergio=20Migu=C3=A9ns=20Iglesias?=" X-Google-Original-From: =?UTF-8?q?Sergio=20Migu=C3=A9ns=20Iglesias?= To: konrad.wilk@oracle.com Cc: boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, bhelgaas@google.com, xen-devel@lists.xenproject.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Sergio=20Migu=C3=A9ns=20Iglesias?= Subject: [PATCH v2] xen/pcifront: Removed unnecessary __ref annotation Date: Mon, 30 Aug 2021 19:53:05 +0200 Message-Id: <20210830175305.13370-1-sergio@lony.xyz> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1630338828332100001 An unnecessary "__ref" annotation was removed from the "drivers/pci/xen_pcifront.c" file. The function where the annotation was used was "pcifront_backend_changed()", which does not call any functions annotated as "__*init" nor "__*exit". This makes "__ref" unnecessary since this annotation is used to make the compiler ignore section miss-matches when they are not happening here in the first place. In addition to the aforementioned change, some code style issues were fixed in the same file. Signed-off-by: Sergio Migu=C3=A9ns Iglesias Reviewed-by: Juergen Gross --- drivers/pci/xen-pcifront.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index b7a8f3a1921f..427041c1e408 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -115,7 +115,7 @@ static int do_pci_op(struct pcifront_device *pdev, stru= ct xen_pci_op *op) struct xen_pci_op *active_op =3D &pdev->sh_info->op; unsigned long irq_flags; evtchn_port_t port =3D pdev->evtchn; - unsigned irq =3D pdev->irq; + unsigned int irq =3D pdev->irq; s64 ns, ns_timeout; =20 spin_lock_irqsave(&pdev->sh_info_lock, irq_flags); @@ -153,10 +153,10 @@ static int do_pci_op(struct pcifront_device *pdev, st= ruct xen_pci_op *op) } =20 /* - * We might lose backend service request since we - * reuse same evtchn with pci_conf backend response. So re-schedule - * aer pcifront service. - */ + * We might lose backend service request since we + * reuse same evtchn with pci_conf backend response. So re-schedule + * aer pcifront service. + */ if (test_bit(_XEN_PCIB_active, (unsigned long *)&pdev->sh_info->flags)) { dev_err(&pdev->xdev->dev, @@ -414,7 +414,8 @@ static int pcifront_scan_bus(struct pcifront_device *pd= ev, struct pci_dev *d; unsigned int devfn; =20 - /* Scan the bus for functions and add. + /* + * Scan the bus for functions and add. * We omit handling of PCI bridge attachment because pciback prevents * bridges from being exported. */ @@ -492,8 +493,10 @@ static int pcifront_scan_root(struct pcifront_device *= pdev, =20 list_add(&bus_entry->list, &pdev->root_buses); =20 - /* pci_scan_root_bus skips devices which do not have a - * devfn=3D=3D0. The pcifront_scan_bus enumerates all devfn. */ + /* + * pci_scan_root_bus skips devices which do not have a + * devfn=3D=3D0. The pcifront_scan_bus enumerates all devfn. + */ err =3D pcifront_scan_bus(pdev, domain, bus, b); =20 /* Claim resources before going "live" with our devices */ @@ -651,8 +654,10 @@ static void pcifront_do_aer(struct work_struct *data) pci_channel_state_t state =3D (pci_channel_state_t)pdev->sh_info->aer_op.err; =20 - /*If a pci_conf op is in progress, - we have to wait until it is done before service aer op*/ + /* + * If a pci_conf op is in progress, we have to wait until it is done + * before service aer op + */ dev_dbg(&pdev->xdev->dev, "pcifront service aer bus %x devfn %x\n", pdev->sh_info->aer_op.bus, pdev->sh_info->aer_op.devfn); @@ -676,6 +681,7 @@ static void pcifront_do_aer(struct work_struct *data) static irqreturn_t pcifront_handler_aer(int irq, void *dev) { struct pcifront_device *pdev =3D dev; + schedule_pcifront_aer_op(pdev); return IRQ_HANDLED; } @@ -1027,6 +1033,7 @@ static int pcifront_detach_devices(struct pcifront_de= vice *pdev) /* Find devices being detached and remove them. */ for (i =3D 0; i < num_devs; i++) { int l, state; + l =3D snprintf(str, sizeof(str), "state-%d", i); if (unlikely(l >=3D (sizeof(str) - 1))) { err =3D -ENOMEM; @@ -1078,7 +1085,7 @@ static int pcifront_detach_devices(struct pcifront_de= vice *pdev) return err; } =20 -static void __ref pcifront_backend_changed(struct xenbus_device *xdev, +static void pcifront_backend_changed(struct xenbus_device *xdev, enum xenbus_state be_state) { struct pcifront_device *pdev =3D dev_get_drvdata(&xdev->dev); @@ -1137,6 +1144,7 @@ static int pcifront_xenbus_probe(struct xenbus_device= *xdev, static int pcifront_xenbus_remove(struct xenbus_device *xdev) { struct pcifront_device *pdev =3D dev_get_drvdata(&xdev->dev); + if (pdev) free_pdev(pdev); =20 --=20 2.33.0