[chrony-dev] [PATCH] ntp_core.c: Remove useless assignment `prev = inst->local_rx;`

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


Date: Thu, 3 Oct 2013 14:01:32 +0200

The Clang static analyzer scan-build found the following unneeded
assignment.

        /usr/share/clang/scan-build/ccc-analyzer -O2 -g  -c sources.c
        ntp_core.c:1545:3: warning: Value stored to 'prev' is never read
          prev = inst->local_rx;
          ^      ~~~~~~~~~~~~~~
        1 warning generated.

Indeed `prev` is not read before being assigned the same value again
some lines below.
---
 ntp_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ntp_core.c b/ntp_core.c
index 31f69ef..2af96cd 100644
--- a/ntp_core.c
+++ b/ntp_core.c
@@ -1542,7 +1542,6 @@ NCR_SlewTimes(NCR_Instance inst, struct timeval *when, double dfreq, double doff
 {
   struct timeval prev;
   double delta;
-  prev = inst->local_rx;
   if (inst->local_rx.tv_sec || inst->local_rx.tv_usec)
     UTI_AdjustTimeval(&inst->local_rx, when, &inst->local_rx, &delta, dfreq, doffset);
 #ifdef TRACEON
-- 
1.8.4.rc3

Attachment: signature.asc
Description: This is a digitally signed message part



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/