diff mbox series

[U-Boot,1/4] linux/time.h: Remove dead code

Message ID 20171006130459.29127-1-marek.behun@nic.cz
State Accepted
Commit 502af618ec3d60f3c8b9914e3484f112fb295b6e
Delegated to: Tom Rini
Headers show
Series [U-Boot,1/4] linux/time.h: Remove dead code | expand

Commit Message

Marek BehĂșn Oct. 6, 2017, 1:04 p.m. UTC
Since
  rem = ((long) *tim_p) % SECSPERDAY;
the second while cycle
  while (rem >= SECSPERDAY)
is dead.

Reported-by: Coverity (CID: 167334)
Signed-off-by: Marek Behun <marek.behun@nic.cz>
---
 include/linux/time.h | 5 -----
 1 file changed, 5 deletions(-)

Comments

Tom Rini Oct. 17, 2017, 12:47 a.m. UTC | #1
On Fri, Oct 06, 2017 at 03:04:56PM +0200, Marek BehĂșn wrote:

> Since
>   rem = ((long) *tim_p) % SECSPERDAY;
> the second while cycle
>   while (rem >= SECSPERDAY)
> is dead.
> 
> Reported-by: Coverity (CID: 167334)
> Signed-off-by: Marek Behun <marek.behun@nic.cz>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/include/linux/time.h b/include/linux/time.h
index bf12b99d37..b8d298eb4d 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -93,11 +93,6 @@  _DEFUN (localtime_r, (tim_p, res),
 	rem += SECSPERDAY;
 	--days;
     }
-    while (rem >= SECSPERDAY)
-    {
-	rem -= SECSPERDAY;
-	++days;
-    }
 
     /* compute hour, min, and sec */
     res->tm_hour = (int) (rem / SECSPERHOUR);