Skip to content

Commit

Permalink
xtensa: clean up files to make them code-style compliant
Browse files Browse the repository at this point in the history
Remove heading and trailing spaces, trim trailing lines, and wrap lines
that are longer than 80 characters.

Signed-off-by: Chris Zankel <chris@zankel.net>
  • Loading branch information
Chris Zankel committed Dec 19, 2012
1 parent 72100ed commit c4c4594
Show file tree
Hide file tree
Showing 49 changed files with 160 additions and 175 deletions.
1 change: 0 additions & 1 deletion arch/xtensa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,3 @@ zImage: vmlinux
define archhelp
@echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
endef

19 changes: 8 additions & 11 deletions arch/xtensa/include/asm/bootparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
/* All records are aligned to 4 bytes */

typedef struct bp_tag {
unsigned short id; /* tag id */
unsigned short size; /* size of this record excluding the structure*/
unsigned long data[0]; /* data */
unsigned short id; /* tag id */
unsigned short size; /* size of this record excluding the structure*/
unsigned long data[0]; /* data */
} bp_tag_t;

typedef struct meminfo {
unsigned long type;
unsigned long start;
unsigned long end;
unsigned long type;
unsigned long start;
unsigned long end;
} meminfo_t;

#define SYSMEM_BANKS_MAX 5
Expand All @@ -49,14 +49,11 @@ typedef struct meminfo {
#define MEMORY_TYPE_NONE 0x2000

typedef struct sysmem_info {
int nr_banks;
meminfo_t bank[SYSMEM_BANKS_MAX];
int nr_banks;
meminfo_t bank[SYSMEM_BANKS_MAX];
} sysmem_info_t;

extern sysmem_info_t sysmem;

#endif
#endif



1 change: 0 additions & 1 deletion arch/xtensa/include/asm/cacheasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,3 @@
__loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH

.endm

3 changes: 2 additions & 1 deletion arch/xtensa/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ static inline void __invalidate_icache_page_alias(unsigned long virt,
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
extern void flush_dcache_page(struct page*);
extern void flush_cache_range(struct vm_area_struct*, ulong, ulong);
extern void flush_cache_page(struct vm_area_struct*, unsigned long, unsigned long);
extern void flush_cache_page(struct vm_area_struct*,
unsigned long, unsigned long);

#else

Expand Down
19 changes: 11 additions & 8 deletions arch/xtensa/include/asm/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
* better 64-bit) boundary
*/

asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, int len, __wsum sum,
int *src_err_ptr, int *dst_err_ptr);
asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst,
int len, __wsum sum,
int *src_err_ptr, int *dst_err_ptr);

/*
* Note: when you get a NULL pointer exception here this means someone
Expand All @@ -54,7 +55,7 @@ __wsum csum_partial_copy_nocheck(const void *src, void *dst,

static inline
__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
int len, __wsum sum, int *err_ptr)
int len, __wsum sum, int *err_ptr)
{
return csum_partial_copy_generic((__force const void *)src, dst,
len, sum, err_ptr, NULL);
Expand Down Expand Up @@ -112,7 +113,8 @@ static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
/* Since the input registers which are loaded with iph and ihl
are modified, we must also specify them as outputs, or gcc
will assume they contain their original values. */
: "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr)
: "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp),
"=&r" (endaddr)
: "1" (iph), "2" (ihl)
: "memory");

Expand Down Expand Up @@ -168,7 +170,7 @@ static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,

static __inline__ __sum16 ip_compute_csum(const void *buff, int len)
{
return csum_fold (csum_partial(buff, len, 0));
return csum_fold (csum_partial(buff, len, 0));
}

#define _HAVE_ARCH_IPV6_CSUM
Expand Down Expand Up @@ -238,11 +240,12 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
* Copy and checksum to user
*/
#define HAVE_CSUM_COPY_USER
static __inline__ __wsum csum_and_copy_to_user(const void *src, void __user *dst,
int len, __wsum sum, int *err_ptr)
static __inline__ __wsum csum_and_copy_to_user(const void *src,
void __user *dst, int len,
__wsum sum, int *err_ptr)
{
if (access_ok(VERIFY_WRITE, dst, len))
return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
return csum_partial_copy_generic(src,dst,len,sum,NULL,err_ptr);

if (len)
*err_ptr = -EFAULT;
Expand Down
3 changes: 2 additions & 1 deletion arch/xtensa/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
#endif
}

#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
#define xchg(ptr,x) \
((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))

/*
* This only works if the compiler isn't horribly bad at optimizing.
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/current.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static inline struct task_struct *get_current(void)

#define GET_CURRENT(reg,sp) \
GET_THREAD_INFO(reg,sp); \
l32i reg, reg, TI_TASK \
l32i reg, reg, TI_TASK \

#endif

Expand Down
7 changes: 3 additions & 4 deletions arch/xtensa/include/asm/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ extern unsigned long loops_per_jiffy;

static inline void __delay(unsigned long loops)
{
/* 2 cycles per loop. */
__asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
: "=r" (loops) : "0" (loops));
/* 2 cycles per loop. */
__asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
: "=r" (loops) : "0" (loops));
}

static __inline__ u32 xtensa_get_ccount(void)
Expand All @@ -46,4 +46,3 @@ static __inline__ void udelay (unsigned long usecs)
}

#endif

4 changes: 2 additions & 2 deletions arch/xtensa/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
}

static inline void
dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
enum dma_data_direction direction)
dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
size_t size, enum dma_data_direction direction)
{
consistent_sync((void *)bus_to_virt(dma_handle), size, direction);
}
Expand Down
10 changes: 5 additions & 5 deletions arch/xtensa/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ extern void xtensa_elf_core_copy_regs (xtensa_gregset_t *, struct pt_regs *);
*/

#define ELF_PLAT_INIT(_r, load_addr) \
do { _r->areg[0]=0; /*_r->areg[1]=0;*/ _r->areg[2]=0; _r->areg[3]=0; \
_r->areg[4]=0; _r->areg[5]=0; _r->areg[6]=0; _r->areg[7]=0; \
_r->areg[8]=0; _r->areg[9]=0; _r->areg[10]=0; _r->areg[11]=0; \
_r->areg[12]=0; _r->areg[13]=0; _r->areg[14]=0; _r->areg[15]=0; \
} while (0)
do { _r->areg[0]=0; /*_r->areg[1]=0;*/ _r->areg[2]=0; _r->areg[3]=0; \
_r->areg[4]=0; _r->areg[5]=0; _r->areg[6]=0; _r->areg[7]=0; \
_r->areg[8]=0; _r->areg[9]=0; _r->areg[10]=0; _r->areg[11]=0; \
_r->areg[12]=0; _r->areg[13]=0; _r->areg[14]=0; _r->areg[15]=0; \
} while (0)

typedef struct {
xtregs_opt_t opt;
Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/include/asm/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@
extern void flush_cache_kmaps(void);

#endif

2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ activate_mm(struct mm_struct *prev, struct mm_struct *next)


static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
struct task_struct *tsk)
{
unsigned long asid = asid_cache;

Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/nommu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}

static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
static inline int init_new_context(struct task_struct *tsk,struct mm_struct *mm)
{
return 0;
}
Expand Down
20 changes: 11 additions & 9 deletions arch/xtensa/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
* PAGE_SHIFT determines the page size
*/

#define PAGE_SHIFT 12
#define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#define PAGE_SHIFT 12
#define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))

#ifdef CONFIG_MMU
#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
#define MAX_MEM_PFN XCHAL_KSEG_SIZE
#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
#define MAX_MEM_PFN XCHAL_KSEG_SIZE
#else
#define PAGE_OFFSET 0
#define MAX_MEM_PFN (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE)
#define PAGE_OFFSET 0
#define MAX_MEM_PFN (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE)
#endif

#define PGTABLE_START 0x80000000
#define PGTABLE_START 0x80000000

/*
* Cache aliasing:
Expand Down Expand Up @@ -161,7 +161,9 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*);

#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
#define pfn_valid(pfn) \
((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)

#ifdef CONFIG_DISCONTIGMEM
# error CONFIG_DISCONTIGMEM not supported
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct pci_space {
struct pci_controller {
int index; /* used for pci_controller_num */
struct pci_controller *next;
struct pci_bus *bus;
struct pci_bus *bus;
void *arch_data;

int first_busno;
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct pci_dev;

/* Map a range of PCI memory or I/O space for a device into user space */
int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine);
enum pci_mmap_state mmap_state, int write_combine);

/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
#define HAVE_PCI_MMAP 1
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)

extern struct kmem_cache *pgtable_cache;

static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
unsigned long address)
{
return kmem_cache_alloc(pgtable_cache, GFP_KERNEL|__GFP_REPEAT);
Expand Down
8 changes: 4 additions & 4 deletions arch/xtensa/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ struct vm_area_struct;

static inline int
ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr,
pte_t *ptep)
pte_t *ptep)
{
pte_t pte = *ptep;
if (!pte_young(pte))
Expand All @@ -304,8 +304,8 @@ ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
static inline void
ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
pte_t pte = *ptep;
update_pte(ptep, pte_wrprotect(pte));
pte_t pte = *ptep;
update_pte(ptep, pte_wrprotect(pte));
}

/* to find an entry in a kernel page-table-directory */
Expand Down Expand Up @@ -399,7 +399,7 @@ extern void update_mmu_cache(struct vm_area_struct * vma,
*/

#define io_remap_pfn_range(vma,from,pfn,size,prot) \
remap_pfn_range(vma, from, pfn, size, prot)
remap_pfn_range(vma, from, pfn, size, prot)

typedef pte_t *pte_addr_t;

Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/include/asm/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,3 @@ extern int platform_pcibios_fixup (void);
extern void platform_calibrate_ccount (void);

#endif /* _XTENSA_PLATFORM_H */

10 changes: 5 additions & 5 deletions arch/xtensa/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#define MAKE_PC_FROM_RA(ra,sp) (((ra) & 0x3fffffff) | ((sp) & 0xc0000000))

typedef struct {
unsigned long seg;
unsigned long seg;
} mm_segment_t;

struct thread_struct {
Expand Down Expand Up @@ -145,10 +145,10 @@ struct thread_struct {
* set_thread_state in signal.c depends on it.
*/
#define USER_PS_VALUE ((1 << PS_WOE_BIT) | \
(1 << PS_CALLINC_SHIFT) | \
(USER_RING << PS_RING_SHIFT) | \
(1 << PS_UM_BIT) | \
(1 << PS_EXCM_BIT))
(1 << PS_CALLINC_SHIFT) | \
(USER_RING << PS_RING_SHIFT) | \
(1 << PS_UM_BIT) | \
(1 << PS_EXCM_BIT))

/* Clearing a0 terminates the backtrace. */
#define start_thread(regs, new_pc, new_sp) \
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct pt_regs {

# define arch_has_single_step() (1)
# define task_pt_regs(tsk) ((struct pt_regs*) \
(task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
(task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
# define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
# define instruction_pointer(regs) ((regs)->pc)

Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/include/asm/regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@
#define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */

#endif /* _XTENSA_SPECREG_H */

11 changes: 6 additions & 5 deletions arch/xtensa/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ asmlinkage long xtensa_fadvise64_64(int, int,
/* Should probably move to linux/syscalls.h */
struct pollfd;
asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp,
fd_set __user *exp, struct timespec __user *tsp, void __user *sig);
fd_set __user *exp, struct timespec __user *tsp,
void __user *sig);
asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
struct timespec __user *tsp, const sigset_t __user *sigmask,
size_t sigsetsize);
asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset,
size_t sigsetsize);
struct timespec __user *tsp,
const sigset_t __user *sigmask,
size_t sigsetsize);
asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize);
Loading

0 comments on commit c4c4594

Please sign in to comment.