Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed] Remove a redundant condition check in tic6x-linux-tdep.c
@ 2012-11-30  7:35 Yao Qi
  2012-11-30 12:22 ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: Yao Qi @ 2012-11-30  7:35 UTC (permalink / raw)
  To: gdb-patches

Hi,
When gdb is configured as target=tic6x-uclinux, and compiled with clang,
I get this warning:

gdb/tic6x-linux-tdep.c:66:19: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare]

It is redundant to check 'REGNUM >= 0' as it is unsigned.  The
following patch is to fix it.  Committed.

gdb:

2012-11-30  Yao Qi  <yao@codesourcery.com>

	* tic6x-linux-tdep.c (tic6x_register_sigcontext_offset): Don't
	check REGNUM >= 0.
---
 gdb/tic6x-linux-tdep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/tic6x-linux-tdep.c b/gdb/tic6x-linux-tdep.c
index 3b96201..f4450c9 100644
--- a/gdb/tic6x-linux-tdep.c
+++ b/gdb/tic6x-linux-tdep.c
@@ -63,7 +63,7 @@ tic6x_register_sigcontext_offset (unsigned int regnum, struct gdbarch *gdbarch)
   else if (regnum == TIC6X_B5_REGNUM || regnum == TIC6X_B5_REGNUM + 2
 	   || regnum == TIC6X_B5_REGNUM + 4)
     return 4 * (regnum - TIC6X_B5_REGNUM + 19);	/* B5, B7, B9 */
-  else if (regnum >= 0 && regnum < TIC6X_A4_REGNUM)
+  else if (regnum < TIC6X_A4_REGNUM)
     return 4 * (regnum - 0 + 8);	/* A0 - A3 */
   else if (regnum >= TIC6X_B0_REGNUM && regnum < TIC6X_B4_REGNUM)
     return 4 * (regnum - TIC6X_B0_REGNUM + 15);	/* B0 - B3 */
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-05 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30  7:35 [committed] Remove a redundant condition check in tic6x-linux-tdep.c Yao Qi
2012-11-30 12:22 ` Mark Kettenis
2012-11-30 14:11   ` Yao Qi
2012-12-05 18:30     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox