[MM] [PATCH] novatel: fix invalid comparison of unsigned expression



This patch fixes the following invalid comparison of unsigned expression:

novatel/mm-plugin-novatel.c:148:29: error: comparison of unsigned
      expression >= 0 is always true [-Werror,-Wtautological-compare]
    if (ctx->nwdmat_retries >= 0) {
        ~~~~~~~~~~~~~~~~~~~ ^  ~

Bug reported on https://code.google.com/p/chromium/issues/detail?id=242150
---
 plugins/novatel/mm-plugin-novatel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/novatel/mm-plugin-novatel.c b/plugins/novatel/mm-plugin-novatel.c
index 4d09f23..2b4497b 100644
--- a/plugins/novatel/mm-plugin-novatel.c
+++ b/plugins/novatel/mm-plugin-novatel.c
@@ -145,7 +145,7 @@ custom_init_step (CustomInitContext *ctx)
         return;
     }
 
-    if (ctx->nwdmat_retries >= 0) {
+    if (ctx->nwdmat_retries > 0) {
         ctx->nwdmat_retries--;
         mm_at_serial_port_queue_command (ctx->port,
                                          "$NWDMAT=1",
-- 
1.8.2.1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]