Skip to content

Commit f956c1b

Browse files
lonyelonjgross1
authored andcommitted
xen/pcifront: Removed unnecessary __ref annotation
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éns Iglesias <sergio@lony.xyz> Reviewed-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20210830175305.13370-1-sergio@lony.xyz Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 1a0df28 commit f956c1b

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

drivers/pci/xen-pcifront.c

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int do_pci_op(struct pcifront_device *pdev, struct xen_pci_op *op)
115115
struct xen_pci_op *active_op = &pdev->sh_info->op;
116116
unsigned long irq_flags;
117117
evtchn_port_t port = pdev->evtchn;
118-
unsigned irq = pdev->irq;
118+
unsigned int irq = pdev->irq;
119119
s64 ns, ns_timeout;
120120

121121
spin_lock_irqsave(&pdev->sh_info_lock, irq_flags);
@@ -153,10 +153,10 @@ static int do_pci_op(struct pcifront_device *pdev, struct xen_pci_op *op)
153153
}
154154

155155
/*
156-
* We might lose backend service request since we
157-
* reuse same evtchn with pci_conf backend response. So re-schedule
158-
* aer pcifront service.
159-
*/
156+
* We might lose backend service request since we
157+
* reuse same evtchn with pci_conf backend response. So re-schedule
158+
* aer pcifront service.
159+
*/
160160
if (test_bit(_XEN_PCIB_active,
161161
(unsigned long *)&pdev->sh_info->flags)) {
162162
dev_err(&pdev->xdev->dev,
@@ -414,7 +414,8 @@ static int pcifront_scan_bus(struct pcifront_device *pdev,
414414
struct pci_dev *d;
415415
unsigned int devfn;
416416

417-
/* Scan the bus for functions and add.
417+
/*
418+
* Scan the bus for functions and add.
418419
* We omit handling of PCI bridge attachment because pciback prevents
419420
* bridges from being exported.
420421
*/
@@ -492,8 +493,10 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
492493

493494
list_add(&bus_entry->list, &pdev->root_buses);
494495

495-
/* pci_scan_root_bus skips devices which do not have a
496-
* devfn==0. The pcifront_scan_bus enumerates all devfn. */
496+
/*
497+
* pci_scan_root_bus skips devices which do not have a
498+
* devfn==0. The pcifront_scan_bus enumerates all devfn.
499+
*/
497500
err = pcifront_scan_bus(pdev, domain, bus, b);
498501

499502
/* Claim resources before going "live" with our devices */
@@ -651,8 +654,10 @@ static void pcifront_do_aer(struct work_struct *data)
651654
pci_channel_state_t state =
652655
(pci_channel_state_t)pdev->sh_info->aer_op.err;
653656

654-
/*If a pci_conf op is in progress,
655-
we have to wait until it is done before service aer op*/
657+
/*
658+
* If a pci_conf op is in progress, we have to wait until it is done
659+
* before service aer op
660+
*/
656661
dev_dbg(&pdev->xdev->dev,
657662
"pcifront service aer bus %x devfn %x\n",
658663
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)
676681
static irqreturn_t pcifront_handler_aer(int irq, void *dev)
677682
{
678683
struct pcifront_device *pdev = dev;
684+
679685
schedule_pcifront_aer_op(pdev);
680686
return IRQ_HANDLED;
681687
}
@@ -1027,6 +1033,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
10271033
/* Find devices being detached and remove them. */
10281034
for (i = 0; i < num_devs; i++) {
10291035
int l, state;
1036+
10301037
l = snprintf(str, sizeof(str), "state-%d", i);
10311038
if (unlikely(l >= (sizeof(str) - 1))) {
10321039
err = -ENOMEM;
@@ -1078,7 +1085,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
10781085
return err;
10791086
}
10801087

1081-
static void __ref pcifront_backend_changed(struct xenbus_device *xdev,
1088+
static void pcifront_backend_changed(struct xenbus_device *xdev,
10821089
enum xenbus_state be_state)
10831090
{
10841091
struct pcifront_device *pdev = dev_get_drvdata(&xdev->dev);
@@ -1137,6 +1144,7 @@ static int pcifront_xenbus_probe(struct xenbus_device *xdev,
11371144
static int pcifront_xenbus_remove(struct xenbus_device *xdev)
11381145
{
11391146
struct pcifront_device *pdev = dev_get_drvdata(&xdev->dev);
1147+
11401148
if (pdev)
11411149
free_pdev(pdev);
11421150

0 commit comments

Comments
 (0)