vvfat: fix coding style nit
PATCH 1/13 vvfat: fix coding style nit
In reply to a message not in the archivePut space between = and & when taking a pointer,
to avoid confusion with old-style "&=".
--- block/vvfat.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
block/vvfat.c +2 -2
@@ -379,7 +379,7 @@ static void init_mbr(BDRVVVFATState* s) {/* TODO: if the files mbr.img and bootsect.img exist, use them */ mbr_t * real_mbr=(mbr_t *)s->first_sectors; -partition_t * partition=&(real_mbr->partition[0 ]); +partition_t * partition = &(real_mbr->partition[0 ]);int lba;memset (s->first_sectors,0 ,512 );
@@ -526,7 +526,7 @@ static uint16_t fat_datetime(time_t time,int return_time) { t=localtime (&time);/* this is not thread safe */ #else struct tm t1; - t=&t1; + t = &t1;localtime_r (&time,t);#endif if (return_time)
Signature · 1 line
1.6.5.rc2
PATCH 2/13 elfload: fix coding style nit
In reply to a message not in the archivePut space between = and * when dereferencing a pointer, to avoid confusion with old-style "*="
--- bsd-user/elfload.c | 2 +- linux-user/elfload.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
bsd-user/elfload.c +1 -1
@@ -1268,7 +1268,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, }if (retval >=0 ) { interp_ex = *((struct exec *) bprm->buf);/* aout exec-header */ - interp_elf_ex=*((struct elfhdr *) bprm->buf);/* elf exec-header */ + interp_elf_ex = *((struct elfhdr *) bprm->buf);/* elf exec-header */ }if (retval <0 ) {perror ("load_elf_binary3" );
linux-user/elfload.c +1 -1
@@ -1476,7 +1476,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, }if (retval >=0 ) { interp_ex = *((struct exec *) bprm->buf);/* aout exec-header */ - interp_elf_ex=*((struct elfhdr *) bprm->buf);/* elf exec-header */ + interp_elf_ex = *((struct elfhdr *) bprm->buf);/* elf exec-header */ }if (retval <0 ) {perror ("load_elf_binary3" );
Signature · 1 line
1.6.5.rc2
PATCH 3/13 gdbstub: fix coding style nit
In reply to a message not in the archivePut space between = and * when dereferencing a pointer, to avoid confusion with old-style "*="
--- gdbstub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
gdbstub.c +1 -1
@@ -1284,7 +1284,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)else if (n<63 ) {uint64_t val; - val=*((uint64_t *)&env->fir[n-32 ]); + val = *((uint64_t *)&env->fir[n-32 ]);GET_REGL (val); }else if (n==63 ) {
Signature · 1 line
1.6.5.rc2
PATCH 4/13 escc: fix coding style nit
In reply to a message not in the archivePut space between = and - assigning a negative number to avoid confusion with old-style "-="
(which we also have, and needs to be fixed).
--- hw/escc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
hw/escc.c +2 -2
@@ -869,9 +869,9 @@ static void sunmouse_event(void *opaque, ch = dx;if (ch >127 ) - ch=127 ; + ch =127 ;else if (ch <-127 ) - ch=-127 ; + ch =-127 ;put_queue (s, ch &0xff );
Signature · 1 line
1.6.5.rc2
PATCH 5/13 omap_dma: fix unbalanced { in commented out code
In reply to a message not in the archiveFix unbalanced {} in commented out code.
--- hw/omap_dma.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
hw/omap_dma.c +3 -1
@@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)#ifdef MULTI_REQ /* TODO: should all of this only be done if dma->update, and otherwise * inside omap_dma_transfer_generic below - check what's faster. */ -if (dma->update) { + if (dma->update)#endif /* If the channel is element synchronized, deactivate it */
@@ -668,7 +668,9 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)/* TODO: if the destination port is IMIF or EMIFF, set the dirty * bits on it. */ +#ifndef MULTI_REQ } +#endif omap_dma_interrupts_update (s); }
Signature · 1 line
1.6.5.rc2
PATCH 6/13 twl92230: fix old style increment/decrement usage
In reply to a message not in the archiveModern compilers do not parse "=-" as decrement:
you must use "-=" for that. Same for "=+"/"+=".
--- hw/twl92230.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
hw/twl92230.c +2 -2
@@ -73,14 +73,14 @@ static inline void menelaus_update(MenelausState *s)static inline void menelaus_rtc_start (MenelausState *s) { - s->rtc.next =+qemu_get_clock (rt_clock); + s->rtc.next +=qemu_get_clock (rt_clock);qemu_mod_timer (s->rtc.hz_tm, s->rtc.next); }static inline void menelaus_rtc_stop (MenelausState *s) {qemu_del_timer (s->rtc.hz_tm); - s->rtc.next =-qemu_get_clock (rt_clock); + s->rtc.next -=qemu_get_clock (rt_clock);if (s->rtc.next <1 ) s->rtc.next =1 ; }
Signature · 1 line
1.6.5.rc2
PATCH 7/13 linux-user: fix old style decrement usage
In reply to a message not in the archiveModern compilers do not parse "=-" as decrement:
you must use "-=" for that.
--- linux-user/arm/nwfpe/fpa11.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/arm/nwfpe/fpa11.c +1 -1
@@ -191,7 +191,7 @@ unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs)if (nRc ==1 &&get_float_exception_flags (&fpa11->fp_status)) {//printf("fef 0x%x\n",float_exception_flags); - nRc=-get_float_exception_flags (&fpa11->fp_status); + nRc -=get_float_exception_flags (&fpa11->fp_status); }//printf("returning %d\n",nRc);
Signature · 1 line
1.6.5.rc2
PATCH 8/13 target-mips: unmatched brackets in if 0
In reply to a message not in the archiveFix unmatched braket in commented out code
--- target-mips/helper.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
target-mips/helper.c +0 -1
@@ -195,7 +195,6 @@ static int get_physical_address (CPUState *env, target_ulong *physical,#if 0 qemu_log (TARGET_FMT_lx" %d %d => " TARGET_FMT_lx" %d (%d)\n" , address, rw, access_type, *physical, *prot, ret); - }#endif return ret;
Signature · 1 line
1.6.5.rc2
PATCH 9/13 tests: unmatched brackets in if 0
In reply to a message not in the archiveFix unmatched braket in commented out code
--- tests/sha1.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
tests/sha1.c +1 -1
@@ -190,7 +190,7 @@ unsigned char c;int j;for (j =0 ; j <4 ; t >>=8 , j++) - *--fcp = (unsigned char) t + *--fcp = (unsigned char) t; }#else for (i =0 ; i <8 ; i++) {
Signature · 1 line
1.6.5.rc2
PATCH 10/13 linux-user: fix coding style nit
In reply to a message not in the archivePut space between = and & when taking a pointer,
to avoid confusion with old-style "&=".
--- linux-user/syscall.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall.c +1 -1
@@ -2067,7 +2067,7 @@ static inline abi_long target_to_host_ipc_perm(struct ipc_perm *host_ip,if (!lock_user_struct (VERIFY_READ , target_sd, target_addr,1 ))return -TARGET_EFAULT ; - target_ip=&(target_sd->sem_perm); + target_ip = &(target_sd->sem_perm); host_ip->__key =tswapl (target_ip->__key); host_ip->uid =tswapl (target_ip->uid); host_ip->gid =tswapl (target_ip->gid);
Signature · 1 line
1.6.5.rc2
PATCH 11/13 net: fix coding style nit
In reply to a message not in the archivePut space between = and - assigning a negative number to avoid confusion with old-style "-="
(which we also have, and need to be fixed).
--- net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net.c +1 -1
@@ -2044,7 +2044,7 @@ static NetSocketState *net_socket_fd_init(VLANState *vlan, const char *model, const char *name, int fd, int is_connected) { - int so_type=-1, optlen=sizeof(so_type); + int so_type = -1, optlen=sizeof(so_type);if (getsockopt (fd,SOL_SOCKET ,SO_TYPE , (char *)&so_type, (socklen_t *)&optlen)<0 ) {
Signature · 1 line
1.6.5.rc2
PATCH 12/13 slirp: fix unmatched bracket in if 0
In reply to a message not in the archiveFix unmatched bracket in commented out code
--- slirp/ip_input.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
slirp/ip_input.c +0 -2
@@ -648,8 +648,6 @@ typedef u_int32_t n_time;ip_forward (m,1 );return (1 ); } - } - }return (0 ); bad:icmp_error (m, type, code,0 ,0 );
Signature · 1 line
1.6.5.rc2
PATCH 13/13 escc: fix another coding style nit
In reply to a message not in the archiveFix another place with =- to be "= -".
to avoid confusion with old-style "-="
(which we also have, and needs to be fixed).
--- hw/escc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
hw/escc.c +2 -2
@@ -878,9 +878,9 @@ static void sunmouse_event(void *opaque, ch = -dy;if (ch >127 ) - ch=127 ; + ch =127 ;else if (ch <-127 ) - ch=-127 ; + ch =-127 ;put_queue (s, ch &0xff );
Signature · 1 line
1.6.5.rc2
[Qemu-devel] Re: [PATCH 09/13] tests: unmatched brackets in if 0
In reply to Michael S. TsirkinQuoted 4 lines · Michael S. Tsirkin
Fix unmatched braket in commented out code
- *--fcp = (unsigned char) t
+ *--fcp = (unsigned char) t;
Description does not match patch content.
Applied others, thanks!
Re: [Qemu-devel] [PATCH 09/13] tests: unmatched brackets in if 0
In reply to Michael S. TsirkinQuoted 12 lines · Michael S. Tsirkin
Fix unmatched braket in commented out code
Signed-off-by Michael S. Tsirkin <[email protected]>--- tests/sha1.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)tests/sha1.c +0
-0
tests/sha1.c unsigned char c; · line 196
Quoted 8 lines
tests/sha1.c +1
-1@@ -190,7 +190,7 @@ unsigned char c;int j;for (j =0 ; j <4 ; t >>=8 , j++) - *--fcp = (unsigned char) t + *--fcp = (unsigned char) t; }#else for (i =0 ; i <8 ; i++) {
Good fix, bad commit message :)