Skip to content

Commit

Permalink
xen/pcifront: Removed unnecessary __ref annotation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergio Miguéns Iglesias authored and Juergen Gross committed Sep 1, 2021
1 parent 1a0df28 commit f956c1b
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions drivers/pci/xen-pcifront.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static int do_pci_op(struct pcifront_device *pdev, struct xen_pci_op *op)
struct xen_pci_op *active_op = &pdev->sh_info->op;
unsigned long irq_flags;
evtchn_port_t port = pdev->evtchn;
unsigned irq = pdev->irq;
unsigned int irq = pdev->irq;
s64 ns, ns_timeout;

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

/*
* 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,
Expand Down Expand Up @@ -414,7 +414,8 @@ static int pcifront_scan_bus(struct pcifront_device *pdev,
struct pci_dev *d;
unsigned int devfn;

/* 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.
*/
Expand Down Expand Up @@ -492,8 +493,10 @@ static int pcifront_scan_root(struct pcifront_device *pdev,

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

/* pci_scan_root_bus skips devices which do not have a
* devfn==0. The pcifront_scan_bus enumerates all devfn. */
/*
* pci_scan_root_bus skips devices which do not have a
* devfn==0. The pcifront_scan_bus enumerates all devfn.
*/
err = pcifront_scan_bus(pdev, domain, bus, b);

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

/*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);
Expand All @@ -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 = dev;

schedule_pcifront_aer_op(pdev);
return IRQ_HANDLED;
}
Expand Down Expand Up @@ -1027,6 +1033,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
/* Find devices being detached and remove them. */
for (i = 0; i < num_devs; i++) {
int l, state;

l = snprintf(str, sizeof(str), "state-%d", i);
if (unlikely(l >= (sizeof(str) - 1))) {
err = -ENOMEM;
Expand Down Expand Up @@ -1078,7 +1085,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
return err;
}

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 = dev_get_drvdata(&xdev->dev);
Expand Down Expand Up @@ -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 = dev_get_drvdata(&xdev->dev);

if (pdev)
free_pdev(pdev);

Expand Down

0 comments on commit f956c1b

Please sign in to comment.