|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/2] libxc: Remove hard tabs which ought to be 4 spaces
On Tue, 2013-12-17 at 16:21 +0000, Ian Jackson wrote:
> 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.
It's it a bit late for that after this patch? Given there is already
pain here I'd rather just rip the plaster off all at once...
>
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
> 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, ¬ify);
> 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;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |