public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED PATCH] gdb: LoongArch: Use GDB style to check readbuf and writebuf
@ 2022-05-10 14:27 Tiezhu Yang
  0 siblings, 0 replies; only message in thread
From: Tiezhu Yang @ 2022-05-10 14:27 UTC (permalink / raw)
  To: gdb-patches

The GDB style is to write 'if (readbuf != nullptr)', and the same for
writebuf.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 gdb/loongarch-tdep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
-- 
2.27.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-10 14:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 14:27 [COMMITTED PATCH] gdb: LoongArch: Use GDB style to check readbuf and writebuf Tiezhu Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).