Skip to contentSkip to conversation

xen/pciback: use resource_size()

PATCH In review Thomas Meyer 2 participants 2 messages Aug 6, 2011 – Aug 9, 2011 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/pciback: use resource_size()

From: Thomas Meyer <[email protected]>

Use resource_size function on resource object
instead of explicit computation.

The semantic patch that makes this output is available in scripts/coccinelle/api/resource_size.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

---

drivers/xen/xen-pciback/conf_space_header.c 2011-08-01 23:02:39.180421787 +0200 renamed from drivers/xen/xen-pciback/conf_space_header.c 2011-07-26 00:46:09.730171570 +0200 +1 -1
diff -u -p a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
@@ -187,7 +187,7 @@ static inline void read_dev_bar(struct p
 
 	bar_info->val = res[pos].start |
 			(res[pos].flags & PCI_REGION_FLAG_MASK);
-	bar_info->len_val = res[pos].end - res[pos].start + 1;
+	bar_info->len_val = resource_size(&res[pos]);
 }
 
 static void *bar_init(struct pci_dev *dev, int offset)
#1 lore raw
Quoted 10 lines · Thomas Meyer

From: Thomas Meyer <[email protected]>

Use resource_size function on resource object
instead of explicit computation.

The semantic patch that makes this output is available in scripts/coccinelle/api/resource_size.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Queued up for 3.2

Quoted 23 lines

---

diff -u -p a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c

drivers/xen/xen-pciback/conf_space_header.c 2011-08-01 23:02:39.180421787 +0200 renamed from drivers/xen/xen-pciback/conf_space_header.c 2011-07-26 00:46:09.730171570 +0200 +1 -1
@@ -187,7 +187,7 @@ static inline void read_dev_bar(struct p
 
 	bar_info->val = res[pos].start |
 			(res[pos].flags & PCI_REGION_FLAG_MASK);
-	bar_info->len_val = res[pos].end - res[pos].start + 1;
+	bar_info->len_val = resource_size(&res[pos]);
 }
 
 static void *bar_init(struct pci_dev *dev, int offset)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel