libxc: Fix some whitespace/tab-width problems
cover libxc: Fix some whitespace/tab-width problems
I have here two interrelated whitespace formatting fixes for libxc:
1/2 libxc: Remove hard tabs which ought to be 4 spaces 2/2 libxc: Remove "tab-width: 8" from emacs local variables
There is no functional change, as is easily verifiable.
I would like to propose these for a freeze exception for Xen 4.4, on the basis that it will make it marginally easier to port future patches to 4.4 if we don't have to deal with whitespace conflicts.
PATCH 1/2 libxc: Remove hard tabs which ought to be 4 spaces
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.
--- 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(-)
tools/libxc/xc_compression.c +1 -1
@@ -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)
tools/libxc/xc_domain_restore.c +1 -1
@@ -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 );
tools/libxc/xc_gnttab.c +10 -10
@@ -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); }
tools/libxc/xc_linux_osdep.c +3 -3
@@ -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 ));
tools/libxc/xc_minios.c +11 -11
@@ -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_handlunsigned 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_handleunsigned 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_handlvoid *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));
tools/libxc/xc_netbsd.c +5 -5
@@ -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 ;
Signature · 1 line
1.7.10.4
Re: [PATCH 1/2] libxc: Remove hard tabs which ought to be 4 spaces
Quoted 7 lines · Ian Jackson
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.
Quoted 6 lines
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...
Quoted 215 lines
Signed-off-by Ian Jackson <[email protected]>CC Stefano Stabellini <[email protected]>CC Ian Campbell <[email protected]>--- 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(-)tools/libxc/xc_compression.c +1
-1@@ -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)tools/libxc/xc_domain_restore.c +1
-1@@ -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 );tools/libxc/xc_gnttab.c +10
-10@@ -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); }tools/libxc/xc_linux_osdep.c +3
-3@@ -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 ));tools/libxc/xc_minios.c +11
-11@@ -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_handlunsigned 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_handleunsigned 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_handlvoid *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));tools/libxc/xc_netbsd.c +5
-5@@ -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 ;
PATCH 2/2 libxc: Remove "tab-width: 8" from emacs local variables sections
In reply to Ian JacksonTabs must universally expand to 8 spaces. All the (remaining) hard tabs in libxc expect this. Attempting to define an alternative setting is simply wrong because not all tools (or indeed all emacsen) will respect it.
--- tools/libxc/xc_compression.c | 1 - tools/libxc/xc_core.c | 1 - tools/libxc/xc_core.h | 1 - tools/libxc/xc_core_arm.c | 1 - tools/libxc/xc_core_arm.h | 1 - tools/libxc/xc_core_x86.c | 1 - tools/libxc/xc_core_x86.h | 1 - tools/libxc/xc_dom.h | 1 - tools/libxc/xc_dom_arm.c | 1 - tools/libxc/xc_dom_armzimageloader.c | 1 - tools/libxc/xc_dom_binloader.c | 1 - tools/libxc/xc_dom_boot.c | 1 - tools/libxc/xc_dom_bzimageloader.c | 1 - tools/libxc/xc_dom_compat_linux.c | 1 - tools/libxc/xc_dom_core.c | 1 - tools/libxc/xc_dom_elfloader.c | 1 - tools/libxc/xc_dom_x86.c | 1 - tools/libxc/xc_domain.c | 1 - tools/libxc/xc_domain_restore.c | 1 - tools/libxc/xc_domain_save.c | 1 - tools/libxc/xc_evtchn.c | 1 - tools/libxc/xc_flask.c | 1 - tools/libxc/xc_foreign_memory.c | 1 - tools/libxc/xc_gnttab.c | 1 - tools/libxc/xc_hcall_buf.c | 1 - tools/libxc/xc_hvm_build_arm.c | 1 - tools/libxc/xc_hvm_build_x86.c | 1 - tools/libxc/xc_linux.c | 1 - tools/libxc/xc_linux_osdep.c | 1 - tools/libxc/xc_minios.c | 1 - tools/libxc/xc_misc.c | 1 - tools/libxc/xc_netbsd.c | 1 - tools/libxc/xc_nomigrate.c | 1 - tools/libxc/xc_pagetab.c | 1 - tools/libxc/xc_private.c | 1 - tools/libxc/xc_solaris.c | 1 - tools/libxc/xc_tmem.c | 1 - tools/libxc/xenctrl_osdep_ENOSYS.c | 1 - tools/libxc/xenctrlosdep.h | 1 - tools/libxc/xg_private.c | 1 - 40 files changed, 40 deletions(-)
tools/libxc/xc_compression.c +0 -1
@@ -541,7 +541,6 @@ error:* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_core.c +0 -1
@@ -974,7 +974,6 @@ xc_domain_dumpcore(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_core.h +0 -1
@@ -168,7 +168,6 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_core_arm.c +0 -1
@@ -101,7 +101,6 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_core_arm.h +0 -1
@@ -54,7 +54,6 @@ xc_core_arch_context_get_shdr(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_core_x86.c +0 -1
@@ -214,7 +214,6 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_core_x86.h +0 -1
@@ -55,7 +55,6 @@ xc_core_arch_context_get_shdr(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom.h +0 -1
@@ -375,7 +375,6 @@ int arch_setup_bootlate(struct xc_dom_image *dom);* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_arm.c +0 -1
@@ -326,7 +326,6 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_armzimageloader.c +0 -1
@@ -258,7 +258,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_binloader.c +0 -1
@@ -324,7 +324,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_boot.c +0 -1
@@ -436,7 +436,6 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_bzimageloader.c +0 -1
@@ -781,7 +781,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_compat_linux.c +0 -1
@@ -192,7 +192,6 @@ int xc_dom_linux_build(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_core.c +0 -1
@@ -1028,7 +1028,6 @@ int xc_dom_build_image(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_elfloader.c +0 -1
@@ -428,7 +428,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_dom_x86.c +0 -1
@@ -955,7 +955,6 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_domain.c +0 -1
@@ -1781,7 +1781,6 @@ int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_domain_restore.c +0 -1
@@ -2363,7 +2363,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_domain_save.c +0 -1
@@ -2140,7 +2140,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_evtchn.c +0 -1
@@ -128,7 +128,6 @@ int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_flask.c +0 -1
@@ -437,7 +437,6 @@ int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_foreign_memory.c +0 -1
@@ -126,7 +126,6 @@ void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_gnttab.c +0 -1
@@ -234,7 +234,6 @@ int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_hcall_buf.c +0 -1
@@ -306,7 +306,6 @@ void xc_hypercall_buffer_array_destroy(xc_interface *xc,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_hvm_build_arm.c +0 -1
@@ -43,7 +43,6 @@ int xc_hvm_build_target_mem(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_hvm_build_x86.c +0 -1
@@ -608,7 +608,6 @@ int xc_hvm_build_target_mem(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_linux.c +0 -1
@@ -72,7 +72,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_linux_osdep.c +0 -1
@@ -871,7 +871,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_minios.c +0 -1
@@ -545,7 +545,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_misc.c +0 -1
@@ -694,7 +694,6 @@ int xc_hvm_inject_trap(* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_netbsd.c +0 -1
@@ -414,7 +414,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_nomigrate.c +0 -1
@@ -48,7 +48,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_pagetab.c +0 -1
@@ -106,7 +106,6 @@ unsigned long xc_translate_foreign_address(xc_interface *xch, uint32_t dom,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_private.c +0 -1
@@ -891,7 +891,6 @@ int xc_ffs64(uint64_t x)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_solaris.c +0 -1
@@ -343,7 +343,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xc_tmem.c +0 -1
@@ -523,7 +523,6 @@ int xc_tmem_restore_extra(xc_interface *xch, int dom, int io_fd)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xenctrl_osdep_ENOSYS.c +0 -1
@@ -200,7 +200,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xenctrlosdep.h +0 -1
@@ -166,7 +166,6 @@ void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code, const cha* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
tools/libxc/xg_private.c +0 -1
@@ -203,7 +203,6 @@ __attribute__((weak))* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] libxc: Remove "tab-width: 8" from emacs local variables sections
Quoted 8 lines · Ian Jackson
Tabs must universally expand to 8 spaces. All the (remaining) hard tabs in libxc expect this. Attempting to define an alternative setting is simply wrong because not all tools (or indeed all emacsen) will respect it.
Signed-off-by Ian Jackson <[email protected]>CC Stefano Stabellini <[email protected]>CC Ian Campbell <[email protected]>
Lots of the hypervisor files have this similarly wrong :-( This patch is right as far as it goes:
Quoted 523 lines
--- tools/libxc/xc_compression.c | 1 - tools/libxc/xc_core.c | 1 - tools/libxc/xc_core.h | 1 - tools/libxc/xc_core_arm.c | 1 - tools/libxc/xc_core_arm.h | 1 - tools/libxc/xc_core_x86.c | 1 - tools/libxc/xc_core_x86.h | 1 - tools/libxc/xc_dom.h | 1 - tools/libxc/xc_dom_arm.c | 1 - tools/libxc/xc_dom_armzimageloader.c | 1 - tools/libxc/xc_dom_binloader.c | 1 - tools/libxc/xc_dom_boot.c | 1 - tools/libxc/xc_dom_bzimageloader.c | 1 - tools/libxc/xc_dom_compat_linux.c | 1 - tools/libxc/xc_dom_core.c | 1 - tools/libxc/xc_dom_elfloader.c | 1 - tools/libxc/xc_dom_x86.c | 1 - tools/libxc/xc_domain.c | 1 - tools/libxc/xc_domain_restore.c | 1 - tools/libxc/xc_domain_save.c | 1 - tools/libxc/xc_evtchn.c | 1 - tools/libxc/xc_flask.c | 1 - tools/libxc/xc_foreign_memory.c | 1 - tools/libxc/xc_gnttab.c | 1 - tools/libxc/xc_hcall_buf.c | 1 - tools/libxc/xc_hvm_build_arm.c | 1 - tools/libxc/xc_hvm_build_x86.c | 1 - tools/libxc/xc_linux.c | 1 - tools/libxc/xc_linux_osdep.c | 1 - tools/libxc/xc_minios.c | 1 - tools/libxc/xc_misc.c | 1 - tools/libxc/xc_netbsd.c | 1 - tools/libxc/xc_nomigrate.c | 1 - tools/libxc/xc_pagetab.c | 1 - tools/libxc/xc_private.c | 1 - tools/libxc/xc_solaris.c | 1 - tools/libxc/xc_tmem.c | 1 - tools/libxc/xenctrl_osdep_ENOSYS.c | 1 - tools/libxc/xenctrlosdep.h | 1 - tools/libxc/xg_private.c | 1 - 40 files changed, 40 deletions(-)tools/libxc/xc_compression.c +0
-1@@ -541,7 +541,6 @@ error:* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_core.c +0
-1@@ -974,7 +974,6 @@ xc_domain_dumpcore(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_core.h +0
-1@@ -168,7 +168,6 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_core_arm.c +0
-1@@ -101,7 +101,6 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_core_arm.h +0
-1@@ -54,7 +54,6 @@ xc_core_arch_context_get_shdr(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_core_x86.c +0
-1@@ -214,7 +214,6 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_core_x86.h +0
-1@@ -55,7 +55,6 @@ xc_core_arch_context_get_shdr(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom.h +0
-1@@ -375,7 +375,6 @@ int arch_setup_bootlate(struct xc_dom_image *dom);* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_arm.c +0
-1@@ -326,7 +326,6 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_armzimageloader.c +0
-1@@ -258,7 +258,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_binloader.c +0
-1@@ -324,7 +324,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_boot.c +0
-1@@ -436,7 +436,6 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_bzimageloader.c +0
-1@@ -781,7 +781,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_compat_linux.c +0
-1@@ -192,7 +192,6 @@ int xc_dom_linux_build(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_core.c +0
-1@@ -1028,7 +1028,6 @@ int xc_dom_build_image(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_elfloader.c +0
-1@@ -428,7 +428,6 @@ static void __init register_loader(void)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_dom_x86.c +0
-1@@ -955,7 +955,6 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_domain.c +0
-1@@ -1781,7 +1781,6 @@ int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_domain_restore.c +0
-1@@ -2363,7 +2363,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_domain_save.c +0
-1@@ -2140,7 +2140,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_evtchn.c +0
-1@@ -128,7 +128,6 @@ int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_flask.c +0
-1@@ -437,7 +437,6 @@ int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_foreign_memory.c +0
-1@@ -126,7 +126,6 @@ void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_gnttab.c +0
-1@@ -234,7 +234,6 @@ int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_hcall_buf.c +0
-1@@ -306,7 +306,6 @@ void xc_hypercall_buffer_array_destroy(xc_interface *xc,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_hvm_build_arm.c +0
-1@@ -43,7 +43,6 @@ int xc_hvm_build_target_mem(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_hvm_build_x86.c +0
-1@@ -608,7 +608,6 @@ int xc_hvm_build_target_mem(xc_interface *xch,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_linux.c +0
-1@@ -72,7 +72,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_linux_osdep.c +0
-1@@ -871,7 +871,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_minios.c +0
-1@@ -545,7 +545,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_misc.c +0
-1@@ -694,7 +694,6 @@ int xc_hvm_inject_trap(* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_netbsd.c +0
-1@@ -414,7 +414,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_nomigrate.c +0
-1@@ -48,7 +48,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_pagetab.c +0
-1@@ -106,7 +106,6 @@ unsigned long xc_translate_foreign_address(xc_interface *xch, uint32_t dom,* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_private.c +0
-1@@ -891,7 +891,6 @@ int xc_ffs64(uint64_t x)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_solaris.c +0
-1@@ -343,7 +343,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xc_tmem.c +0
-1@@ -523,7 +523,6 @@ int xc_tmem_restore_extra(xc_interface *xch, int dom, int io_fd)* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xenctrl_osdep_ENOSYS.c +0
-1@@ -200,7 +200,6 @@ xc_osdep_info_t xc_osdep_info = {* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xenctrlosdep.h +0
-1@@ -166,7 +166,6 @@ void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code, const cha* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */ tools/libxc/xg_private.c +0
-1@@ -203,7 +203,6 @@ __attribute__((weak))* mode: C * c-file-style: "BSD" * c-basic-offset: 4 -* tab-width: 4 * indent-tabs-mode: nil * End: */
git-filter-branch automatic CC adding script
In reply to Ian JacksonIan Jackson writes ("[PATCH 0/2] libxc: Fix some whitespace/tab-width problems"):
Quoted 4 lines
I have here two interrelated whitespace formatting fixes for libxc:
1/2 libxc: Remove hard tabs which ought to be 4 spaces 2/2 libxc: Remove "tab-width: 8" from emacs local variables
FYI I used the script below to add some missing CCs to this and my other series.
#!/usr/bin/perl -w
#
# usage # git-filter-branch --msg-filter \ # ".../auto-cc-maintainers `pwd`/xen.git [email protected]" # # (args are things never to add to CCs)
use strict;
use IO::File;
die unless @ARGV;
die if $ARGV[0] =~ m/^-/;
our %got;
my $xendir = shift @ARGV;
chdir $xendir or die "$xendir: $!";
$got{lc $_}++ foreach @ARGV;
while (<STDIN>) {
print or die $!;
$got{lc $1}++ if m/^[-0-9a-z]+: (.*)$/i;
} my $anyyet=0;
open CCS, "git-show $ENV{GIT_COMMIT} | scripts/get_maintainer.pl |" or die $!;
while (<CCS>) {
chomp;
next if $got{lc $_};
print STDERR "\n" if !$anyyet++;
print STDERR "$ENV{GIT_COMMIT} ADDING $_\n";
print "CC: $_\n" or die $!;
}$!=0; $?=0; close CCS or die "$? $!";