linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/power x86_energy_perf_policy: remove unneeded check
@ 2019-08-15  8:27 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-08-15  8:27 UTC (permalink / raw)
  To: Steve Winslow, Len Brown
  Cc: Thomas Gleixner, Greg Kroah-Hartman, Steve Winslow,
	Allison Randal, linux-kernel, kernel-janitors

The "i" variable is an int.  The condition doesn't really make sense.
Since we ensure that "i" is in the 0 to 0xff range on the following
lines it's not required and this patch deletes it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
index 34a796b303fe..ce9a3fcf4a6c 100644
--- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
+++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
@@ -331,8 +331,6 @@ int parse_optarg_string(char *s)
 		fprintf(stderr, "no digits in \"%s\"\n", s);
 		usage();
 	}
-	if (i == LONG_MIN || i == LONG_MAX)
-		errx(-1, "%s", s);
 
 	if (i > 0xFF)
 		errx(-1, "%d (0x%x) must be < 256", i, i);
-- 
2.20.1


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

* [PATCH] tools/power x86_energy_perf_policy: remove unneeded check
@ 2017-06-28 11:45 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2017-06-28 11:45 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-kernel, kernel-janitors

"i" is an int so this test is only ever possible with 32 bit systems.
The error message is not very useful and there are better tests directly
afterward so this test isn't needed.  Let's just delete these lines.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
index 65bbe627a425..de4a888f1a3e 100644
--- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
+++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
@@ -332,8 +332,6 @@ int parse_optarg_string(char *s)
 		fprintf(stderr, "no digits in \"%s\"\n", s);
 		usage();
 	}
-	if (i == LONG_MIN || i == LONG_MAX)
-		errx(-1, "%s", s);
 
 	if (i > 0xFF)
 		errx(-1, "%d (0x%x) must be < 256", i, i);

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

end of thread, other threads:[~2019-08-15  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15  8:27 [PATCH] tools/power x86_energy_perf_policy: remove unneeded check Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2017-06-28 11:45 Dan Carpenter

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 NNTP newsgroup(s).