sh4: Coding style: Remove tabs
PATCH 1/1 sh4: Coding style: Remove tabs
From: Yihuan Pan <[email protected]>
Replaces TABS with spaces to ensure have a consistent coding style with an indentation of 4 spaces in the SH4 subsystem.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/376
--- linux-user/sh4/termbits.h | 204 +++--- target/sh4/cpu.h | 80 +- target/sh4/helper.c | 236 +++--- target/sh4/op_helper.c | 70 +- target/sh4/translate.c | 1466 ++++++++++++++++++------------------- 5 files changed, 1028 insertions(+), 1028 deletions(-)
linux-user/sh4/termbits.h +102 -102
@@ -39,86 +39,86 @@ struct target_termios {#define TARGET_VEOL2 16/* c_iflag bits */ -#define TARGET_IGNBRK 0000001 -#define TARGET_BRKINT 0000002 -#define TARGET_IGNPAR 0000004 -#define TARGET_PARMRK 0000010 -#define TARGET_INPCK 0000020 -#define TARGET_ISTRIP 0000040 -#define TARGET_INLCR 0000100 -#define TARGET_IGNCR 0000200 -#define TARGET_ICRNL 0000400 -#define TARGET_IUCLC 0001000 -#define TARGET_IXON 0002000 -#define TARGET_IXANY 0004000 -#define TARGET_IXOFF 0010000 -#define TARGET_IMAXBEL 0020000 -#define TARGET_IUTF8 0040000 +#define TARGET_IGNBRK 0000001 +#define TARGET_BRKINT 0000002 +#define TARGET_IGNPAR 0000004 +#define TARGET_PARMRK 0000010 +#define TARGET_INPCK 0000020 +#define TARGET_ISTRIP 0000040 +#define TARGET_INLCR 0000100 +#define TARGET_IGNCR 0000200 +#define TARGET_ICRNL 0000400 +#define TARGET_IUCLC 0001000 +#define TARGET_IXON 0002000 +#define TARGET_IXANY 0004000 +#define TARGET_IXOFF 0010000 +#define TARGET_IMAXBEL 0020000 +#define TARGET_IUTF8 0040000/* c_oflag bits */ -#define TARGET_OPOST 0000001 -#define TARGET_OLCUC 0000002 -#define TARGET_ONLCR 0000004 -#define TARGET_OCRNL 0000010 -#define TARGET_ONOCR 0000020 -#define TARGET_ONLRET 0000040 -#define TARGET_OFILL 0000100 -#define TARGET_OFDEL 0000200 -#define TARGET_NLDLY 0000400 -#define TARGET_NL0 0000000 -#define TARGET_NL1 0000400 -#define TARGET_CRDLY 0003000 -#define TARGET_CR0 0000000 -#define TARGET_CR1 0001000 -#define TARGET_CR2 0002000 -#define TARGET_CR3 0003000 -#define TARGET_TABDLY 0014000 -#define TARGET_TAB0 0000000 -#define TARGET_TAB1 0004000 -#define TARGET_TAB2 0010000 -#define TARGET_TAB3 0014000 -#define TARGET_XTABS 0014000 -#define TARGET_BSDLY 0020000 -#define TARGET_BS0 0000000 -#define TARGET_BS1 0020000 -#define TARGET_VTDLY 0040000 -#define TARGET_VT0 0000000 -#define TARGET_VT1 0040000 -#define TARGET_FFDLY 0100000 -#define TARGET_FF0 0000000 -#define TARGET_FF1 0100000 +#define TARGET_OPOST 0000001 +#define TARGET_OLCUC 0000002 +#define TARGET_ONLCR 0000004 +#define TARGET_OCRNL 0000010 +#define TARGET_ONOCR 0000020 +#define TARGET_ONLRET 0000040 +#define TARGET_OFILL 0000100 +#define TARGET_OFDEL 0000200 +#define TARGET_NLDLY 0000400 +#define TARGET_NL0 0000000 +#define TARGET_NL1 0000400 +#define TARGET_CRDLY 0003000 +#define TARGET_CR0 0000000 +#define TARGET_CR1 0001000 +#define TARGET_CR2 0002000 +#define TARGET_CR3 0003000 +#define TARGET_TABDLY 0014000 +#define TARGET_TAB0 0000000 +#define TARGET_TAB1 0004000 +#define TARGET_TAB2 0010000 +#define TARGET_TAB3 0014000 +#define TARGET_XTABS 0014000 +#define TARGET_BSDLY 0020000 +#define TARGET_BS0 0000000 +#define TARGET_BS1 0020000 +#define TARGET_VTDLY 0040000 +#define TARGET_VT0 0000000 +#define TARGET_VT1 0040000 +#define TARGET_FFDLY 0100000 +#define TARGET_FF0 0000000 +#define TARGET_FF1 0100000/* c_cflag bit meaning */ -#define TARGET_CBAUD 0010017 -#define TARGET_B0 0000000/* hang up */ -#define TARGET_B50 0000001 -#define TARGET_B75 0000002 -#define TARGET_B110 0000003 -#define TARGET_B134 0000004 -#define TARGET_B150 0000005 -#define TARGET_B200 0000006 -#define TARGET_B300 0000007 -#define TARGET_B600 0000010 -#define TARGET_B1200 0000011 -#define TARGET_B1800 0000012 -#define TARGET_B2400 0000013 -#define TARGET_B4800 0000014 -#define TARGET_B9600 0000015 -#define TARGET_B19200 0000016 -#define TARGET_B38400 0000017 +#define TARGET_CBAUD 0010017 +#define TARGET_B0 0000000/* hang up */ +#define TARGET_B50 0000001 +#define TARGET_B75 0000002 +#define TARGET_B110 0000003 +#define TARGET_B134 0000004 +#define TARGET_B150 0000005 +#define TARGET_B200 0000006 +#define TARGET_B300 0000007 +#define TARGET_B600 0000010 +#define TARGET_B1200 0000011 +#define TARGET_B1800 0000012 +#define TARGET_B2400 0000013 +#define TARGET_B4800 0000014 +#define TARGET_B9600 0000015 +#define TARGET_B19200 0000016 +#define TARGET_B38400 0000017#define TARGET_EXTA B19200#define TARGET_EXTB B38400 -#define TARGET_CSIZE 0000060 -#define TARGET_CS5 0000000 -#define TARGET_CS6 0000020 -#define TARGET_CS7 0000040 -#define TARGET_CS8 0000060 -#define TARGET_CSTOPB 0000100 -#define TARGET_CREAD 0000200 -#define TARGET_PARENB 0000400 -#define TARGET_PARODD 0001000 -#define TARGET_HUPCL 0002000 -#define TARGET_CLOCAL 0004000 +#define TARGET_CSIZE 0000060 +#define TARGET_CS5 0000000 +#define TARGET_CS6 0000020 +#define TARGET_CS7 0000040 +#define TARGET_CS8 0000060 +#define TARGET_CSTOPB 0000100 +#define TARGET_CREAD 0000200 +#define TARGET_PARENB 0000400 +#define TARGET_PARODD 0001000 +#define TARGET_HUPCL 0002000 +#define TARGET_CLOCAL 0004000#define TARGET_CBAUDEX 0010000#define TARGET_B57600 0010001#define TARGET_B115200 0010002
@@ -135,44 +135,44 @@ struct target_termios {#define TARGET_B3000000 0010015#define TARGET_B3500000 0010016#define TARGET_B4000000 0010017 -#define TARGET_CIBAUD 002003600000/* input baud rate (not used) */ -#define TARGET_CMSPAR 010000000000/* mark or space (stick) parity */ -#define TARGET_CRTSCTS 020000000000/* flow control */ +#define TARGET_CIBAUD 002003600000/* input baud rate (not used) */ +#define TARGET_CMSPAR 010000000000/* mark or space (stick) parity */ +#define TARGET_CRTSCTS 020000000000/* flow control */ /* c_lflag bits */ -#define TARGET_ISIG 0000001 -#define TARGET_ICANON 0000002 -#define TARGET_XCASE 0000004 -#define TARGET_ECHO 0000010 -#define TARGET_ECHOE 0000020 -#define TARGET_ECHOK 0000040 -#define TARGET_ECHONL 0000100 -#define TARGET_NOFLSH 0000200 -#define TARGET_TOSTOP 0000400 -#define TARGET_ECHOCTL 0001000 -#define TARGET_ECHOPRT 0002000 -#define TARGET_ECHOKE 0004000 -#define TARGET_FLUSHO 0010000 -#define TARGET_PENDIN 0040000 -#define TARGET_IEXTEN 0100000 +#define TARGET_ISIG 0000001 +#define TARGET_ICANON 0000002 +#define TARGET_XCASE 0000004 +#define TARGET_ECHO 0000010 +#define TARGET_ECHOE 0000020 +#define TARGET_ECHOK 0000040 +#define TARGET_ECHONL 0000100 +#define TARGET_NOFLSH 0000200 +#define TARGET_TOSTOP 0000400 +#define TARGET_ECHOCTL 0001000 +#define TARGET_ECHOPRT 0002000 +#define TARGET_ECHOKE 0004000 +#define TARGET_FLUSHO 0010000 +#define TARGET_PENDIN 0040000 +#define TARGET_IEXTEN 0100000#define TARGET_EXTPROC 0200000/* tcflow() and TCXONC use these */ -#define TARGET_TCOOFF 0 -#define TARGET_TCOON 1 -#define TARGET_TCIOFF 2 -#define TARGET_TCION 3 +#define TARGET_TCOOFF 0 +#define TARGET_TCOON 1 +#define TARGET_TCIOFF 2 +#define TARGET_TCION 3/* tcflush() and TCFLSH use these */ -#define TARGET_TCIFLUSH 0 -#define TARGET_TCOFLUSH 1 -#define TARGET_TCIOFLUSH 2 +#define TARGET_TCIFLUSH 0 +#define TARGET_TCOFLUSH 1 +#define TARGET_TCIOFLUSH 2/* tcsetattr uses these */ -#define TARGET_TCSANOW 0 -#define TARGET_TCSADRAIN 1 -#define TARGET_TARGET_TCSAFLUSH 2 +#define TARGET_TCSANOW 0 +#define TARGET_TCSADRAIN 1 +#define TARGET_TARGET_TCSAFLUSH 2/* ioctl */ #define TARGET_FIOCLEX TARGET_IO('f', 1)
target/sh4/cpu.h +40 -40
116 lines not on this page · raw message
target/sh4/helper.c +118 -118
343 lines not on this page · raw message
target/sh4/op_helper.c +35 -35
112 lines not on this page · raw message
target/sh4/translate.c +733 -733
1,954 lines not on this page · raw message
Signature · 1 line
2.43.0
Hi,
Quoted 23 lines · xun
From: Yihuan Pan <[email protected]>
Replaces TABS with spaces to ensure have a consistent coding style with an indentation of 4 spaces in the SH4 subsystem.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/376
Signed-off-by Yihuan Pan <[email protected]>--- linux-user/sh4/termbits.h | 204 +++--- target/sh4/cpu.h | 80 +- target/sh4/helper.c | 236 +++--- target/sh4/op_helper.c | 70 +- target/sh4/translate.c | 1466 ++++++++++++++++++------------------- 5 files changed, 1028 insertions(+), 1028 deletions(-)target/sh4/helper.c +0
-3@@ -241,17 +241,17 @@ static int find_tlb_entry(CPUSH4State * env, target_ulong address, asid = env->pteh &0xff ;for (i =0 ; i < nbtlb; i++) { -if (!entries[i].v) -continue ;/* Invalid entry */ -if (!entries[i].sh && use_asid && entries[i].asid != asid)
target/sh4/helper.c static int find_tlb_entry(CPUSH4State * env, target_ulong address, · line 245
Quoted 10 lines
target/sh4/helper.c +2
-8-continue ;/* Bad ASID */ - start = (entries[i].vpn <<10 ) & ~(entries[i].size -1 ); - end = start + entries[i].size -1 ; -if (address >= start && address <= end) {/* Match */ -if (match !=MMU_DTLB_MISS ) -return MMU_DTLB_MULTIPLE ;/* Multiple match */ - match = i; - } +if (!entries[i].v) +continue ;/* Invalid entry */
Thomas, better fix the 'if { }' in this patch or a following one?
Quoted 20 lines
target/sh4/helper.c +10
-1+if (!entries[i].sh && use_asid && entries[i].asid != asid) +continue ;/* Bad ASID */ + start = (entries[i].vpn <<10 ) & ~(entries[i].size -1 ); + end = start + entries[i].size -1 ; +if (address >= start && address <= end) {/* Match */ +if (match !=MMU_DTLB_MISS ) +return MMU_DTLB_MULTIPLE ;/* Multiple match */ + match = i; + } }return match; }@@ -265,7 +265,7 @@ static void increment_urc(CPUSH4State * env) urc = ((env->mmucr) >>10 ) &0x3f ; urc++;if ((urb >0 && urc > urb) || urc > (UTLB_SIZE -1 )) - urc =0 ; + urc =0 ; env->mmucr = (env->mmucr &0xffff03ff ) | (urc <<10 ); }
Thomas Huth
Reviewed-byQuoted 30 lines · Philippe Mathieu-Daudé
Hi,
Quoted 27 lines · xun
From: Yihuan Pan <[email protected]>
Replaces TABS with spaces to ensure have a consistent coding style with an indentation of 4 spaces in the SH4 subsystem.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/376
Signed-off-by Yihuan Pan <[email protected]>---
linux-user/sh4/termbits.h| 204 +++---
target/sh4/cpu.h | 80 +-
target/sh4/helper.c | 236 +++--- target/sh4/op_helper.c | 70 +-
target/sh4/translate.c | 1466 ++++++++++++++++++-------------------5 files changed, 1028 insertions(+), 1028 deletions(-)target/sh4/helper.c +0
-7@@ -241,17 +241,17 @@ static int find_tlb_entry(CPUSH4State * env,target_ulong address, asid = env->pteh & 0xff; for (i = 0; i < nbtlb; i++) { - if (!entries[i].v) - continue; /* Invalid entry */ - if (!entries[i].sh && use_asid && entries[i].asid != asid) - continue; /* Bad ASID */ - start = (entries[i].vpn << 10) & ~(entries[i].size - 1); - end = start + entries[i].size - 1; - if (address >= start && address <= end) { /* Match */
Quoted 8 lines
target/sh4/helper.c static int find_tlb_entry(CPUSH4State * env, target_ulong address, · line 245
Quoted 6 lines
target/sh4/helper.c +2
-4- if (match != MMU_DTLB_MISS) - return MMU_DTLB_MULTIPLE; /* Multiple match */ - match = i; - } + if (!entries[i].v) + continue; /* Invalid entry */Thomas, better fix the 'if { }' in this patch or a following one?
Normally I would not mind either way, but this patch is already quite big, so I think it would be better to fix other coding style issues in separate patches. This way, you can also verify with "git show -b" that there are no other unwanted changes in here.
I now also quickly skimmed through the changes and the patch looks fine to me, so:
Since the sh4 subsystem currently does not have a maintainer, I'll take the patch for my next pull request.
Thank you for tackling this!
Thomas