]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
Fix warnings
authorOren Kladnitsky <orenk@dev.mellanox.co.il>
Tue, 24 Dec 2013 13:32:10 +0000 (15:32 +0200)
committerOren Kladnitsky <orenk@dev.mellanox.co.il>
Tue, 24 Dec 2013 13:32:10 +0000 (15:32 +0200)
cmdparser/my_getopt.c
mtcr_ul/Makefile.am
mtcr_ul/mtcr_ib_ofed.c
mtcr_ul/mtcr_ul.c
small_utils/mcra.c
small_utils/vpd.c

index 6bd7ce8b34d8366686363b4e9b97fcf2f8ed193d..2a2b97d5be01ee75400367efa8978efba1f327d6 100755 (executable)
    /* Start processing options with ARGV-element 1 (since ARGV-element 0
       is the program name); the sequence of previously skipped
       non-option ARGV-elements is empty.  */
+   (void)argc;
+   (void)argv;
+
    first_nonopt = last_nonopt = tools_optind;
  
    nextchar = NULL;
                  }
                else
                  {
-                   if (tools_opterr)
+                   if (tools_opterr) {
                     if (argv[tools_optind - 1][1] == '-')
                      /* --option */
                      fprintf (stderr,
                      fprintf (stderr,
                       _("%s: option `%c%s' doesn't allow an argument\n"),
                       argv[0], argv[tools_optind - 1][0], pfound->name);
+                   }
                    nextchar += strlen (nextchar);
  
                    tools_optopt = pfound->val;
index f9f3e12f2586c724fa1f94b967c852cd3fd45701..6229e922f020e07c62ad8575d8a0041a3d725624 100644 (file)
@@ -37,7 +37,7 @@ lib_LIBRARIES = libmtcr_ul.a
 
 libmtcr_ul_a_SOURCES = mtcr_ul.c mtcr_ib_ofed.c mtcr_ib.h  mtcr_int_defs.h
 
-libmtcr_ul_a_CFLAGS = -W  -g -MP -MD -fPIC -DMTCR_API="" -DMST_UL
+libmtcr_ul_a_CFLAGS = -W -Wall -g -MP -MD -fPIC -DMTCR_API="" -DMST_UL
 libraryincludedir=$(includedir)/mtcr_ul
 libraryinclude_HEADERS = $(top_srcdir)/include/mtcr_ul/mtcr.h
 
index eaef384886f24e81c5bb961abea8675c07589cf0..d8206cd52ae9513ab8c58b82f82745f8746560f0 100644 (file)
@@ -1,25 +1,25 @@
 /*
  * Copyright (C) Jan 2013 Mellanox Technologies Ltd. All rights reserved.
- * 
+ *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
  * General Public License (GPL) Version 2, available from the file
  * COPYING in the main directory of this source tree, or the
  * OpenIB.org BSD license below:
- * 
+ *
  *     Redistribution and use in source and binary forms, with or
  *     without modification, are permitted provided that the following
  *     conditions are met:
- * 
+ *
  *      - Redistributions of source code must retain the above
  *        copyright notice, this list of conditions and the following
  *        disclaimer.
- * 
+ *
  *      - Redistributions in binary form must reproduce the above
  *        copyright notice, this list of conditions and the following
  *        disclaimer in the documentation and/or other materials
  *        provided with the distribution.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -403,7 +403,7 @@ int free_dll_handle(mfile *mf) {
 
 int process_dynamic_linking(ibvs_mad *ivm, int mad_init)
 {
-
+    (void)mad_init;
     char* libs[] = {"libibmad.so.5"};
 
     u_int32_t i;
index 9beb760005cd4293a1958511d99900e29809d37e..884614e5136a1f6131d49cfff74dec731f845cfc 100644 (file)
@@ -1104,7 +1104,8 @@ int mget_mdevs_flags(mfile *mf, u_int32_t *devs_flags)
 static
 int get_inband_dev_from_pci(char* inband_dev, char* pci_dev)
 {
-    unsigned domain = 0, bus = 0, dev = 0, func = 0, force = 0;
+    unsigned domain = 0, bus = 0, dev = 0, func = 0;
+    int force = 0;
     enum mtcr_access_method access;
     DIR* d;
     struct dirent *dir;
@@ -1173,7 +1174,7 @@ int maccess_reg_mad(mfile *mf, u_int8_t *data)
         }
     }
 
-    mf->maccess_reg(mf, data);
+    return mf->maccess_reg(mf, data);
 }
 
 int mos_reg_access(mfile *mf, int reg_access, void *reg_data, u_int32_t cmd_type)
index a35556c61c550660eb963f5e5be2aaab2227b315..5bdbf4743d3367259474448fb21cb70026473488 100644 (file)
@@ -259,7 +259,6 @@ int main(int argc, char *argv[])
         char* fpath;
         char line[1024];
         char *offset, *size;
-        unsigned tmp;
         int path_found = 0;
 
         if (!adb_dump) {
index e8bea4bee8a1c6b5faa7bf3bf68302d251954147..65575358555f6d2ff0dfe0f441f9ed9d997fc05a 100644 (file)
@@ -108,9 +108,9 @@ typedef unsigned char vpd_t[VPD_MAX_SIZE];
 
 #define VPD_TAG_LARGE(d) ((d)->type & 0x80)
 
-#define VPD_TAG_LENGTH(d) (VPD_TAG_LARGE(d) ? ((((d)->large.length_msb) << 8) | \
+#define VPD_TAG_LENGTH(d) ((unsigned)(VPD_TAG_LARGE(d) ? ((((d)->large.length_msb) << 8) | \
                                               ((d)->large.length_lsb)) :       \
-                          ((d)->type & 0x7))
+                          ((d)->type & 0x7)))
 
 #define VPD_TAG_HEAD(d) (VPD_TAG_LARGE(d) ? sizeof (d)->large : sizeof (d)->small)
 
@@ -278,7 +278,7 @@ void vpd_show_field(FILE *f, struct vpd_field *field)
 void vpd_show_fields(FILE *f, union vpd_data_type *d, const char *keyword)
 {
        struct vpd_field *field;
-       int i;
+       unsigned i;
 
        for (i = 0; i < VPD_TAG_LENGTH(d); i += 0x3 + field->length) {
                field = (struct vpd_field *)(VPD_TAG_DATA(d)->bytes + i);
@@ -290,7 +290,7 @@ void vpd_show_fields(FILE *f, union vpd_data_type *d, const char *keyword)
 
 void vpd_show_id(FILE *f, union vpd_data_type *d)
 {
-       int i;
+       unsigned i;
 
        fputs("ID: ", f);
        for (i = 0; i < VPD_TAG_LENGTH(d); ++i)
@@ -322,7 +322,7 @@ void vpd_show_one(FILE *f, union vpd_data_type* d, const char *keyword)
 int vpd_check(vpd_t vpd, int checksum, int ignore_w)
 {
        unsigned char b;
-       int i;
+       unsigned i;
        unsigned offset;
        int rc;
        union vpd_data_type *d = NULL;