Cosmetic changes in Microblaze related files
Subsystems (2)
cover Cosmetic changes in Microblaze related files
[PATCH 1/1] All changes are done based on checkpatch script results
Changes in v1:
- Coding style issues
- Use of extra spaces
- Space before bracket
- Successive empty lines
- No new line after end of function
- No space given where space is required
- Use of volatile warning in io.h still remains
Shreenidhi Shedi (1):
microblaze: Cosmetic changes in Microblaze related files
arch/microblaze/include/asm/io.h | 94 +++++++++++-------- .../microblaze-generic/microblaze-generic.c | 8 +- board/xilinx/microblaze-generic/xparameters.h | 2 +- include/configs/microblaze-generic.h | 2 +- 4 files changed, 61 insertions(+), 45 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/1 microblaze: Cosmetic changes in Microblaze related files
---
Changes in v1:
- Coding style issues
- Use of extra spaces
- Space before bracket
- Successive empty lines
- No new line after end of function
- No space given where space is required
- Use of volatile warning in io.h still remains
arch/microblaze/include/asm/io.h | 94 +++++++++++-------- .../microblaze-generic/microblaze-generic.c | 8 +- board/xilinx/microblaze-generic/xparameters.h | 2 +- include/configs/microblaze-generic.h | 2 +- 4 files changed, 61 insertions(+), 45 deletions(-)
arch/microblaze/include/asm/io.h +54 -40
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * include/asm-microblaze/io.h -- Misc I/O operations *
@@ -21,39 +22,42 @@#define IO_SPACE_LIMIT 0xFFFFFFFF#define readb (addr) \ - ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; }) + ({ unsigned char __v = (*(volatile unsigned char *)(addr)); __v; }) +#define readw (addr) \ - ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) + ({ unsigned short __v = (*(volatile unsigned short *)(addr)); __v; }) +#define readl (addr) \ - ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) + ({ unsigned int __v = (*(volatile unsigned int *)(addr)); __v; })#define writeb (b, addr) \ - (void)((*(volatile unsigned char *) (addr)) = (b)) + (void)((*(volatile unsigned char *)(addr)) = (b)) +#define writew (b, addr) \ - (void)((*(volatile unsigned short *) (addr)) = (b)) + (void)((*(volatile unsigned short *)(addr)) = (b)) +#define writel (b, addr) \ - (void)((*(volatile unsigned int *) (addr)) = (b)) + (void)((*(volatile unsigned int *)(addr)) = (b)) -#define memset_io (a,b,c) memset((void *)(a),(b),(c)) -#define memcpy_fromio (a,b,c) memcpy((a),(void *)(b),(c)) -#define memcpy_toio (a,b,c) memcpy((void *)(a),(b),(c)) +#define memset_io (a, b, c) memset((void *)(a), (b), (c)) +#define memcpy_fromio (a, b, c) memcpy((a), (void *)(b), (c)) +#define memcpy_toio (a, b, c) memcpy((void *)(a), (b), (c)) -#define inb (addr) readb (addr) -#define inw (addr) readw (addr) -#define inl (addr) readl (addr) -#define outb (x, addr) ((void) writeb (x, addr)) -#define outw (x, addr) ((void) writew (x, addr)) -#define outl (x, addr) ((void) writel (x, addr)) +#define inb (addr) readb(addr) +#define inw (addr) readw(addr) +#define inl (addr) readl(addr) +#define outb (x, addr) ((void)writeb(x, addr)) +#define outw (x, addr) ((void)writew(x, addr)) +#define outl (x, addr) ((void)writel(x, addr))/* Some #definitions to keep strange Xilinx code happy */ -#define in_8 (addr) readb (addr) -#define in_be16 (addr) readw (addr) -#define in_be32 (addr) readl (addr) - -#define out_8 (addr,x ) outb (x,addr) -#define out_be16 (addr,x ) outw (x,addr) -#define out_be32 (addr,x ) outl (x,addr) +#define in_8 (addr) readb(addr) +#define in_be16 (addr) readw(addr) +#define in_be32 (addr) readl(addr) +#define out_8 (addr, x) outb(x, addr) +#define out_be16 (addr, x) outw(x, addr) +#define out_be32 (addr, x) outl(x, addr)#define inb_p (port) inb((port))#define outb_p (val, port) outb((val), (port))
@@ -71,54 +75,64 @@#define __raw_writew writew#define __raw_writel writel -static inline void io_insb (unsigned long port,void *dst,unsigned long count) +static inline void io_insb (unsigned long port,void *dst,unsigned long count) {unsigned char *p = dst; +while (count--) - *p++ =inb (port); + *p++ =inb (port); } -static inline void io_insw (unsigned long port,void *dst,unsigned long count) + +static inline void io_insw (unsigned long port,void *dst,unsigned long count) {unsigned short *p = dst; +while (count--) - *p++ =inw (port); + *p++ =inw (port); } -static inline void io_insl (unsigned long port,void *dst,unsigned long count) + +static inline void io_insl (unsigned long port,void *dst,unsigned long count) {unsigned long *p = dst; +while (count--) - *p++ =inl (port); + *p++ =inl (port); }static inline void -io_outsb (unsigned long port,const void *src,unsigned long count) +io_outsb (unsigned long port,const void *src,unsigned long count) {const unsigned char *p = src; +while (count--) -outb (*p++, port); +outb (*p++, port); } +static inline void -io_outsw (unsigned long port,const void *src,unsigned long count) +io_outsw (unsigned long port,const void *src,unsigned long count) {const unsigned short *p = src; +while (count--) -outw (*p++, port); +outw (*p++, port); } +static inline void -io_outsl (unsigned long port,const void *src,unsigned long count) +io_outsl (unsigned long port,const void *src,unsigned long count) {const unsigned long *p = src; +while (count--) -outl (*p++, port); +outl (*p++, port); } -#define outsb (a,b,l) io_outsb(a,b,l) -#define outsw (a,b,l) io_outsw(a,b,l) -#define outsl (a,b,l) io_outsl(a,b,l) +#define outsb (a, b, l) io_outsb(a, b, l) +#define outsw (a, b, l) io_outsw(a, b, l) +#define outsl (a, b, l) io_outsl(a, b, l) -#define insb (a,b,l) io_insb(a,b,l) -#define insw (a,b,l) io_insw(a,b,l) -#define insl (a,b,l) io_insl(a,b,l) +#define insb (a, b, l) io_insb(a, b, l) +#define insw (a, b, l) io_insw(a, b, l) +#define insl (a, b, l) io_insl(a, b, l)#define ioremap_nocache (physaddr, size) (physaddr)#define ioremap_writethrough (physaddr, size) (physaddr)
board/xilinx/microblaze-generic/microblaze-generic.c +5 -3
@@ -5,8 +5,10 @@* Michal SIMEK <[email protected]> */ -/* This is a board specific file. It's OK to include board specific -* header files */ +/* +* This is a board specific file. It's OK to include board specific +* header files +*/ #include <common.h> #include <config.h>
@@ -73,7 +75,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])gpio_direction_output (reset_pin,1 );#endif #endif -puts ("Reseting board\n" ); +puts ("Resetting board\n" ); __asm__ __volatile__ (" mts rmsr, r0;" \"bra r0" );
board/xilinx/microblaze-generic/xparameters.h +1 -1
@@ -10,7 +10,7 @@* the generated file from your Xilinx design flow. */ -#define XILINX_BOARD_NAME microblaze-generic +#define XILINX_BOARD_NAME "microblaze-generic"/* Microblaze is microblaze_0 */ #define XILINX_FSL_NUMBER 3
include/configs/microblaze-generic.h +1 -1
@@ -207,7 +207,7 @@#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + \ 0x40000) -#define CONFIG_SYS_FDT_SIZE (16<<10) +#define CONFIG_SYS_FDT_SIZE (16 << 10)#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \ 0x1000000)
Signature · 1 line
2.17.1
Michal Simek
AppliedPATCH 1/1 microblaze: Cosmetic changes in Microblaze related files
Quoted 220 lines · Shreenidhi Shedi
Signed-off-by Shreenidhi Shedi <[email protected]>---
Changes in v1:
- Coding style issues
- Use of extra spaces
- Space before bracket
- Successive empty lines
- No new line after end of function
- No space given where space is required
- Use of volatile warning inio.hstill remainsarch/microblaze/include/asm/io.h | 94 +++++++++++-------- .../microblaze-generic/microblaze-generic.c | 8 +- board/xilinx/microblaze-generic/xparameters.h | 2 +- include/configs/microblaze-generic.h | 2 +- 4 files changed, 61 insertions(+), 45 deletions(-)arch/microblaze/include/asm/io.h +54
-40@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * include/asm-microblaze/io.h -- Misc I/O operations * @@ -21,39 +22,42 @@#define IO_SPACE_LIMIT 0xFFFFFFFF#define readb (addr) \ - ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; }) + ({ unsigned char __v = (*(volatile unsigned char *)(addr)); __v; }) +#define readw (addr) \ - ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) + ({ unsigned short __v = (*(volatile unsigned short *)(addr)); __v; }) +#define readl (addr) \ - ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) + ({ unsigned int __v = (*(volatile unsigned int *)(addr)); __v; })#define writeb (b, addr) \ - (void)((*(volatile unsigned char *) (addr)) = (b)) + (void)((*(volatile unsigned char *)(addr)) = (b)) +#define writew (b, addr) \ - (void)((*(volatile unsigned short *) (addr)) = (b)) + (void)((*(volatile unsigned short *)(addr)) = (b)) +#define writel (b, addr) \ - (void)((*(volatile unsigned int *) (addr)) = (b)) + (void)((*(volatile unsigned int *)(addr)) = (b)) -#define memset_io (a,b,c) memset((void *)(a),(b),(c)) -#define memcpy_fromio (a,b,c) memcpy((a),(void *)(b),(c)) -#define memcpy_toio (a,b,c) memcpy((void *)(a),(b),(c)) +#define memset_io (a, b, c) memset((void *)(a), (b), (c)) +#define memcpy_fromio (a, b, c) memcpy((a), (void *)(b), (c)) +#define memcpy_toio (a, b, c) memcpy((void *)(a), (b), (c)) -#define inb (addr) readb (addr) -#define inw (addr) readw (addr) -#define inl (addr) readl (addr) -#define outb (x, addr) ((void) writeb (x, addr)) -#define outw (x, addr) ((void) writew (x, addr)) -#define outl (x, addr) ((void) writel (x, addr)) +#define inb (addr) readb(addr) +#define inw (addr) readw(addr) +#define inl (addr) readl(addr) +#define outb (x, addr) ((void)writeb(x, addr)) +#define outw (x, addr) ((void)writew(x, addr)) +#define outl (x, addr) ((void)writel(x, addr))/* Some #definitions to keep strange Xilinx code happy */ -#define in_8 (addr) readb (addr) -#define in_be16 (addr) readw (addr) -#define in_be32 (addr) readl (addr) - -#define out_8 (addr,x ) outb (x,addr) -#define out_be16 (addr,x ) outw (x,addr) -#define out_be32 (addr,x ) outl (x,addr) +#define in_8 (addr) readb(addr) +#define in_be16 (addr) readw(addr) +#define in_be32 (addr) readl(addr) +#define out_8 (addr, x) outb(x, addr) +#define out_be16 (addr, x) outw(x, addr) +#define out_be32 (addr, x) outl(x, addr)#define inb_p (port) inb((port))#define outb_p (val, port) outb((val), (port))@@ -71,54 +75,64 @@#define __raw_writew writew#define __raw_writel writel -static inline void io_insb (unsigned long port,void *dst,unsigned long count) +static inline void io_insb (unsigned long port,void *dst,unsigned long count) {unsigned char *p = dst; +while (count--) - *p++ =inb (port); + *p++ =inb (port); } -static inline void io_insw (unsigned long port,void *dst,unsigned long count) + +static inline void io_insw (unsigned long port,void *dst,unsigned long count) {unsigned short *p = dst; +while (count--) - *p++ =inw (port); + *p++ =inw (port); } -static inline void io_insl (unsigned long port,void *dst,unsigned long count) + +static inline void io_insl (unsigned long port,void *dst,unsigned long count) {unsigned long *p = dst; +while (count--) - *p++ =inl (port); + *p++ =inl (port); }static inline void -io_outsb (unsigned long port,const void *src,unsigned long count) +io_outsb (unsigned long port,const void *src,unsigned long count) {const unsigned char *p = src; +while (count--) -outb (*p++, port); +outb (*p++, port); } +static inline void -io_outsw (unsigned long port,const void *src,unsigned long count) +io_outsw (unsigned long port,const void *src,unsigned long count) {const unsigned short *p = src; +while (count--) -outw (*p++, port); +outw (*p++, port); } +static inline void -io_outsl (unsigned long port,const void *src,unsigned long count) +io_outsl (unsigned long port,const void *src,unsigned long count) {const unsigned long *p = src; +while (count--) -outl (*p++, port); +outl (*p++, port); } -#define outsb (a,b,l) io_outsb(a,b,l) -#define outsw (a,b,l) io_outsw(a,b,l) -#define outsl (a,b,l) io_outsl(a,b,l) +#define outsb (a, b, l) io_outsb(a, b, l) +#define outsw (a, b, l) io_outsw(a, b, l) +#define outsl (a, b, l) io_outsl(a, b, l) -#define insb (a,b,l) io_insb(a,b,l) -#define insw (a,b,l) io_insw(a,b,l) -#define insl (a,b,l) io_insl(a,b,l) +#define insb (a, b, l) io_insb(a, b, l) +#define insw (a, b, l) io_insw(a, b, l) +#define insl (a, b, l) io_insl(a, b, l)#define ioremap_nocache (physaddr, size) (physaddr)#define ioremap_writethrough (physaddr, size) (physaddr)board/xilinx/microblaze-generic/microblaze-generic.c +5
-3@@ -5,8 +5,10 @@* Michal SIMEK <[email protected]> */ -/* This is a board specific file. It's OK to include board specific -* header files */ +/* +* This is a board specific file. It's OK to include board specific +* header files +*/ #include <common.h> #include <config.h> @@ -73,7 +75,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])gpio_direction_output (reset_pin,1 );#endif #endif -puts ("Reseting board\n" ); +puts ("Resetting board\n" ); __asm__ __volatile__ (" mts rmsr, r0;" \"bra r0" );board/xilinx/microblaze-generic/xparameters.h +1
-1@@ -10,7 +10,7 @@* the generated file from your Xilinx design flow. */ -#define XILINX_BOARD_NAME microblaze-generic +#define XILINX_BOARD_NAME "microblaze-generic"/* Microblaze is microblaze_0 */ #define XILINX_FSL_NUMBER 3include/configs/microblaze-generic.h +0
-0
include/configs/microblaze-generic.h line 213
Quoted 8 lines
include/configs/microblaze-generic.h +1
-1@@ -207,7 +207,7 @@#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + \ 0x40000) -#define CONFIG_SYS_FDT_SIZE (16<<10) +#define CONFIG_SYS_FDT_SIZE (16 << 10)#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \ 0x1000000)
Applied.
Thanks,
Michal