diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2016-05-25 14:34:54 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2016-05-25 14:34:54 +0000 |
commit | eb96c6181e4436199a942054891420a07969f885 (patch) | |
tree | a2e3366d4def02225988d55caafc8d137ad169a2 /src | |
parent | 1cf38337d813d7d564fde9e7cfc47388cad89e16 (diff) | |
download | sg3_utils-eb96c6181e4436199a942054891420a07969f885.tar.gz |
gcc-6: -Wmisleading-indentation cleanups
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@708 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src')
-rw-r--r-- | src/sg_sat_identify.c | 15 | ||||
-rw-r--r-- | src/sg_ses.c | 5 | ||||
-rw-r--r-- | src/sginfo.c | 5 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/sg_sat_identify.c b/src/sg_sat_identify.c index 8524df3d..f74059fb 100644 --- a/src/sg_sat_identify.c +++ b/src/sg_sat_identify.c @@ -9,6 +9,7 @@ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <getopt.h> #define __STDC_FORMAT_MACROS 1 @@ -49,7 +50,7 @@ #define EBUFF_SZ 256 -static const char * version_str = "1.13 20160517"; +static const char * version_str = "1.14 20160525"; static struct option long_options[] = { {"ck_cond", no_argument, 0, 'c'}, @@ -118,8 +119,8 @@ static int do_identify_dev(int sg_fd, int do_packet, int cdb_len, int byte_block = 1; /* 0 -> bytes, 1 -> 512 byte blocks (if t_type=0) */ int t_length = 2; /* 0 -> no data transferred, 2 -> sector count */ int resid = 0; - int got_ard = 0; /* got ATA result descriptor */ - int got_fixsense = 0; /* got ATA result in fixed format sense */ + bool got_ard = false; /* got ATA result descriptor */ + bool got_fixsense = false; /* got ATA result in fixed format sense */ int sb_sz; struct sg_scsi_sense_hdr ssh; unsigned char inBuff[ID_RESPONSE_LEN]; @@ -221,17 +222,17 @@ static int do_identify_dev(int sg_fd, int do_packet, int cdb_len, "Descriptor\n"); return SG_LIB_CAT_RECOVERED; } - got_ard = 1; + got_ard = true; break; } else if (0x70 == ssh.response_code) { - got_fixsense = 1; + got_fixsense = true; break; } else { if (verbose < 2) pr2serr("ATA PASS-THROUGH (%d), unexpected " "response_code=0x%x\n", ssh.response_code, cdb_len); - return SG_LIB_CAT_RECOVERED; + return SG_LIB_CAT_RECOVERED; } } else if (SPC_SK_RECOVERED_ERROR == ssh.sense_key) return SG_LIB_CAT_RECOVERED; @@ -299,7 +300,7 @@ static int do_identify_dev(int sg_fd, int do_packet, int cdb_len, return -1; } - if ((SAT_ATA_RETURN_DESC == ata_return_desc[0]) && (0 == got_ard)) + if ((SAT_ATA_RETURN_DESC == ata_return_desc[0]) && (! got_ard)) pr2serr("Seem to have got ATA Result Descriptor but it was not " "indicated\n"); if (got_ard) { diff --git a/src/sg_ses.c b/src/sg_ses.c index d20ab614..d56f6a64 100644 --- a/src/sg_ses.c +++ b/src/sg_ses.c @@ -31,7 +31,7 @@ * commands tailored for SES (enclosure) devices. */ -static const char * version_str = "2.16 20160518"; /* ses3r13 */ +static const char * version_str = "2.17 20160525"; /* ses3r13 */ #define MX_ALLOC_LEN ((64 * 1024) - 4) /* max allowable for big enclosures */ #define MX_ELEM_HDR 1024 @@ -2145,12 +2145,13 @@ enc_status_helper(const char * pad, const uint8_t * statp, int etype, printf("%sDevice bypassed B=%d\n", pad, !!(statp[3] & 0x1)); break; case POWER_SUPPLY_ETC: - if (nofilter || ((0xc0 & statp[1]) || (0xe & statp[2]))) + if (nofilter || ((0xc0 & statp[1]) || (0xe & statp[2]))) { printf("%sIdent=%d, Do not remove=%d, DC overvoltage=%d, " "DC undervoltage=%d\n", pad, !!(statp[1] & 0x80), !!(statp[1] & 0x40), !!(statp[2] & 0x8), !!(statp[2] & 0x4)); printf("%s DC overcurrent=%d\n", pad, !!(statp[2] & 0x2)); + } if (nofilter || (0xf8 & statp[3])) printf("%sHot swap=%d, Fail=%d, Requested on=%d, Off=%d, " "Overtmp fail=%d\n", pad, !!(statp[3] & 0x80), diff --git a/src/sginfo.c b/src/sginfo.c index 2d2f78d7..3b0ef55f 100644 --- a/src/sginfo.c +++ b/src/sginfo.c @@ -122,7 +122,7 @@ #define _GNU_SOURCE 1 #endif -static const char * version_str = "2.35 [20140403]"; +static const char * version_str = "2.36 [20160525]"; #include <stdio.h> #include <string.h> @@ -899,10 +899,11 @@ get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd, fprintf(stdout, ">>> Unable to read %s mode page 0x%x, subpage " "0x%x [mode_sense_10]\n", get_page_name(mpi), mpi->page, mpi->subpage); - else + else { fprintf(stdout, ">>> Unable to read %s mode page (0x%x) " "[mode_sense_10]\n", get_page_name(mpi), mpi->page); return status; + } } mpi->resp_len = (resp[0] << 8) + resp[1] + 2; if (sngl_fetch) { |