From: Tiezhu Yang Date: Tue, 10 May 2022 11:50:31 +0000 (+0800) Subject: gdb: LoongArch: Use GDB style to check readbuf and writebuf X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c3c88db125df810ff0209d4a1fbc49161b3d9cf;p=binutils-gdb.git gdb: LoongArch: Use GDB style to check readbuf and writebuf The GDB style is to write 'if (readbuf != nullptr)', and the same for writebuf. Signed-off-by: Tiezhu Yang --- diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c index 28f04094f64..8e74c9b779d 100644 --- a/gdb/loongarch-tdep.c +++ b/gdb/loongarch-tdep.c @@ -269,9 +269,9 @@ loongarch_return_value (struct gdbarch *gdbarch, struct value *function, } /* Extract the return value from the register where it was stored. */ - if (readbuf) + if (readbuf != nullptr) regcache->raw_read_part (regnum, 0, len, readbuf); - if (writebuf) + if (writebuf != nullptr) regcache->raw_write_part (regnum, 0, len, writebuf); return RETURN_VALUE_REGISTER_CONVENTION;