xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 1/2] libxc: Remove hard tabs which ought to be 4 spaces
Date: Tue, 17 Dec 2013 16:21:57 +0000	[thread overview]
Message-ID: <1387297318-11893-2-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1387297318-11893-1-git-send-email-ian.jackson@eu.citrix.com>

Some of the files in libxc have hard tabs.  Many (but not all) of
libxc's files have an emacs local variable section declaring tab-width
to be 4.

Of the files which have both of these properties, some of the tabs are
supposed to stand for 4 spaces and some of them 8.

Replace the ones where they are supposed to stand for 4 spaces with
actual spaces.  After this patch the only hard tabs in libxc are ones
which expect to expand to 8 spaces.  This will allow us to remove the
tab-width settings.

I'm not fixing the 8-space tabs to avoid needless whitespace churn.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_compression.c    |    2 +-
 tools/libxc/xc_domain_restore.c |    2 +-
 tools/libxc/xc_gnttab.c         |   20 ++++++++++----------
 tools/libxc/xc_linux_osdep.c    |    6 +++---
 tools/libxc/xc_minios.c         |   22 +++++++++++-----------
 tools/libxc/xc_netbsd.c         |   10 +++++-----
 6 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/tools/libxc/xc_compression.c b/tools/libxc/xc_compression.c
index 8f0b89d..74c4c5d 100644
--- a/tools/libxc/xc_compression.c
+++ b/tools/libxc/xc_compression.c
@@ -226,7 +226,7 @@ char *get_cache_page(comp_ctx *ctx, xen_pfn_t pfn,
         ctx->pfn2cache[pfn] = item;
     }
         
-    /* 	if requested item is in cache move to head of list */
+    /* if requested item is in cache move to head of list */
     if (item != ctx->page_list_head)
     {
         if (item == ctx->page_list_tail)
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index 80769a7..7ffa15d 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -2200,7 +2200,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     /* clear any pending events and the selector */
     MEMSET_ARRAY_FIELD(new_shared_info, evtchn_pending, 0);
     for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
-	    SET_FIELD(new_shared_info, vcpu_info[i].evtchn_pending_sel, 0);
+        SET_FIELD(new_shared_info, vcpu_info[i].evtchn_pending_sel, 0);
 
     /* mask event channels */
     MEMSET_ARRAY_FIELD(new_shared_info, evtchn_mask, 0xff);
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 79dab40..f3c4b8e 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -191,22 +191,22 @@ int xc_gnttab_munmap(xc_gnttab *xcg,
                      void *start_address,
                      uint32_t count)
 {
-	return xcg->ops->u.gnttab.munmap(xcg, xcg->ops_handle,
-					 start_address, count);
+    return xcg->ops->u.gnttab.munmap(xcg, xcg->ops_handle,
+                                     start_address, count);
 }
 
 int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count)
 {
-	if (!xcg->ops->u.gnttab.set_max_grants)
-		return 0;
-	return xcg->ops->u.gnttab.set_max_grants(xcg, xcg->ops_handle, count);
+    if (!xcg->ops->u.gnttab.set_max_grants)
+        return 0;
+    return xcg->ops->u.gnttab.set_max_grants(xcg, xcg->ops_handle, count);
 }
 
 void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
                             int count, uint32_t *refs, int writable)
 {
-	return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle, domid,
-	                                      count, refs, writable, -1, -1);
+    return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle, domid,
+                                          count, refs, writable, -1, -1);
 }
 
 void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
@@ -214,7 +214,7 @@ void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
                                   uint32_t notify_offset,
                                   evtchn_port_t notify_port)
 {
-	return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle,
+    return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle,
 			domid, 1, ref, writable, notify_offset, notify_port);
 }
 
@@ -224,8 +224,8 @@ void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
  */
 int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count)
 {
-	return xcg->ops->u.gntshr.munmap(xcg, xcg->ops_handle,
-					 start_address, count);
+    return xcg->ops->u.gntshr.munmap(xcg, xcg->ops_handle,
+                                     start_address, count);
 }
 
 
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 73860a2..87c0936 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -808,9 +808,9 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
         err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
     if (err) {
         PERROR("linux_gntshr_share_page_notify: ioctl SET_UNMAP_NOTIFY failed");
-		munmap(area, count * XC_PAGE_SIZE);
-		area = NULL;
-	}
+        munmap(area, count * XC_PAGE_SIZE);
+        area = NULL;
+    }
 
     memcpy(refs, gref_info->gref_ids, count * sizeof(uint32_t));
 
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index dec4d73..d35e3ec 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -89,13 +89,13 @@ static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
 
     call.op = hypercall->op;
     for (i = 0; i < sizeof(hypercall->arg) / sizeof(*hypercall->arg); i++)
-	call.args[i] = hypercall->arg[i];
+        call.args[i] = hypercall->arg[i];
 
     ret = HYPERVISOR_multicall(&call, 1);
 
     if (ret < 0) {
-	errno = -ret;
-	return -1;
+        errno = -ret;
+        return -1;
     }
     if ((long) call.result < 0) {
         errno = - (long) call.result;
@@ -110,9 +110,9 @@ static void *minios_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
+        pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
+        pt_prot = L1_PROT;
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);    
 }
 
@@ -126,9 +126,9 @@ static void *minios_privcmd_map_foreign_batch(xc_interface *xch,  xc_osdep_handl
     unsigned long addr;
 
     if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
+        pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
+        pt_prot = L1_PROT;
 
     addr = (unsigned long) map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
     for (i = 0; i < num; i++) {
@@ -146,9 +146,9 @@ static void *minios_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle
     unsigned long pt_prot = 0;
 
     if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
+        pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
+        pt_prot = L1_PROT;
 
     assert(!(size % getpagesize()));
     return map_frames_ex(&mfn, size / getpagesize(), 0, 1, 1, dom, NULL, pt_prot);
@@ -165,9 +165,9 @@ static void *minios_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
     void *ret;
 
     if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
+        pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
+        pt_prot = L1_PROT;
 
     mfns = malloc((size / XC_PAGE_SIZE) * sizeof(*mfns));
 
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 8a90ef3..9a831ce 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -181,11 +181,11 @@ static void *netbsd_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
 
 	addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
 	if (addr == MAP_FAILED)
-		goto mmap_failed;
+            goto mmap_failed;
 
 	for (i = 0; i < nentries; i++) {
-		entries[i].va = (uintptr_t)addr + (i * chunksize);
-		entries[i].npages = chunksize >> XC_PAGE_SHIFT;
+            entries[i].va = (uintptr_t)addr + (i * chunksize);
+            entries[i].npages = chunksize >> XC_PAGE_SHIFT;
 	}
 
 	ioctlx.num   = nentries;
@@ -194,14 +194,14 @@ static void *netbsd_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
 
 	rc = ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
 	if (rc)
-		goto ioctl_failed;
+            goto ioctl_failed;
 
 	return addr;
 
 ioctl_failed:
 	rc = munmap(addr, size);
 	if (rc == -1)
-		ERROR("%s: error in error path\n", __FUNCTION__);
+            ERROR("%s: error in error path\n", __FUNCTION__);
 
 mmap_failed:
 	return NULL;
-- 
1.7.10.4

  reply	other threads:[~2013-12-17 16:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 16:21 [PATCH 0/2] libxc: Fix some whitespace/tab-width problems Ian Jackson
2013-12-17 16:21 ` Ian Jackson [this message]
2013-12-17 16:44   ` [PATCH 1/2] libxc: Remove hard tabs which ought to be 4 spaces Ian Campbell
2013-12-17 16:21 ` [PATCH 2/2] libxc: Remove "tab-width: 8" from emacs local variables sections Ian Jackson
2013-12-17 16:47   ` Ian Campbell
2013-12-18 11:53 ` git-filter-branch automatic CC adding script Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387297318-11893-2-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).