aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2017-10-12 09:07:10 +0300
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2017-10-12 09:07:10 +0300
commit9b7b3e97058c04369e4ecd27313756d58d1ec388 (patch)
tree419632f406858225ce6a0b9be68b12bf172c3b6c
parentcd04a382e56d0930f429e3af03e49b51a427a6b8 (diff)
identation fixes
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--drivers/r8169.c13
-rw-r--r--patches/linux-r8169.patch34
2 files changed, 23 insertions, 24 deletions
diff --git a/drivers/r8169.c b/drivers/r8169.c
index 64b1d3a..f77a6e3 100644
--- a/drivers/r8169.c
+++ b/drivers/r8169.c
@@ -21,7 +21,6 @@ char *rxBuffers[256];
static void print_packet(unsigned char *buffer)
{
int i;
- //unsigned int* b = (unsigned int*)buffer;
printf("%02x:%02x:%02x:%02x:%02x:%02x -> %02x:%02x:%02x:%02x:%02x:%02x [%04x]:",
buffer[6], buffer[7], buffer[8], buffer[9], buffer[10], buffer[11],
buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5],
@@ -50,7 +49,7 @@ int iomem_init(void)
/* reserve a 4GB contiguous address space and position it, if possible at 8GB */
/* no pages are actually allocated and mapped into this address space */
/* it is just making sure that overtime, we'll have 4GB contiguous */
- tmp = mmap((void*)iomem_base, 4 * 1024ULL * 1024ULL * 1024ULL,
+ tmp = mmap((void *)iomem_base, 4 * 1024ULL * 1024ULL * 1024ULL,
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS |
MAP_NORESERVE, -1, 0);
if (tmp == MAP_FAILED) {
@@ -78,7 +77,7 @@ struct iomem *iomem_alloc(int device, unsigned int size)
return NULL;
/* get a portion of the 4GB window created at init time */
- tmp = mmap((void*)iomem_current, size, PROT_READ | PROT_WRITE,
+ tmp = mmap((void *)iomem_current, size, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS | MAP_NORESERVE | MAP_FIXED, -1,
0);
if (tmp == MAP_FAILED)
@@ -134,7 +133,7 @@ static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
desc->opts1 |= cpu_to_le32(RingEnd);
}
-int rtl8169_rx_fill(int device, struct RxDesc* rxRing)
+int rtl8169_rx_fill(int device, struct RxDesc *rxRing)
{
int i;
struct iomem *packetArea;
@@ -146,7 +145,7 @@ int rtl8169_rx_fill(int device, struct RxDesc* rxRing)
for (i = 0; i < NUM_RX_DESC; i++) {
rtl8169_map_to_asic(&rxRing[i], packetArea->iova + i * 2048,
2048);
- rxBuffers[i] = (char*)(packetArea->vaddr + i * 2048);
+ rxBuffers[i] = (char *)(packetArea->vaddr + i * 2048);
}
rtl8169_mark_as_last_descriptor(&rxRing[255]);
@@ -158,7 +157,7 @@ void usage(char *name)
printf("usage: %s <group id>\n", name);
}
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
int container, group, device, i = 0;
int group_id;
@@ -167,7 +166,7 @@ int main(int argc, char* argv[])
struct vfio_iommu_type1_info iommu_info = { .argsz = sizeof(iommu_info) };
struct vfio_device_info device_info = { .argsz = sizeof(device_info) };
struct vfio_region_info region_info = { .argsz = sizeof(region_info) };
- struct RxDesc* rxRing;
+ struct RxDesc *rxRing;
if (argc != 3) {
usage(argv[0]);
diff --git a/patches/linux-r8169.patch b/patches/linux-r8169.patch
index 97c12ac..4daf6f3 100644
--- a/patches/linux-r8169.patch
+++ b/patches/linux-r8169.patch
@@ -88,7 +88,7 @@ index 8f1623b..25181fc 100644
+ union {
+ char page0[4096];
+ struct {
-+ struct net_device* netdev;
++ struct net_device *netdev;
+ /* FIXME USE A LINKED LIST */
+ int mappings_count;
+ struct iovamap mappings[128]; /* 3.5KB */
@@ -151,7 +151,7 @@ index 8f1623b..25181fc 100644
+/*
+ * libraries
+ */
-+static struct net_device *netmdev_get_netdev(struct mdev_device* mdev)
++static struct net_device *netmdev_get_netdev(struct mdev_device *mdev)
+{
+ struct netmdev *netmdev;
+
@@ -162,7 +162,7 @@ index 8f1623b..25181fc 100644
+ return netmdev->netdev;
+}
+
-+static void r8169_pause_datapath(struct net_device* netdev)
++static void r8169_pause_datapath(struct net_device *netdev)
+{
+ void __iomem *ioaddr;
+ struct rtl8169_private *tp;
@@ -177,7 +177,7 @@ index 8f1623b..25181fc 100644
+ RTL_W8(ChipCmd, RTL_R8(ChipCmd) & ~(CmdTxEnb | CmdRxEnb));
+}
+
-+static void r8169_resume_datapath(struct net_device* netdev)
++static void r8169_resume_datapath(struct net_device *netdev)
+{
+ void __iomem *ioaddr;
+ struct rtl8169_private *tp;
@@ -194,7 +194,7 @@ index 8f1623b..25181fc 100644
+ RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+}
+
-+static int r8169_get_region(struct net_device* netdev, struct vfio_region_info* info)
++static int r8169_get_region(struct net_device *netdev, struct vfio_region_info *info)
+{
+ struct rtl8169_private *tp;
+
@@ -237,8 +237,8 @@ index 8f1623b..25181fc 100644
+static ssize_t netdev_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
-+ struct mdev_device* mdev;
-+ struct net_device* netdev;
++ struct mdev_device *mdev;
++ struct net_device *netdev;
+
+ mdev = mdev_from_dev(dev);
+ if (!mdev)
@@ -316,8 +316,8 @@ index 8f1623b..25181fc 100644
+
+static int vf_netdev_remove(struct mdev_device *mdev)
+{
-+ struct netmdev* netmdev = mdev_get_drvdata(mdev);
-+ struct net_device* port;
++ struct netmdev *netmdev = mdev_get_drvdata(mdev);
++ struct net_device *port;
+
+ printk(KERN_INFO"%s %d\n", __func__, __LINE__);
+ port = netmdev_get_netdev(mdev);
@@ -330,8 +330,8 @@ index 8f1623b..25181fc 100644
+
+static int vf_netdev_open(struct mdev_device *mdev)
+{
-+ struct netmdev* netmdev = mdev_get_drvdata(mdev);
-+ struct net_device* port;
++ struct netmdev *netmdev = mdev_get_drvdata(mdev);
++ struct net_device *port;
+
+ printk(KERN_INFO"%s %d\n", __func__, __LINE__);
+ /* TODO shadow stats to netmdev */
@@ -382,7 +382,7 @@ index 8f1623b..25181fc 100644
+{
+ unsigned long minsz;
+ struct net_device *netdev;
-+ struct netmdev* netmdev;
++ struct netmdev *netmdev;
+
+ if (!mdev)
+ return -EINVAL;
@@ -411,7 +411,7 @@ index 8f1623b..25181fc 100644
+ * CONFIG_SYSFS if not possible to do it in a generic way, plan
+ * for a callback
+ */
-+ /* rx_ring and tx_ring*/
++ /* rx_ring and tx_ring */
+ info.num_regions = VFIO_PCI_NUM_REGIONS + netdev->num_tx_queues + 1;
+ info.num_irqs = 1;
+
@@ -447,7 +447,7 @@ index 8f1623b..25181fc 100644
+ struct vfio_iommu_type1_dma_map map;
+ struct vm_area_struct *vma;
+ void *data;
-+ struct device* parent_dev;
++ struct device *parent_dev;
+ int node;
+ dma_addr_t mapping;
+ int ret = -EINVAL;
@@ -553,7 +553,7 @@ index 8f1623b..25181fc 100644
+static int vf_netdev_mmap(struct mdev_device *mdev,
+ struct vm_area_struct *vma)
+{
-+ struct net_device* netdev;
++ struct net_device *netdev;
+ struct rtl8169_private *tp;
+ u64 req_len;
+ int ret = 0;
@@ -583,11 +583,11 @@ index 8f1623b..25181fc 100644
+ //vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+ ret = remap_pfn_range(vma, vma->vm_start,
-+ virt_to_phys((void*)(vma->vm_pgoff << PAGE_SHIFT)) >> PAGE_SHIFT,
++ virt_to_phys((void *)(vma->vm_pgoff << PAGE_SHIFT)) >> PAGE_SHIFT,
+ req_len, vma->vm_page_prot);
+
+ printk(KERN_INFO"vfnetdev_map %lx, @%llx, %lld:%d\n",
-+ vma->vm_start, virt_to_phys((void*)(vma->vm_pgoff << PAGE_SHIFT)),
++ vma->vm_start, virt_to_phys((void *)(vma->vm_pgoff << PAGE_SHIFT)),
+ req_len, ret);
+
+ return ret;