aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2008-06-04 18:56:15 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2008-06-04 18:56:15 +0000
commit1ed38622e036161089f63939413f673c79ac81f0 (patch)
treecfafc43e27e6e88e7e3da3e36dcee3c7859d0fcf
parente435ab5aeb5b54382ded4a6525c2b5f4c4956f72 (diff)
downloadsg3_utils-1ed38622e036161089f63939413f673c79ac81f0.tar.gz
remove trailing spaces from various source files
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@178 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog2
-rw-r--r--README2
-rw-r--r--debian/changelog2
-rw-r--r--doc/sg3_utils.82
-rw-r--r--doc/sg_dd.818
-rw-r--r--doc/sg_emc_trespass.82
-rw-r--r--doc/sg_format.86
-rw-r--r--doc/sg_get_config.82
-rw-r--r--doc/sg_ident.82
-rw-r--r--doc/sg_inq.86
-rw-r--r--doc/sg_logs.84
-rw-r--r--doc/sg_map26.84
-rw-r--r--doc/sg_modes.82
-rw-r--r--doc/sg_opcodes.84
-rw-r--r--doc/sg_persist.822
-rw-r--r--doc/sg_raw.84
-rw-r--r--doc/sg_read.818
-rw-r--r--doc/sg_readcap.84
-rw-r--r--doc/sg_reassign.84
-rw-r--r--doc/sg_reset.82
-rw-r--r--doc/sg_rmsn.82
-rw-r--r--doc/sg_rtpg.82
-rw-r--r--doc/sg_safte.82
-rw-r--r--doc/sg_scan.818
-rw-r--r--doc/sg_senddiag.88
-rw-r--r--doc/sg_ses.86
-rw-r--r--doc/sg_start.82
-rw-r--r--doc/sg_test_rwbuf.82
-rw-r--r--doc/sg_turs.82
-rw-r--r--doc/sg_vpd.82
-rw-r--r--doc/sg_wr_mode.82
-rw-r--r--doc/sg_write_long.84
-rw-r--r--doc/sginfo.834
-rw-r--r--doc/sgm_dd.812
-rw-r--r--doc/sgp_dd.810
-rw-r--r--examples/scsi_inquiry.c10
-rw-r--r--examples/sg_simple2.c10
-rw-r--r--examples/sg_simple4.c4
-rw-r--r--include/sg_io_linux.h4
-rw-r--r--include/sg_lib.h4
-rw-r--r--include/sg_lib_data.h2
-rw-r--r--lib/sg_cmds_basic.c22
-rw-r--r--lib/sg_cmds_extra.c24
-rw-r--r--lib/sg_cmds_mmc.c2
-rw-r--r--lib/sg_io_linux.c4
-rw-r--r--lib/sg_lib.c36
-rw-r--r--lib/sg_lib_data.c12
-rw-r--r--lib/sg_pt_freebsd.c2
-rw-r--r--lib/sg_pt_linux.c4
-rw-r--r--lib/sg_pt_win32.c4
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_dd.c46
-rw-r--r--src/sg_emc_trespass.c16
-rw-r--r--src/sg_format.c16
-rw-r--r--src/sg_get_config.c2
-rw-r--r--src/sg_ident.c6
-rw-r--r--src/sg_inq.c60
-rw-r--r--src/sg_logs.c138
-rw-r--r--src/sg_luns.c6
-rw-r--r--src/sg_map.c20
-rw-r--r--src/sg_modes.c40
-rw-r--r--src/sg_opcodes.c14
-rw-r--r--src/sg_persist.c38
-rw-r--r--src/sg_raw.c4
-rw-r--r--src/sg_rbuf.c8
-rw-r--r--src/sg_rdac.c12
-rw-r--r--src/sg_read.c24
-rw-r--r--src/sg_read_long.c2
-rw-r--r--src/sg_readcap.c14
-rw-r--r--src/sg_reassign.c6
-rw-r--r--src/sg_requests.c4
-rw-r--r--src/sg_rmsn.c4
-rw-r--r--src/sg_rtpg.c2
-rw-r--r--src/sg_safte.c6
-rw-r--r--src/sg_sat_identify.c2
-rw-r--r--src/sg_sat_phy_event.c4
-rw-r--r--src/sg_sat_set_features.c2
-rw-r--r--src/sg_scan.c10
-rw-r--r--src/sg_senddiag.c6
-rw-r--r--src/sg_ses.c46
-rw-r--r--src/sg_start.c8
-rw-r--r--src/sg_stpg.c10
-rw-r--r--src/sg_test_rwbuf.c32
-rw-r--r--src/sg_vpd.c48
-rw-r--r--src/sg_vpd_vendor.c4
-rw-r--r--src/sg_write_long.c6
-rw-r--r--src/sginfo.c212
-rw-r--r--src/sgm_dd.c24
-rw-r--r--src/sgp_dd.c24
-rw-r--r--utils/hxascdmp.c16
90 files changed, 654 insertions, 654 deletions
diff --git a/ChangeLog b/ChangeLog
index 692bff53..8c63b832 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.
-Changelog for sg3_utils-1.26 [20080602] [svn: r177]
+Changelog for sg3_utils-1.26 [20080604] [svn: r178]
- sg_sat_phy_event: new utility; copied from examples
directory and enhanced, rename original to sg__sat_phy_event
- sg_ses: sync with ses2r19b, many nomenclature changes
diff --git a/README b/README
index aaab8177..9b00c754 100644
--- a/README
+++ b/README
@@ -343,4 +343,4 @@ See http://www.torque.net/sg/tools.html
Doug Gilbert
-2nd June 2008
+4th June 2008
diff --git a/debian/changelog b/debian/changelog
index bb119a9f..c2c41e71 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.26-0.1) unstable; urgency=low
* New upstream version
- -- Doug Gilbert <dgilbert@interlog.com> Mon, 02 Jun 2008 00:33:00 -0400
+ -- Doug Gilbert <dgilbert@interlog.com> Wed, 04 Jun 2008 15:00:00 -0400
sg3-utils (1.25-0.1) unstable; urgency=low
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index da8a96bf..13f743c7 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -25,7 +25,7 @@ http://www.t10.org/scsi\-3.htm with the SCSI command sets in the upper part
of the diagram. SCSI commands in common with all device types can be found
in SPC of which SPC\-4 is the latest major version. Block device specific
commands (e.g. as used by disks) are in SBC, those for tape drives in
-SSC and those for CD/DVD/HD_DVD/BD drives in MMC.
+SSC and those for CD/DVD/HD_DVD/BD drives in MMC.
.PP
There are two generations of command line option usage. The newer
utilities (written since July 2004) use the getopt_long() function to parse
diff --git a/doc/sg_dd.8 b/doc/sg_dd.8
index a25f5b1b..2e585373 100644
--- a/doc/sg_dd.8
+++ b/doc/sg_dd.8
@@ -18,7 +18,7 @@ Copy data to and from any files. Specialized for "files" that are Linux SCSI
generic (sg) devices, raw devices or other devices that support the SG_IO
ioctl (which are only found in the lk 2.6 series). Similar syntax and
semantics to
-.B dd(1)
+.B dd(1)
but does not perform any conversions.
.PP
The first group in the synopsis above are "standard" Unix
@@ -29,9 +29,9 @@ Both groups are defined below.
.TP
\fBblk_sgio\fR=0 | 1
when set to 0, block devices (e.g. /dev/sda) are treated like normal
-files (i.e.
+files (i.e.
.B read(2)
-and
+and
.B write(2)
are used for IO). When set to 1, block devices are assumed to accept the
SG_IO ioctl and SCSI commands are issued for IO. This is only supported
@@ -65,10 +65,10 @@ have 2048 byte blocks). For this utility the maximum size of each individual
IO operation is \fIBS\fR * \fIBPT\fR bytes.
.TP
\fBcdbsz\fR=6 | 10 | 12 | 16
-size of SCSI READ and/or WRITE commands issued on sg device
+size of SCSI READ and/or WRITE commands issued on sg device
names (or block devices when 'iflag=sgio' and/or 'oflag=sgio' is given).
Default is 10 byte SCSI command blocks (unless calculations indicate
-that a 4 byte block number may be exceeded or \fIBPT\fR is greater than
+that a 4 byte block number may be exceeded or \fIBPT\fR is greater than
16 bits (65535), in which case it defaults to 16 byte SCSI commands).
.TP
\fBcoe\fR=0 | 1 | 2 | 3
@@ -86,7 +86,7 @@ the copy soon after unrecorded media is detected while still
offering "continue on error" capability.
.TP
\fBcount\fR=\fICOUNT\fR
-copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
+copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices
report from SCSI READ CAPACITY commands or that block devices (or their
partitions) report. Normal files are not probed for their size. If
@@ -134,7 +134,7 @@ write to \fIOFILE\fR instead of stdout. If \fIOFILE\fR is '\-' then writes
to stdout. If \fIOFILE\fR is /dev/null then no actual writes are performed.
If \fIOFILE\fR is '.' (period) then it is treated the same way as
/dev/null (this is a shorthand notation). If \fIOFILE\fR exists then it
-is _not_ truncated; it is overwritten from the start of \fIOFILE\fR
+is _not_ truncated; it is overwritten from the start of \fIOFILE\fR
unless 'oflag=append' or \fISEEK\fR is given.
.TP
\fBoflag\fR=\fIFLAGS\fR
@@ -209,7 +209,7 @@ error recovery mode page (the sdparm utility to access and possibly change
these attributes)). Errors occurring on other files types will stop sg_dd.
Error messages are sent to stderr. This flag is similar
o 'conv=noerror,sync' in the
-.B dd(1)
+.B dd(1)
utility. See note about READ LONG below.
.TP
dio
@@ -319,7 +319,7 @@ SCSI adapter DMAs into kernel buffers and then the sg driver copies
this data into user memory (write operations reverse this sequence).
This is called "indirect IO" and there is a 'dio' option to
select "direct IO" which will DMA directly into user memory. Due to some
-issues "direct IO" is disabled in the sg driver and needs a
+issues "direct IO" is disabled in the sg driver and needs a
configuration change to activate it. This is typically done
with 'echo 1 > /proc/scsi/sg/allow_dio'.
.PP
diff --git a/doc/sg_emc_trespass.8 b/doc/sg_emc_trespass.8
index 6a46fe9f..0f24688e 100644
--- a/doc/sg_emc_trespass.8
+++ b/doc/sg_emc_trespass.8
@@ -4,7 +4,7 @@ sg_emc_trespass \- Changes ownership of a LUN from another
Service\-Processor to this one.
.SH SYNOPSIS
.B sg_emc_trespass
-[\fI\-d\fR] [\fI\-hr\fR] [\fI\-s\fR]
+[\fI\-d\fR] [\fI\-hr\fR] [\fI\-s\fR]
[\fI\-V\fR] \fIDEVICE\fR
.SH DESCRIPTION
.\" Add any additional description here
diff --git a/doc/sg_format.8 b/doc/sg_format.8
index e3050664..5c2ac97a 100644
--- a/doc/sg_format.8
+++ b/doc/sg_format.8
@@ -137,7 +137,7 @@ terabytes (almost 2 ** 41 bytes) on a single disk. This option selects
commands and parameters that allow for 64 bit logical block addresses.
Specifically this is the "longlba" flag in the MODE SENSE (10) command
and READ CAPACITY (16) rather than READ CAPACITY (10). When a disk
-supports "protection information" then this option may also be useful.
+supports "protection information" then this option may also be useful.
.TP
\fB\-P\fR, \fB\-\-pfu\fR=\fIPFU\fR
sets the "Protection Field Usage" field in the parameter block associated
@@ -160,7 +160,7 @@ The contents of all logical blocks on the media remain unchanged when
this option is used. This means that any resize operation can be
reversed. This option cannot be used together with either \fI\-\-format\fR
or a \fI\-\-size=SIZE\fR whose argument is different to the existing block
-size.
+size.
.TP
\fB\-R\fR, \fB\-\-rto_req\fR
instructs a format to enable application client ownership of
@@ -227,7 +227,7 @@ the CLIST is generated and used during the format process.
.PP
The sg_format utility does not permit a user to provide a defect
list (i.e. DLIST). All protection information options are off by
-default.
+default.
.SH NOTES
The SBC\-2 standard states that the REQUEST SENSE command should be used
for obtaining a progress indication when the format command is underway.
diff --git a/doc/sg_get_config.8 b/doc/sg_get_config.8
index 4961c9a9..d7db44dd 100644
--- a/doc/sg_get_config.8
+++ b/doc/sg_get_config.8
@@ -104,7 +104,7 @@ brackets. The draft immediately prior to standardization can
be found at http://www.t10.org . In the initial MMC standard there
was no GET CONFIGURATION command and the relevant information was
obtained from the "CD capabilities and mechanical status mode
-page" (mode page 0x2a). It was later renamed the "MM capabilities and
+page" (mode page 0x2a). It was later renamed the "MM capabilities and
mechanical status mode page" and has been made obsolete in MMC\-4 and
MMC\-5. The GET CONFIGURATION command was introduced in MMC\-2 and has
become a replacement for that mode page. New features such as support
diff --git a/doc/sg_ident.8 b/doc/sg_ident.8
index 7bae4eec..a6dcee6d 100644
--- a/doc/sg_ident.8
+++ b/doc/sg_ident.8
@@ -95,7 +95,7 @@ If it is ASCII then it can printed as such:
.br
1234567890
.PP
-The information can be copied to a file, cleared and then
+The information can be copied to a file, cleared and then
re\-asserted with this sequence:
.PP
# sg_ident \-\-raw /dev/sdb > t
diff --git a/doc/sg_inq.8 b/doc/sg_inq.8
index 0b5a0a63..d6308877 100644
--- a/doc/sg_inq.8
+++ b/doc/sg_inq.8
@@ -22,7 +22,7 @@ This utility by default sends a SCSI INQUIRY command to the given
device and then outputs the response. All SCSI devices are meant
to respond to a "standard" INQUIRY command with at least a 36 byte
response (in SCSI 2 and higher). An INQUIRY is termed as "standard"
-when both the EVPD and CmdDt (obsolete) bits are clear.
+when both the EVPD and CmdDt (obsolete) bits are clear.
.PP
This utility supports two command line syntaxes, the preferred one is
shown first in the synopsis and explained in this section. A later
@@ -139,7 +139,7 @@ print out version string then exit.
set the Enable Vital Product Data (EVPD) bit (defaults to clear(0)). Used in
conjunction with the \fI\-\-page=PG\fR option where \fIPG\fR specifies the
VPD page number to query. If the \fI\-\-page=PG\fR is not given then \fIPG\fR
-defaults to zero which is the "Supported VPD pages" VPD page.
+defaults to zero which is the "Supported VPD pages" VPD page.
.SH NOTES
Some devices with weak SCSI command set implementations lock up when
they receive commands they don't understand (or even response lengths
@@ -197,7 +197,7 @@ DEVICE command add the \fI\-\-ata\fR option (e.g. "sg_inq \-\-ata /dev/hdc).
This utility doesn't decode the response to an ATA IDENTIFY (PACKET)
DEVICE command, hdparm does a good job at that. The '\-HHH' option has
been added for use with either the '\-\-ata' or '\-\-page=ai'
-option to produce a format acceptable to "hdparm \-\-Istdin".
+option to produce a format acceptable to "hdparm \-\-Istdin".
An example: 'sg_inq \-\-ata \-HHH /dev/hdc | hdparm \-\-Istdin'. See hdparm.
.SH EXIT STATUS
The exit status of sg_inq is 0 when it is successful. Otherwise see
diff --git a/doc/sg_logs.8 b/doc/sg_logs.8
index 9c021f44..a1cad0b3 100644
--- a/doc/sg_logs.8
+++ b/doc/sg_logs.8
@@ -243,7 +243,7 @@ Options with arguments or with two or more letters can have an extra '\-'
prepended. For example: both '\-pcb' and '\-\-pcb' are acceptable.
.TP
\fB\-a\fR
-outputs all the log pages supported by the device.
+outputs all the log pages supported by the device.
Equivalent to \fI\-\-all\fR in the main description.
.TP
\fB\-A\fR
@@ -289,7 +289,7 @@ subpage code of 'ff' can be thought of as a wildcard.
.TP
\fB\-paramp\fR=\fIPP\fR
\fIPP\fR is the parameter pointer value (in hex) to place in command.
-Should be a number between 0 and ffff inclusive.
+Should be a number between 0 and ffff inclusive.
.TP
\fB\-pcb\fR
show Parameter Control Byte settings (only relevant when log parameters
diff --git a/doc/sg_map26.8 b/doc/sg_map26.8
index 2dc2d103..96b90d21 100644
--- a/doc/sg_map26.8
+++ b/doc/sg_map26.8
@@ -26,7 +26,7 @@ a SCSI generic (sg) node and the higher level SCSI device name; or
vice versa. For example '/dev/sg0' may "map" to '/dev/sda'.
Mappings may not exist, if a relevant module is not loaded, for
example. Also there are SCSI devices that can only be accessed via a sg
-node (e.g. SAF\-TE and some SES devices).
+node (e.g. SAF\-TE and some SES devices).
.PP
In this utility, "matching" refers to different representations of
the same device accessed via the same driver. For example, '/dev/hdc'
@@ -89,7 +89,7 @@ special files can be anything the user desires (e.g. '/dev/sda'
could be named '/dev/my_boot_disk'). When trying to
find a resultant device special file, this utility uses the major
and minor numbers (and whether a block or char device is sought)
-to search the device directory.
+to search the device directory.
.PP
This utility only shows one relationship at a time. To get an
overview of all SCSI devices, with special file names and optionally
diff --git a/doc/sg_modes.8 b/doc/sg_modes.8
index 7ff91058..8343a808 100644
--- a/doc/sg_modes.8
+++ b/doc/sg_modes.8
@@ -250,7 +250,7 @@ two hexadecimal digits (e.g. "3e"). Useful as input (after editing) to
the sg_wr_mode(8) utility.
.TP
\fB\-subp\fR=\fISPG\fR
-sub page code to fetch. Should be a hexadecimal number between 0 and
+sub page code to fetch. Should be a hexadecimal number between 0 and
0xff inclusive. The default value is 0.
.TP
\fB\-v\fR
diff --git a/doc/sg_opcodes.8 b/doc/sg_opcodes.8
index 30e299f5..c332baba 100644
--- a/doc/sg_opcodes.8
+++ b/doc/sg_opcodes.8
@@ -77,7 +77,7 @@ of zero means that no timeout is indicated and this is shown in
the corresponding decoded output as "\-".
.TP
\fB\-s\fR, \fB\-\-sa\fR=\fISA\fR
-the \fIDEVICE\fR will be queried for a command with the given service
+the \fIDEVICE\fR will be queried for a command with the given service
action (i.e. the \fISA\fR value). Used in conjunction with the
\fI\-\-opcode=OP\fR option. If this option is not given, \fI\-\-opcode=OP\fR
is given and the command in question does have a service action then a value
@@ -139,7 +139,7 @@ set the report command timeout descriptor (RCTD) bit in cdb. Equivalent
to \fI\-\-rctd\fR in main description.
.TP
\fB\-s\fR=\fISA\fR
-the \fIDEVICE\fR will be queried for a command with the given service
+the \fIDEVICE\fR will be queried for a command with the given service
action (i.e. \fISA\fR). Used in conjunction with the \fI\-o=OP\fR
option. If this option is not given, \fI\-o=OP\fR is given and the command
in question does have a service action then a value of 0 will be assumed.
diff --git a/doc/sg_persist.8 b/doc/sg_persist.8
index 1446fb78..3a66b51e 100644
--- a/doc/sg_persist.8
+++ b/doc/sg_persist.8
@@ -42,7 +42,7 @@ against accidental use, the \fI\-\-out\fR option must be given when a
PROUT sub\-command (e.g. \fI\-\-register\fR) is used.
.PP
The older SCSI RESERVE and RELEASE commands (both 6 and 10 byte variants)
-are not supported by this utility. In SPC\-3, RESERVE and RELEASE are
+are not supported by this utility. In SPC\-3, RESERVE and RELEASE are
deprecated, replaced by Persistent Reservations. RESERVE and RELEASE
have been removed from SPC\-4 and Annex B is provided showing how to
convert to persistent reservation commands. See a utility
@@ -56,7 +56,7 @@ the \fI\-\-device=DEVICE\fR option.
SPC\-4 does not use the term "sub\-command". It uses the term "service action"
for this and for part of a field's name in the parameter block associated
with the PROUT command (i.e. "service action reservation key"). To lessen
-the potential confusion the term "sub\-command" has been introduced.
+the potential confusion the term "sub\-command" has been introduced.
.SH OPTIONS
Arguments to long options are mandatory for short options as well.
The following options are sorted in alphabetical order, based on their
@@ -131,15 +131,15 @@ needs to match the type of the reservation. ACA and other pending tasks are
aborted.
.TP
\fB\-T\fR, \fB\-\-prout\-type\fR=\fITYPE\fR
-specify the PROUT command's 'type' argument. Required by
+specify the PROUT command's 'type' argument. Required by
the 'register\-move', 'reserve', 'release' and 'preempt (and abort)'
sub\-commands. Valid \fITYPE\fR values: 1\-> write exclusive, 3\->
-exclusive access, 5\-> write exclusive \- registrants only, 6\->
+exclusive access, 5\-> write exclusive \- registrants only, 6\->
exclusive access \- registrants only, 7\-> write exclusive \- all registrants,
8\-> exclusive access \- all registrants. Default value is 0 (which is
an invalid type). Each "persistent reservation type" is explained in more
detail in a subsection of that name in the read reservation section of
-the PRIN command (section 6.13.3.4 of SPC\-4 revision 9).
+the PRIN command (section 6.13.3.4 of SPC\-4 revision 9).
.TP
\fB\-s\fR, \fB\-\-read\-full\-status\fR
Read Full Status is a sub\-command of the PRIN command. For each registration
@@ -162,7 +162,7 @@ same as \fI\-\-read\-full\-status\fR.
.TP
\fB\-G\fR, \fB\-\-register\fR
Register is a sub\-command of the PROUT command. It has 3 different
-actions depending on associated parameters. a) add a new registration
+actions depending on associated parameters. a) add a new registration
with '\-\-param\-rk=0' and '\-\-param\-sark=<new_rk>'; b) Change an existing
registration with '\-\-param\-rk=<old_rk>'
and '\-\-param\-sark=<new_rk>'; or c) Delete an existing registration
@@ -192,7 +192,7 @@ in the range 0 to ffff inclusive. Defaults to 0 .
.TP
\fB\-L\fR, \fB\-\-release\fR
Release is a sub\-command of the PROUT command. It releases the
-current persistent reservation. The \fI\-\-prout\-type=TYPE\fR
+current persistent reservation. The \fI\-\-prout\-type=TYPE\fR
and \fI\-\-param\-rk=RK\fR options, matching the reservation, must also be
specified.
.TP
@@ -252,16 +252,16 @@ print out version string. Ignore all other parameters.
output usage message. Ignore all other parameters.
.SH NOTES
In the 2.4 series of Linux kernels the \fIDEVICE\fR must be
-a SCSI generic (sg) device. In the 2.6 series any SCSI device
-name (e.g. /dev/sdc, /dev/st1m or /dev/sg3) can be specified.
+a SCSI generic (sg) device. In the 2.6 series any SCSI device
+name (e.g. /dev/sdc, /dev/st1m or /dev/sg3) can be specified.
For example "sg_persist \-\-read\-keys /dev/sda"
will work in the 2.6 series kernels.
.PP
-The only scope for PROUT commands supported in the current draft of
+The only scope for PROUT commands supported in the current draft of
SPC\-4 is "LU_SCOPE". Hence there seems to be no point in offering an
option to set scope to another value.
.PP
-Most errors with the PROUT sub\-commands (e.g. missing or
+Most errors with the PROUT sub\-commands (e.g. missing or
mismatched \fI\-\-prout\-type=TYPE\fR) will result in a RESERVATION
CONFLICT status. This can be a bit confusing when you know there is
only one (active) initiator: the "conflict" is with the SPC standard, not
diff --git a/doc/sg_raw.8 b/doc/sg_raw.8
index 882b946d..701c73dc 100644
--- a/doc/sg_raw.8
+++ b/doc/sg_raw.8
@@ -56,7 +56,7 @@ exclusive.
Wait up to \fISEC\fR seconds for command completion (default: 20).
Note that if a command times out the operating system may start by
aborting the command and if that is unsuccessful it may attempt
-to reset the device.
+to reset the device.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Increase level of verbosity. Can be used multiple times.
@@ -86,7 +86,7 @@ work then 'cmp i512.bin o512.bin' should show a match.
.SH EXIT STATUS
The exit status of sg_raw is 0 when it is successful. Otherwise see
the sg3_utils(8) man page.
-.SH AUTHOR
+.SH AUTHOR
Written by Ingo van Lil
.SH "REPORTING BUGS"
Report bugs to <inguin at gmx dot de>.
diff --git a/doc/sg_read.8 b/doc/sg_read.8
index 3bba47a5..6c1949ef 100644
--- a/doc/sg_read.8
+++ b/doc/sg_read.8
@@ -101,14 +101,14 @@ O_DIRECT flag. The default value is 0 (i.e. don't open block devices
O_DIRECT).
.TP
\fBskip\fR=\fISKIP\fR
-all read operations will start offset by \fISKIP\fR bs\-sized blocks
+all read operations will start offset by \fISKIP\fR bs\-sized blocks
from the start of the input file (or device).
.TP
\fBtime\fR=\fITI\fR
When \fITI\fR is 0 (default) doesn't perform timing.
When 1, times transfer and does throughput calculation, starting at the
-first issued command until completion. When 2, times transfer and does
-throughput calculation, starting at the second issued command until
+first issued command until completion. When 2, times transfer and does
+throughput calculation, starting at the second issued command until
completion. When 3 times from third command, etc. An average number of
commands (SCSI READs or Unix read()s) executed per second is also
output.
@@ -140,7 +140,7 @@ SCSI adapter DMAs into kernel buffers and then the sg driver copies
this data into user memory.
This is called "indirect IO" and there is a "dio" option to select
"direct IO" which will DMA directly into user memory. Due to some
-issues "direct IO" is disabled in the sg driver and needs a
+issues "direct IO" is disabled in the sg driver and needs a
configuration change to activate it. This is typically done with
"echo 1 > /proc/scsi/sg/allow_dio". An alternate way to avoid the
2 stage copy is to select memory mapped IO with 'mmap=1'.
@@ -157,12 +157,12 @@ cache performance.
.PP
sg_read if=/dev/sg0 bs=512 count=1MB mmap=1 time=2
.PP
-This command will continually read 128 512 byte blocks from block 0.
-The "128" is the default value for 'bpt' while "block 0" is chosen
-because the 'skip' argument was not given. This will continue until
-1,000,000 blocks are read. The idea behind using 'time=2' is that the
+This command will continually read 128 512 byte blocks from block 0.
+The "128" is the default value for 'bpt' while "block 0" is chosen
+because the 'skip' argument was not given. This will continue until
+1,000,000 blocks are read. The idea behind using 'time=2' is that the
first 64 KiB read operation will involve reading the magnetic media
-while the remaining read operations will "hit" the disk's cache. The
+while the remaining read operations will "hit" the disk's cache. The
output of third command will look like this:
.PP
time from second command to end was 4.50 secs, 113.70 MB/sec
diff --git a/doc/sg_readcap.8 b/doc/sg_readcap.8
index 9400a519..e5eabcae 100644
--- a/doc/sg_readcap.8
+++ b/doc/sg_readcap.8
@@ -2,12 +2,12 @@
.SH NAME
sg_readcap \- sends a SCSI READ CAPACITY command
.SH SYNOPSIS
-.B sg_readcap
+.B sg_readcap
[\fI\-\-brief\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-lba=LBA\fR]
[\fI\-\-long\fR] [\fI\-\-pmi\fR] [\fI\-\-raw\fR] [\fI\-\-verbose\fR]
[\fI\-\-version\fR] \fIDEVICE\fR
.PP
-.B sg_readcap
+.B sg_readcap
[\fI\-16\fR] [\fI\-b\fR] [\fI\-h\fR] [\fI\-H\fR] [\fI\-lba=LBA\fR]
[\fI\-pmi\fR] [\fI\-r\fR] [\fI\-v\fR] [\fI\-V\fR] \fIDEVICE\fR
.SH DESCRIPTION
diff --git a/doc/sg_reassign.8 b/doc/sg_reassign.8
index 649227e3..9d1e489d 100644
--- a/doc/sg_reassign.8
+++ b/doc/sg_reassign.8
@@ -16,7 +16,7 @@ are defined in SBC\-2 for direct access devices (e.g. a disk). Reassign
blocks is designed to change the physical location of a logical block
that is known or suspected to be defective to another area on the
media. Disks are typically formatted with blocks held in reserve
-for this situation.
+for this situation.
.PP
If neither the \fI\-\-grown\fR nor \fI\-\-primary\fR option is supplied
then one or more addresses need to be given. If the address (or all of
@@ -55,7 +55,7 @@ that the addresses in the associated parameter block are 8 byte quantities.
When value is 0 then it clears the 'LONGLBA' flag in the command indicating
that the addresses in the associated parameter block are 4 byte quantities.
If this option is not given then 4 byte quantities are assumed unless one
-of the address is too large.
+of the address is too large.
.TP
\fB\-g\fR, \fB\-\-grown\fR
use the SCSI READ DEFECT DATA (10) command to determine the number of
diff --git a/doc/sg_reset.8 b/doc/sg_reset.8
index 8c10e7e0..80bab7aa 100644
--- a/doc/sg_reset.8
+++ b/doc/sg_reset.8
@@ -3,7 +3,7 @@
sg_reset \- sends SCSI device, bus or host reset; or checks reset state
.SH SYNOPSIS
.B sg_reset
-[\fI\-b\fR] [\fI\-d\fR] [\fI\-h\fR] [\fI\-V\fR]
+[\fI\-b\fR] [\fI\-d\fR] [\fI\-h\fR] [\fI\-V\fR]
\fIDEVICE\fR
.SH DESCRIPTION
.\" Add any additional description here
diff --git a/doc/sg_rmsn.8 b/doc/sg_rmsn.8
index aa54d19e..d318ba7d 100644
--- a/doc/sg_rmsn.8
+++ b/doc/sg_rmsn.8
@@ -9,7 +9,7 @@ sg_rmsn \- sends a SCSI READ MEDIA SERIAL NUMBER command
.\" Add any additional description here
.PP
Send a SCSI READ MEDIA SERIAL NUMBER command to \fIDEVICE\fR and outputs
-the response.
+the response.
.PP
This command is described in SPC\-3 found at www.t10.org . It was originally
added to SPC\-3 in revision 11 (2003/2/12). It is not an mandatory command
diff --git a/doc/sg_rtpg.8 b/doc/sg_rtpg.8
index 8af0157d..786dd12e 100644
--- a/doc/sg_rtpg.8
+++ b/doc/sg_rtpg.8
@@ -9,7 +9,7 @@ sg_rtpg \- sends a SCSI REPORT TARGET PORT GROUPS command
.\" Add any additional description here
.PP
Send a SCSI REPORT TARGET PORT GROUPS command to \fIDEVICE\fR and
-outputs the response.
+outputs the response.
.PP
Target port group access is described in SPC\-3 found at www.t10.org
in section 5.8 (in rev 21c dated 2005/1/15). The Report Target Port
diff --git a/doc/sg_safte.8 b/doc/sg_safte.8
index 9f0d2661..9af1fd05 100644
--- a/doc/sg_safte.8
+++ b/doc/sg_safte.8
@@ -28,7 +28,7 @@ The options are arranged in alphabetical order based on the long
option name.
.TP
\fB\-c\fR, \fB\-\-config\fR
-will issues a
+will issues a
.I
Read Enclosure Configuration
.R
diff --git a/doc/sg_scan.8 b/doc/sg_scan.8
index 81da76c5..fb600df0 100644
--- a/doc/sg_scan.8
+++ b/doc/sg_scan.8
@@ -1,20 +1,20 @@
.TH SG_SCAN "8" "December 2006" "sg3_utils\-1.23" SG3_UTILS
.SH NAME
-sg_scan \- does a scan of sg devices (or given SCSI/ATAPI/ATA devices) and
+sg_scan \- does a scan of sg devices (or given SCSI/ATAPI/ATA devices) and
prints the results
.SH SYNOPSIS
.B sg_scan
-[\fI\-a\fR]
-[\fI\-i\fR]
-[\fI\-n\fR]
-[\fI\-w\fR]
-[\fI\-x\fR]
-[\fIDEVICE\fR]*
+[\fI\-a\fR]
+[\fI\-i\fR]
+[\fI\-n\fR]
+[\fI\-w\fR]
+[\fI\-x\fR]
+[\fIDEVICE\fR]*
.SH DESCRIPTION
.\" Add any additional description here
.PP
-If no \fIDEVICE\fR names are given, sg_scan does a scan of the sg
-devices and outputs a line of information for each sg device that is
+If no \fIDEVICE\fR names are given, sg_scan does a scan of the sg
+devices and outputs a line of information for each sg device that is
currently bound to a SCSI device. If one or more \fIDEVICE\fRs are given
only those devices are scanned.
Each device is opened with the O_NONBLOCK flag so that the scan will
diff --git a/doc/sg_senddiag.8 b/doc/sg_senddiag.8
index dd880e35..f40253c7 100644
--- a/doc/sg_senddiag.8
+++ b/doc/sg_senddiag.8
@@ -33,7 +33,7 @@ on the old command line syntax outlines the second group of options.
Arguments to long options are mandatory for short options as well.
.TP
\fB\-d\fR, \fB\-\-doff\fR
-set the Device Offline (DevOffL) bit (default is clear). Only significant
+set the Device Offline (DevOffL) bit (default is clear). Only significant
when \fI\-\-test\fR option is set for the default self\-test. When set other
operations on any logical units controlled by the this device server (target)
may be affected (delayed) while a default self\-test is underway.
@@ -93,7 +93,7 @@ inactive. Some other values:
.br
\fB6\fR : foreground extended self\-test
.br
-This option is mutually exclusive with default self\-test (i.e.
+This option is mutually exclusive with default self\-test (i.e.
can't have (\fIST\fR > 0) and \fI\-\-test\fR).
.TP
\fB\-t\fR, \fB\-\-test\fR
@@ -103,7 +103,7 @@ option. Both the \fI\-\-doff\fR and/or \fI\-\-uoff\fR options can be used
with this option.
.TP
\fB\-u\fR, \fB\-\-uoff\fR
-set the Unit Offline (UnitOffL) bit (default is clear). Only significant
+set the Unit Offline (UnitOffL) bit (default is clear). Only significant
when \fI\-\-test\fR option is set for the default self\-test. When set other
operations on this logical unit may be affected (delayed) while a default
self\-test is underway. Some devices (e.g. Fujitsu disks) do more tests
@@ -168,7 +168,7 @@ be selected by either setting the SG3_UTILS_OLD_OPTS environment variable
or using '\-\-old' (or '\-O) as the first option.
.TP
\fB\-doff\fR
-set the Device Offline (DevOffL) bit (default is clear). Only significant
+set the Device Offline (DevOffL) bit (default is clear). Only significant
when \fI\-t\fR option is set for the default self\-test. Equivalent to
\fI\-\-doff\fR in the main description.
.TP
diff --git a/doc/sg_ses.8 b/doc/sg_ses.8
index 63d6d32c..f0e2c18b 100644
--- a/doc/sg_ses.8
+++ b/doc/sg_ses.8
@@ -39,7 +39,7 @@ The Enclosure control, String Out, Threshold Out, Array control (obsolete
in SES\-2) and Subenclosure String Out diagnostic pages can be set currently.
.TP
\fB\-d\fR, \fB\-\-data\fR=\fIH,H...\fR
-permits a string of comma separated (ASCII) hex digits to be
+permits a string of comma separated (ASCII) hex digits to be
specified (limit 512). This allows the parameters to a control diagnostic
page to be specified. The string given should not include the first 4
bytes (i.e. page code and length). See next entry for using stdin.
@@ -71,7 +71,7 @@ is ignored and utility exits.
.TP
\fB\-p\fR, \fB\-\-page\fR=\fIPG\fR
where \fIPG\fR is a page code. Assumed to be in decimal unless prefixed by
-0x for hex. Valid range is 0 to 255 (0x0 to 0xff) inclusive. Default is
+0x for hex. Valid range is 0 to 255 (0x0 to 0xff) inclusive. Default is
page_code 0 (i.e. "Supported diagnostic pages").
.TP
\fB\-r\fR, \fB\-\-raw\fR
@@ -93,7 +93,7 @@ increase the level of verbosity, (i.e. debug output).
print the version string and then exit.
.SH NOTES
Currently all status pages, control pages and element types defined in
-SES\-2 revision 17 (14th May 2007) are decoded.
+SES\-2 revision 17 (14th May 2007) are decoded.
.PP
This utility can be used to fetch arbitrary (i.e. non SES) diagnostic
pages (using the SCSI READ DIAGNOSTIC command). To this end the
diff --git a/doc/sg_start.8 b/doc/sg_start.8
index 872bab5f..cf646d17 100644
--- a/doc/sg_start.8
+++ b/doc/sg_start.8
@@ -23,7 +23,7 @@ down a disk and \fI\-\-start\fR to spin up a disk. Using \fI\-\-start\fR
on a disk that is already spinning is harmless. There is also finer grain
control with "power condition": active, idle or standby. This is set
with the \fI\-\-pc=PC\fR option. In some contexts the "stop" state can
-be considered an additional power condition.
+be considered an additional power condition.
.PP
Devices that contain removable media such as cd/dvds can use the
\fI\-\-loej\fR option to load the medium when used in conjunction
diff --git a/doc/sg_test_rwbuf.8 b/doc/sg_test_rwbuf.8
index 6230ac24..081bb4b6 100644
--- a/doc/sg_test_rwbuf.8
+++ b/doc/sg_test_rwbuf.8
@@ -1,6 +1,6 @@
.TH SG_TEST_RWBUF "8" "January 2007" "sg3_utils\-1.23" SG3_UTILS
.SH NAME
-sg_test_rwbuf \- Tests the SCSI host adapter by issuing write and read
+sg_test_rwbuf \- Tests the SCSI host adapter by issuing write and read
operations on a device's buffer and calculating checksums.
.SH SYNOPSIS
.B sg_test_rwbuf
diff --git a/doc/sg_turs.8 b/doc/sg_turs.8
index 3f12b563..46f2e627 100644
--- a/doc/sg_turs.8
+++ b/doc/sg_turs.8
@@ -57,7 +57,7 @@ print version string then exit.
The progress indication is optionally part of the sense data. When a prior
command that takes a long time to complete (and typically precludes other
media access commands) is still underway, the progress indication can be used
-to determine how long before the device returns to its normal state.
+to determine how long before the device returns to its normal state.
.PP
The SCSI FORMAT command for disks used with the IMMED bit set is an example
of an operation that takes a significant amount of time and precludes other
diff --git a/doc/sg_vpd.8 b/doc/sg_vpd.8
index 11f60174..6b16131b 100644
--- a/doc/sg_vpd.8
+++ b/doc/sg_vpd.8
@@ -60,7 +60,7 @@ command is sent with a larger value in the cdb's "allocation length" field.
If this option is given and \fILEN\fR is greater than 0 then only one INQUIRY
command is sent. Since many simple devices implement the INQUIRY command
badly (and do not support VPD pages) then the safest value to use for
-\fILEN\fR is 36. See the sg_inq man page for the more information.
+\fILEN\fR is 36. See the sg_inq man page for the more information.
.TP
\fB\-p\fR, \fB\-\-page\fR=\fIPG\fR
where \fIPG\fR is the VPD page to be decoded or output. The \fIPG\fR argument
diff --git a/doc/sg_wr_mode.8 b/doc/sg_wr_mode.8
index 2d9b25e8..dfe7365d 100644
--- a/doc/sg_wr_mode.8
+++ b/doc/sg_wr_mode.8
@@ -13,7 +13,7 @@ sg_wr_mode \- write mode page
Writes a modified mode page to \fIDEVICE\fR. Uses the SCSI MODE SENSE (6
or 10 byte variant) command to fetch the existing mode data which includes
a mode page (or subpage). It then combines that with the contents,
-potentially masked, and writes the modified mode page with the SCSI MODE
+potentially masked, and writes the modified mode page with the SCSI MODE
SELECT (6 or 10 byte variant) command. This utility does not modify
the block descriptor(s); if any block descriptors are fetched by the MODE
SENSE command then the same block descriptors are written back with the
diff --git a/doc/sg_write_long.8 b/doc/sg_write_long.8
index 432cccdf..191ff894 100644
--- a/doc/sg_write_long.8
+++ b/doc/sg_write_long.8
@@ -35,7 +35,7 @@ changed so that the ECC is able to correct the data) then care should
be taken with the settings in the "read write error recovery" mode page.
Specifically if the ARRE (for reads) and/or AWRE (for writes) are set
then recovered errors will cause the lba to be reassigned (and the old
-location to be added to the grown defect list (PLIST)). This is not easily
+location to be added to the grown defect list (PLIST)). This is not easily
reversed and uses (one of the finite number of) the spare sectors set
aside for this purpose. If in doubt it is probably safest to clear the
ARRE and AWRE bits. These bits can be checked and modified with the
@@ -150,7 +150,7 @@ than the block subsystem.
Finally we should restore sector 0x1234 to a non-corrupted state. A sector
full of zeroes could be written with:
.PP
- sg_dd if=/dev/zero of=/dev/sda blk_sgio=1 seek=0x1234 bs=512 count=1
+ sg_dd if=/dev/zero of=/dev/sda blk_sgio=1 seek=0x1234 bs=512 count=1
.PP
This will result in a sector (block) with 512 bytes of 0x0 without a
MEDIUM ERROR since the ECC and associated data will be regenerated and
diff --git a/doc/sginfo.8 b/doc/sginfo.8
index 30ae6f95..552d15e3 100644
--- a/doc/sginfo.8
+++ b/doc/sginfo.8
@@ -37,10 +37,10 @@ MMC\-2/3/4/5), for tapes (see SSC\-2) and for enclosures (see SES\-2).
Some mode pages common to all SCSI peripheral device types are defined
in SPC\-4 (primary commands). A decoded mode page has its field names
in the first column and the corresponding value in the second column.
-A "hex" mode page (and subpage) has its byte position in the first
+A "hex" mode page (and subpage) has its byte position in the first
column (in hex and starting at 0x2) and the corresponding hex value
in the second column. Decoded pages can be viewed with the '\-t' option
-or with a specific option (e.g. 'c' for the caching mode page).
+or with a specific option (e.g. 'c' for the caching mode page).
Naturally decoded pages must be supplied by the \fIDEVICE\fR and
recognised by this program. If supported by the device, decoded pages
may be modified. All mode pages (and subpages) that the device supports
@@ -57,14 +57,14 @@ Perform 6 byte MODE SENSE and MODE SELECT commands; by default the
.TP
\fB\-a\fR
Display some INQUIRY data and the unit serial number followed by
-all mode pages reported by the device. It is similar to
+all mode pages reported by the device. It is similar to
the '\-t 0x3f' option. If the mode page is known then it is output
in decoded form otherwise it is output in hexadecimal.
.TP
\fB\-A\fR
Display some INQUIRY data and the unit serial number followed by
all mode pages and all mode subpages reported by the device.
-It is similar to the '\-t 0x3f,0xff' option. If a mode (sub)page
+It is similar to the '\-t 0x3f,0xff' option. If a mode (sub)page
is known then it is output in decoded form otherwise it is output in
hexadecimal.
.TP
@@ -95,7 +95,7 @@ Format of the defect lists:
\-Flba64 \- logical block addresses (64 bit)
\-Fphysical \- physical blocks
\-Findex \- defect bytes from index
- \-Fhead \- sort by head
+ \-Fhead \- sort by head
.br
Used in conjunction with "\-d" or "\-G". If a format is not given "index" is
assumed.
@@ -145,13 +145,13 @@ page number \fISPN\fR) in decoded format (if known, otherwise in hex form).
returns all pages supported by the device in ascending order except for
page 0 which, if present, is last. Page 0 is vendor specific and not
necessarily in mode page format. Alternatively hex values can be given for
-both \fIPN\fR and \fISPN\fR (both prefixed by '0x').
+both \fIPN\fR and \fISPN\fR (both prefixed by '0x').
.TP
\fB\-t\fR
Trace commands (for debugging). When used once SCSI commands are shown
(in hex) and any errors from these SCSI commands are spelt out (i.e.
-with a decoded and raw sense buffer). When used twice, the additional
-data sent with mode select and the response from mode sense are
+with a decoded and raw sense buffer). When used twice, the additional
+data sent with mode select and the response from mode sense are
shown (in hex).
.TP
\fB\-u\fR \fIPN\fR[,\fISPN\fR]
@@ -168,17 +168,17 @@ for both \fIPN\fR and \fISPN\fR (both prefixed by '0x'). For example 63 and
\fB\-v\fR
Display version string then exit. [N.B. This option increases verbosity for
most other utilities in this package as outlined in 'man 8 sg3_utils'.
-This odd usage is for backward compatibility with the scsiinfo utility.]
+This odd usage is for backward compatibility with the scsiinfo utility.]
.TP
\fB\-V\fR
Access information in the Verify Error Recovery mode page. [N.B. This
option prints the version string then exits in most other utilities in
this package as outlined in 'man 8 sg3_utils'. This odd usage is for
-backward compatibility with the scsiinfo utility.]
+backward compatibility with the scsiinfo utility.]
.TP
\fB\-z\fR
do a single fetch for mode pages (over\-estimating the expected length
-of the returned response). The default action is to do a double
+of the returned response). The default action is to do a double
fetch, the first fetch is to find the response length that could be
returned. Devices that closely adhere to SCSI standards should not
require this option, some real world devices do require it.
@@ -205,7 +205,7 @@ being given back to the '\-R' (replace command).
Replace parameters \- best used with \-X (expert use only)
.SH CHANGING MODE PAGE PARAMETERS
Firstly you should know what you are doing before changing existing
-parameters. Taking the control page as an example, first list it out
+parameters. Taking the control page as an example, first list it out
normally (e.g. "sginfo \-C /dev/sda") and
decide which parameter is to be changed (note its position relative
to the other lines output). Then execute the same sginfo command with
@@ -259,17 +259,17 @@ Now check that the change took effect:
.br
RLEC 0
.PP
-When a mode page is "replaced" the default action is to change both the
+When a mode page is "replaced" the default action is to change both the
current page and the saved page. [For some reason versions of sginfo and
scsiinfo prior to 2.0 did not change the "saved" page.] To change only
-the current mode page but not the corresponding saved page use the "\-N"
+the current mode page but not the corresponding saved page use the "\-N"
option.
.PP
.SH GENERATING SCRIPT FILES AND HEX PAGES
The "\-aX" or "\-AX" option generates output suitable for a script file.
Mode pages are output in list format (after the INQUIRY and serial
number) one page per line. To facilitate running the output as (part
-of) a script file to assert chosen mode page values, each line is
+of) a script file to assert chosen mode page values, each line is
prefixed by "sginfo \-t \fIPN\fR[,\fISPN\fR] \-XR ". When such a script
file is run, it will have the effect of re\-asserting the mode
page values to what they were when the "\-aX" generated the output.
@@ -283,7 +283,7 @@ value in the second column) use "\-u 0xa". Mode pages (subpage code == 0)
start at index position 2 while subpages start at index position 4.
If the "\-Xu ..." option is used then a list a hex values each value
prefixed by "@" is output. Mode (sub)page values can then be modified with
-with the "\-RXu ..." option.
+with the "\-RXu ..." option.
.PP
.SH RESTRICTIONS
The SCSI MODE SENSE command yields block descriptors as well as a mode
@@ -309,7 +309,7 @@ scsiinfo version 1.0 was released by Eric Youngdale on 1st November 1993.
The most recent version of scsiinfo is version 1.7 with the last patches
by Michael Weller. sginfo is derived from scsiinfo and uses the sg
interface to get around the 4 KB buffer limit in scsiinfo that cramped
-the display of defect lists especially. sginfo was written by Douglas
+the display of defect lists especially. sginfo was written by Douglas
Gilbert with patches from Kurt Garloff. This manpage corresponds with
version 2.25 of sginfo.
.PP
diff --git a/doc/sgm_dd.8 b/doc/sgm_dd.8
index 2f21df7f..d66bb9d0 100644
--- a/doc/sgm_dd.8
+++ b/doc/sgm_dd.8
@@ -15,15 +15,15 @@ transfers from sg devices.
.\" Add any additional description here
.PP
Copy data to and from any files. Specialized for "files" that are
-Linux SCSI generic (sg) devices and raw devices. Uses memory mapped
+Linux SCSI generic (sg) devices and raw devices. Uses memory mapped
transfers on sg devices. Similar syntax and semantics to
-.B dd(1)
+.B dd(1)
but does not perform any conversions.
.PP
Will only perform memory mapped transfers when \fIIFILE\fR or \fIOFILE\fR
are SCSI generic (sg) devices.
.PP
-If both \fIIFILE\fR and \fIOFILE\fR are sg devices then memory mapped
+If both \fIIFILE\fR and \fIOFILE\fR are sg devices then memory mapped
transfers are performed on \fIIFILE\fR. If no other flags are specified
then indirect IO is performed on \fIOFILE\fR. If 'oflag=dio' is given then
direct IO is attempted on \fIOFILE\fR. If 'oflag=smmap' is given then
@@ -234,8 +234,8 @@ Data usually gets to the user space in a 2 stage process: first the
SCSI adapter DMAs into kernel buffers and then the sg driver copies
this data into user memory (write operations reverse this sequence).
With memory mapped transfers a kernel buffer reserved by sg is memory
-mapped (see the
-.B mmap(2)
+mapped (see the
+.B mmap(2)
system call) into the user space. When this is done
the second (redundant) copy from kernel buffers to user space is
not needed. Hence the transfer is faster and requires less "grunt"
@@ -256,7 +256,7 @@ advanced "copy on error" logic see the
utility (and its 'coe' flag).
.SH EXAMPLES
.PP
-See the examples given in the man page for
+See the examples given in the man page for
.B sg_dd(8).
.SH SIGNALS
The signal handling has been borrowed from dd: SIGINT, SIGQUIT and
diff --git a/doc/sgp_dd.8 b/doc/sgp_dd.8
index 6976ec95..edd25725 100644
--- a/doc/sgp_dd.8
+++ b/doc/sgp_dd.8
@@ -15,8 +15,8 @@ devices that understand the SCSI command set.
.\" Add any additional description here
.PP
Copy data to and from any files. Specialised for "files" that are
-Linux SCSI generic (sg) and raw devices. Similar syntax and semantics to
-.B dd(1)
+Linux SCSI generic (sg) and raw devices. Similar syntax and semantics to
+.B dd(1)
but does not perform any conversions. Uses POSIX threads to increase
the amount of parallelism. This improves speed in some cases.
.PP
@@ -39,7 +39,7 @@ implies 64 KiB transfers.
where \fIBS\fR
.B must
be the block size of the physical device. Note that this differs from
-.B dd(1)
+.B dd(1)
which permits 'bs' to be an integral multiple of the actual device block
size. Default is 512 which is usually correct for disks but incorrect for
cdroms (which normally have 2048 byte blocks).
@@ -50,7 +50,7 @@ Default is 10 byte SCSI command blocks (unless calculations indicate
that a 4 byte block number may be exceeded, in which case it defaults
to 16 byte SCSI commands).
.TP
-\fBcoe\fR=0 | 1
+\fBcoe\fR=0 | 1
set to 1 for continue on error. Only applies to errors on sg devices.
Thus errors on other files will stop sgp_dd. Default is 0 which
implies stop on any error. See the 'coe' flag for more information.
@@ -154,7 +154,7 @@ coe
continue on error. When given with 'iflag=', an error that is detected
in a single SCSI command (typically 'bpt' blocks) is noted (by an error
message sent to stderr), then zeros are substituted into the buffer
-for the corresponding write operation and the copy continues. Note that the
+for the corresponding write operation and the copy continues. Note that the
.B sg_dd
utility is more sophisticated in such error situations when 'iflag=coe'.
When given with 'oflag=', any error reported by a SCSI WRITE command is
diff --git a/examples/scsi_inquiry.c b/examples/scsi_inquiry.c
index aae8e374..80222950 100644
--- a/examples/scsi_inquiry.c
+++ b/examples/scsi_inquiry.c
@@ -19,16 +19,16 @@
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- This program does a SCSI inquiry command on the given device and
+ This program does a SCSI inquiry command on the given device and
outputs some of the result. This program highlights the use of the
- SCSI_IOCTL_SEND_COMMAND ioctl. This should be able to be applied to
+ SCSI_IOCTL_SEND_COMMAND ioctl. This should be able to be applied to
any SCSI device file descriptor (not just one related to sg). [Whether
this is a good idea on a disk while it is mounted is debatable.
No detrimental effects when this was tested ...]
Version 0.14 20011218
*/
-
+
typedef struct my_scsi_ioctl_command {
unsigned int inlen; /* _excluding_ scsi command length */
@@ -80,7 +80,7 @@ int main(int argc, char * argv[])
printf(" scsi_inquiry -n /dev/scd0\n");
return 1;
}
-
+
if (do_nonblock)
oflags = O_NONBLOCK;
s_fd = open(file_name, oflags | O_RDWR);
@@ -116,7 +116,7 @@ int main(int argc, char * argv[])
}
else if (res < 0)
perror("scsi_inquiry: SCSI_IOCTL_SEND_COMMAND err");
- else
+ else
printf("scsi_inquiry: SCSI_IOCTL_SEND_COMMAND status=0x%x\n", res);
res = close(s_fd);
diff --git a/examples/sg_simple2.c b/examples/sg_simple2.c
index 249c44bb..a0da0e4f 100644
--- a/examples/sg_simple2.c
+++ b/examples/sg_simple2.c
@@ -77,7 +77,7 @@ int main(int argc, char * argv[])
printf("Usage: 'sg_simple2 [-x] <sg_device>'\n");
return 1;
}
-
+
/* N.B. An access mode of O_RDWR is required for some SCSI commands */
if ((sg_fd = open(file_name, O_RDONLY)) < 0) {
snprintf(ebuff, EBUFF_SZ,
@@ -87,12 +87,12 @@ int main(int argc, char * argv[])
}
/* Just to be safe, check we have a new sg device by trying an ioctl */
if ((ioctl(sg_fd, SG_GET_VERSION_NUM, &k) < 0) || (k < 30000)) {
- printf("sg_simple2: %s doesn't seem to be an new sg device\n",
+ printf("sg_simple2: %s doesn't seem to be an new sg device\n",
file_name);
close(sg_fd);
return 1;
}
-
+
/* Prepare INQUIRY command */
memset(&io_hdr, 0, sizeof(sg_io_hdr_t));
io_hdr.interface_id = 'S';
@@ -145,7 +145,7 @@ int main(int argc, char * argv[])
if (do_extra)
printf("INQUIRY duration=%u millisecs, resid=%d, msg_status=%d\n",
io_hdr.duration, io_hdr.resid, (int)io_hdr.msg_status);
-
+
/* Prepare TEST UNIT READY command */
memset(&io_hdr, 0, sizeof(sg_io_hdr_t));
io_hdr.interface_id = 'S';
@@ -178,7 +178,7 @@ int main(int argc, char * argv[])
else if (io_hdr.host_status)
printf("TEST UNIT READY host_status=0x%x\n", io_hdr.host_status);
else if (io_hdr.driver_status)
- printf("TEST UNIT READY driver_status=0x%x\n",
+ printf("TEST UNIT READY driver_status=0x%x\n",
io_hdr.driver_status);
else
printf("TEST UNIT READY unexpected error\n");
diff --git a/examples/sg_simple4.c b/examples/sg_simple4.c
index df36f3f0..8b633ab2 100644
--- a/examples/sg_simple4.c
+++ b/examples/sg_simple4.c
@@ -94,7 +94,7 @@ int main(int argc, char * argv[])
close(sg_fd);
return 1;
}
-
+
/* since I know this program will only read from inqBuff then I use
PROT_READ rather than PROT_READ | PROT_WRITE */
inqBuff = (unsigned char *)mmap(NULL, 8000, PROT_READ | PROT_WRITE,
@@ -198,7 +198,7 @@ int main(int argc, char * argv[])
printf("Test Unit Ready failed so unit may _not_ be ready!\n");
if (do_extra)
- printf("TEST UNIT READY duration=%u millisecs, resid=%d, "
+ printf("TEST UNIT READY duration=%u millisecs, resid=%d, "
"msg_status=%d\n",
io_hdr.duration, io_hdr.resid, (int)io_hdr.msg_status);
diff --git a/include/sg_io_linux.h b/include/sg_io_linux.h
index 08d0b405..9bdd34b3 100644
--- a/include/sg_io_linux.h
+++ b/include/sg_io_linux.h
@@ -159,7 +159,7 @@ extern int sg_chk_n_print3(const char * leadin, struct sg_io_hdr * hp,
/* Calls sg_scsi_normalize_sense() after obtaining the sense buffer and
its length from the struct sg_io_hdr pointer. If these cannot be
obtained, 0 is returned. */
-extern int sg_normalize_sense(const struct sg_io_hdr * hp,
+extern int sg_normalize_sense(const struct sg_io_hdr * hp,
struct sg_scsi_sense_hdr * sshp);
extern int sg_err_category(int masked_status, int host_status,
@@ -175,7 +175,7 @@ extern int sg_err_category3(struct sg_io_hdr * hp);
/* Note about SCSI status codes found in older versions of Linux.
- Linux has traditionally used a 1 bit right shifted and masked
+ Linux has traditionally used a 1 bit right shifted and masked
version of SCSI standard status codes. Now CHECK_CONDITION
and friends (in <scsi/scsi.h>) are deprecated. */
diff --git a/include/sg_lib.h b/include/sg_lib.h
index 01569f25..9df8e8cc 100644
--- a/include/sg_lib.h
+++ b/include/sg_lib.h
@@ -124,7 +124,7 @@ extern "C" {
#define TPROTO_NONE 0xf
-/* Returns length of SCSI command given the opcode (first byte).
+/* Returns length of SCSI command given the opcode (first byte).
Yields the wrong answer for variable length commands (opcode=0x7f)
and potentially some vendor specific commands. */
extern int sg_get_command_size(unsigned char cdb_byte0);
@@ -172,7 +172,7 @@ struct sg_scsi_sense_hdr {
non-NULL then zero all fields and then set the appropriate fields in
that structure. sshp::additional_length is always 0 for response
codes 0x70 and 0x71 (fixed format). */
-extern int sg_scsi_normalize_sense(const unsigned char * sensep,
+extern int sg_scsi_normalize_sense(const unsigned char * sensep,
int sense_len,
struct sg_scsi_sense_hdr * sshp);
diff --git a/include/sg_lib_data.h b/include/sg_lib_data.h
index 75b7b479..dee1c28c 100644
--- a/include/sg_lib_data.h
+++ b/include/sg_lib_data.h
@@ -35,7 +35,7 @@
* This header file contains some structure declarations and array name
* declarations which are defined in the sg_lib_data.c .
* Typically this header does not need to be exposed to users of the
- * sg_lib interface declared in sg_libs.h .
+ * sg_lib interface declared in sg_libs.h .
*/
#include <stdint.h>
diff --git a/lib/sg_cmds_basic.c b/lib/sg_cmds_basic.c
index 2ba70f06..bae7ad25 100644
--- a/lib/sg_cmds_basic.c
+++ b/lib/sg_cmds_basic.c
@@ -540,8 +540,8 @@ sg_ll_readcap_16(int sg_fd, int pmi, uint64_t llba, void * resp,
int mx_resp_len, int noisy, int verbose)
{
int k, ret, res, sense_cat;
- unsigned char rcCmdBlk[SERVICE_ACTION_IN_16_CMDLEN] =
- {SERVICE_ACTION_IN_16_CMD, READ_CAPACITY_16_SA,
+ unsigned char rcCmdBlk[SERVICE_ACTION_IN_16_CMDLEN] =
+ {SERVICE_ACTION_IN_16_CMD, READ_CAPACITY_16_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -684,7 +684,7 @@ sg_ll_mode_sense6(int sg_fd, int dbd, int pc, int pg_code, int sub_pg_code,
void * resp, int mx_resp_len, int noisy, int verbose)
{
int res, ret, k, sense_cat;
- unsigned char modesCmdBlk[MODE_SENSE6_CMDLEN] =
+ unsigned char modesCmdBlk[MODE_SENSE6_CMDLEN] =
{MODE_SENSE6_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -758,7 +758,7 @@ sg_ll_mode_sense10(int sg_fd, int llbaa, int dbd, int pc, int pg_code,
int noisy, int verbose)
{
int res, ret, k, sense_cat;
- unsigned char modesCmdBlk[MODE_SENSE10_CMDLEN] =
+ unsigned char modesCmdBlk[MODE_SENSE10_CMDLEN] =
{MODE_SENSE10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -832,7 +832,7 @@ sg_ll_mode_select6(int sg_fd, int pf, int sp, void * paramp, int param_len,
int noisy, int verbose)
{
int res, ret, k, sense_cat;
- unsigned char modesCmdBlk[MODE_SELECT6_CMDLEN] =
+ unsigned char modesCmdBlk[MODE_SELECT6_CMDLEN] =
{MODE_SELECT6_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -903,7 +903,7 @@ sg_ll_mode_select10(int sg_fd, int pf, int sp, void * paramp, int param_len,
int noisy, int verbose)
{
int res, ret, k, sense_cat;
- unsigned char modesCmdBlk[MODE_SELECT10_CMDLEN] =
+ unsigned char modesCmdBlk[MODE_SELECT10_CMDLEN] =
{MODE_SELECT10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -1137,7 +1137,7 @@ sg_ll_request_sense(int sg_fd, int desc, void * resp, int mx_resp_len,
int noisy, int verbose)
{
int k, ret, res, sense_cat;
- unsigned char rsCmdBlk[REQUEST_SENSE_CMDLEN] =
+ unsigned char rsCmdBlk[REQUEST_SENSE_CMDLEN] =
{REQUEST_SENSE_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -1270,12 +1270,12 @@ sg_ll_report_luns(int sg_fd, int select_report, void * resp, int mx_resp_len,
* SG_LIB_CAT_NOT_READY -> device not ready, SG_LIB_CAT_ABORTED_COMMAND,
* -1 -> other failure */
int
-sg_ll_log_sense(int sg_fd, int ppc, int sp, int pc, int pg_code,
+sg_ll_log_sense(int sg_fd, int ppc, int sp, int pc, int pg_code,
int subpg_code, int paramp, unsigned char * resp,
int mx_resp_len, int noisy, int verbose)
{
int res, ret, k, sense_cat;
- unsigned char logsCmdBlk[LOG_SENSE_CMDLEN] =
+ unsigned char logsCmdBlk[LOG_SENSE_CMDLEN] =
{LOG_SENSE_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -1347,7 +1347,7 @@ sg_ll_log_select(int sg_fd, int pcr, int sp, int pc, int pg_code,
int noisy, int verbose)
{
int res, ret, k, sense_cat;
- unsigned char logsCmdBlk[LOG_SELECT_CMDLEN] =
+ unsigned char logsCmdBlk[LOG_SELECT_CMDLEN] =
{LOG_SELECT_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -1492,7 +1492,7 @@ int
sg_ll_prevent_allow(int sg_fd, int prevent, int noisy, int verbose)
{
int k, res, ret, sense_cat;
- unsigned char pCmdBlk[PREVENT_ALLOW_CMDLEN] =
+ unsigned char pCmdBlk[PREVENT_ALLOW_CMDLEN] =
{PREVENT_ALLOW_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
diff --git a/lib/sg_cmds_extra.c b/lib/sg_cmds_extra.c
index a721f4a5..a7f49233 100644
--- a/lib/sg_cmds_extra.c
+++ b/lib/sg_cmds_extra.c
@@ -241,7 +241,7 @@ sg_ll_send_diag(int sg_fd, int sf_code, int pf_bit, int sf_bit, int devofl_bit,
int param_len, int noisy, int verbose)
{
int k, res, ret, sense_cat;
- unsigned char senddiagCmdBlk[SEND_DIAGNOSTIC_CMDLEN] =
+ unsigned char senddiagCmdBlk[SEND_DIAGNOSTIC_CMDLEN] =
{SEND_DIAGNOSTIC_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -273,7 +273,7 @@ sg_ll_send_diag(int sg_fd, int sf_code, int pf_bit, int sf_bit, int devofl_bit,
set_scsi_pt_cdb(ptvp, senddiagCmdBlk, sizeof(senddiagCmdBlk));
set_scsi_pt_sense(ptvp, sense_b, sizeof(sense_b));
set_scsi_pt_data_out(ptvp, (unsigned char *)paramp, param_len);
- res = do_scsi_pt(ptvp, sg_fd,
+ res = do_scsi_pt(ptvp, sg_fd,
(long_duration ? LONG_PT_TIMEOUT : DEF_PT_TIMEOUT),
verbose);
ret = sg_cmds_process_resp(ptvp, "send diagnostic", res, 0, sense_b,
@@ -314,7 +314,7 @@ sg_ll_receive_diag(int sg_fd, int pcv, int pg_code, void * resp,
int mx_resp_len, int noisy, int verbose)
{
int k, res, ret, sense_cat;
- unsigned char rcvdiagCmdBlk[RECEIVE_DIAGNOSTICS_CMDLEN] =
+ unsigned char rcvdiagCmdBlk[RECEIVE_DIAGNOSTICS_CMDLEN] =
{RECEIVE_DIAGNOSTICS_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -381,7 +381,7 @@ sg_ll_read_defect10(int sg_fd, int req_plist, int req_glist, int dl_format,
void * resp, int mx_resp_len, int noisy, int verbose)
{
int res, k, ret, sense_cat;
- unsigned char rdefCmdBlk[READ_DEFECT10_CMDLEN] =
+ unsigned char rdefCmdBlk[READ_DEFECT10_CMDLEN] =
{READ_DEFECT10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -540,7 +540,7 @@ sg_ll_report_id_info(int sg_fd, int itype, void * resp, int max_resp_len,
riiCmdBlk[8] = (max_resp_len >> 8) & 0xff;
riiCmdBlk[9] = max_resp_len & 0xff;
riiCmdBlk[10] |= (itype << 1) & 0xfe;
-
+
if (NULL == sg_warnings_strm)
sg_warnings_strm = stderr;
if (verbose) {
@@ -679,7 +679,7 @@ sg_ll_format_unit(int sg_fd, int fmtpinfo, int rto_req, int longlist,
void * paramp, int param_len, int noisy, int verbose)
{
int k, res, ret, sense_cat, tmout;
- unsigned char fuCmdBlk[FORMAT_UNIT_CMDLEN] =
+ unsigned char fuCmdBlk[FORMAT_UNIT_CMDLEN] =
{FORMAT_UNIT_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -756,7 +756,7 @@ sg_ll_reassign_blocks(int sg_fd, int longlba, int longlist, void * paramp,
int param_len, int noisy, int verbose)
{
int res, k, ret, sense_cat;
- unsigned char reassCmdBlk[REASSIGN_BLKS_CMDLEN] =
+ unsigned char reassCmdBlk[REASSIGN_BLKS_CMDLEN] =
{REASSIGN_BLKS_CMD, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -1189,7 +1189,7 @@ sg_ll_write_long10(int sg_fd, int cor_dis, int wr_uncor, int pblock,
writeLongCmdBlk[1] |= 0x40;
if (pblock)
writeLongCmdBlk[1] |= 0x20;
-
+
writeLongCmdBlk[2] = (lba >> 24) & 0xff;
writeLongCmdBlk[3] = (lba >> 16) & 0xff;
writeLongCmdBlk[4] = (lba >> 8) & 0xff;
@@ -1380,7 +1380,7 @@ sg_ll_verify10(int sg_fd, int vrprotect, int dpo, int bytechk,
int verbose)
{
int k, res, ret, sense_cat;
- unsigned char vCmdBlk[VERIFY10_CMDLEN] =
+ unsigned char vCmdBlk[VERIFY10_CMDLEN] =
{VERIFY10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -1479,7 +1479,7 @@ sg_ll_ata_pt(int sg_fd, const unsigned char * cdbp, int cdb_len,
int * residp, int verbose)
{
int k, res, slen, duration;
- unsigned char aptCmdBlk[ATA_PT_16_CMDLEN] =
+ unsigned char aptCmdBlk[ATA_PT_16_CMDLEN] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
unsigned char * sp;
@@ -1624,7 +1624,7 @@ sg_ll_read_buffer(int sg_fd, int mode, int buffer_id, int buffer_offset,
void * resp, int mx_resp_len, int noisy, int verbose)
{
int res, k, ret, sense_cat;
- unsigned char rbufCmdBlk[READ_BUFFER_CMDLEN] =
+ unsigned char rbufCmdBlk[READ_BUFFER_CMDLEN] =
{READ_BUFFER_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
@@ -1698,7 +1698,7 @@ sg_ll_write_buffer(int sg_fd, int mode, int buffer_id, int buffer_offset,
void * paramp, int param_len, int noisy, int verbose)
{
int k, res, ret, sense_cat;
- unsigned char wbufCmdBlk[WRITE_BUFFER_CMDLEN] =
+ unsigned char wbufCmdBlk[WRITE_BUFFER_CMDLEN] =
{WRITE_BUFFER_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
diff --git a/lib/sg_cmds_mmc.c b/lib/sg_cmds_mmc.c
index 43959cb1..c9766033 100644
--- a/lib/sg_cmds_mmc.c
+++ b/lib/sg_cmds_mmc.c
@@ -129,7 +129,7 @@ sg_ll_get_config(int sg_fd, int rt, int starting, void * resp,
int mx_resp_len, int noisy, int verbose)
{
int res, k, ret, sense_cat;
- unsigned char gcCmdBlk[GET_CONFIG_CMD_LEN] = {GET_CONFIG_CMD, 0, 0, 0,
+ unsigned char gcCmdBlk[GET_CONFIG_CMD_LEN] = {GET_CONFIG_CMD, 0, 0, 0,
0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
diff --git a/lib/sg_io_linux.c b/lib/sg_io_linux.c
index cb8ad6e7..8957cee8 100644
--- a/lib/sg_io_linux.c
+++ b/lib/sg_io_linux.c
@@ -46,7 +46,7 @@
/* Version 1.02 20060714 */
-void sg_print_masked_status(int masked_status)
+void sg_print_masked_status(int masked_status)
{
int scsi_status = (masked_status << 1) & 0x7e;
@@ -225,7 +225,7 @@ int sg_err_category(int masked_status, int host_status,
sense_buffer, sb_len);
}
-int sg_err_category_new(int scsi_status, int host_status, int driver_status,
+int sg_err_category_new(int scsi_status, int host_status, int driver_status,
const unsigned char * sense_buffer, int sb_len)
{
int masked_driver_status = (SG_LIB_DRIVER_MASK & driver_status);
diff --git a/lib/sg_lib.c b/lib/sg_lib.c
index 6c2d0545..9a408eb5 100644
--- a/lib/sg_lib.c
+++ b/lib/sg_lib.c
@@ -53,12 +53,12 @@
* safe_strerror(), rename sg_decode_sense() to sg_normalize_sense()
* decode descriptor sense data format in full
* v0.98 (20040924) [SPC-3 rev 21]
- * renamed from sg_err.c to sg_lib.c
+ * renamed from sg_err.c to sg_lib.c
* factor out sg_get_num() and sg_get_llnum() into this file
* add 'no_ascii<0' variant to dStrHex for ASCII-hex output only
* v1.00 (20041012)
- * renamed from sg_err.c to sg_lib.c
- * change GPL to FreeBSD license
+ * renamed from sg_err.c to sg_lib.c
+ * change GPL to FreeBSD license
*/
#include <stdio.h>
@@ -113,7 +113,7 @@ sg_set_warnings_strm(FILE * warnings_strm)
#define CMD_NAME_LEN 128
void
-sg_print_command(const unsigned char * command)
+sg_print_command(const unsigned char * command)
{
int k, sz;
char buff[CMD_NAME_LEN];
@@ -124,7 +124,7 @@ sg_print_command(const unsigned char * command)
if (NULL == sg_warnings_strm)
sg_warnings_strm = stderr;
fprintf(sg_warnings_strm, "%s [", buff);
- if (SG_VARIABLE_LENGTH_CMD == command[0])
+ if (SG_VARIABLE_LENGTH_CMD == command[0])
sz = command[7] + 8;
else
sz = sg_get_command_size(command[0]);
@@ -157,7 +157,7 @@ sg_get_scsi_status_str(int scsi_status, int buff_len, char * buff)
}
void
-sg_print_scsi_status(int scsi_status)
+sg_print_scsi_status(int scsi_status)
{
char buff[128];
@@ -474,7 +474,7 @@ sg_get_sense_descriptors_str(const unsigned char * sense_buffer, int sb_len,
break;
}
progress = (descp[5] << 8) + descp[6];
- n += sprintf(b + n, "%d %%\n",
+ n += sprintf(b + n, "%d %%\n",
(progress * 100) / 0x10000);
break;
case SPC_SK_COPY_ABORTED:
@@ -484,7 +484,7 @@ sg_get_sense_descriptors_str(const unsigned char * sense_buffer, int sb_len,
break;
}
n += sprintf(b + n, " Relative to start of %s, byte %d",
- (descp[4] & 0x20) ? "segment descriptor" :
+ (descp[4] & 0x20) ? "segment descriptor" :
"parameter list",
(descp[5] << 8) | descp[6]);
if (descp[4] & 0x08)
@@ -630,7 +630,7 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
if (sg_scsi_normalize_sense(sense_buffer, sb_len, &ssh)) {
switch (ssh.response_code) {
case 0x70: /* fixed, current */
- error = "Fixed format, current";
+ error = "Fixed format, current";
len = (sb_len > 7) ? (sense_buffer[7] + 8) : sb_len;
len = (len > sb_len) ? sb_len : len;
break;
@@ -652,7 +652,7 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
error = "Response code: 0x0 (?)";
break;
default:
- snprintf(error_buff, sizeof(error_buff),
+ snprintf(error_buff, sizeof(error_buff),
"Unknown response code: 0x%x", ssh.response_code);
error = error_buff;
break;
@@ -765,7 +765,7 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
if (n >= buff_len)
return;
}
- } else {
+ } else {
n += snprintf(buff + n, buff_len - n, " fixed descriptor "
"length too short, len=%d\n", len);
if (n >= buff_len)
@@ -839,7 +839,7 @@ sg_scsi_normalize_sense(const unsigned char * sensep, int sb_len,
if (sb_len > 2)
sshp->sense_key = (0xf & sensep[2]);
if (sb_len > 7) {
- sb_len = (sb_len < (sensep[7] + 8)) ? sb_len :
+ sb_len = (sb_len < (sensep[7] + 8)) ? sb_len :
(sensep[7] + 8);
if (sb_len > 12)
sshp->asc = sensep[12];
@@ -865,9 +865,9 @@ sg_err_category_sense(const unsigned char * sense_buffer, int sb_len)
return SG_LIB_CAT_RECOVERED;
case SPC_SK_NOT_READY:
return SG_LIB_CAT_NOT_READY;
- case SPC_SK_MEDIUM_ERROR:
- case SPC_SK_HARDWARE_ERROR:
- case SPC_SK_BLANK_CHECK:
+ case SPC_SK_MEDIUM_ERROR:
+ case SPC_SK_HARDWARE_ERROR:
+ case SPC_SK_BLANK_CHECK:
return SG_LIB_CAT_MEDIUM_HARD;
case SPC_SK_UNIT_ATTENTION:
return SG_LIB_CAT_UNIT_ATTENTION;
@@ -1073,7 +1073,7 @@ safe_strerror(int errnum)
{
size_t len;
char * errstr;
-
+
if (errnum < 0)
errnum = -errnum;
errstr = strerror(errnum);
@@ -1088,7 +1088,7 @@ safe_strerror(int errnum)
/* Note the ASCII-hex output goes to stdout. [Most other output from functions
- in this file go to sg_warnings_strm (default stderr).]
+ in this file go to sg_warnings_strm (default stderr).]
'no_ascii' allows for 3 output types:
> 0 each line has address then up to 16 ASCII-hex bytes
= 0 in addition, the bytes are listed in ASCII to the right
@@ -1224,7 +1224,7 @@ swapb_ushort(unsigned short u)
}
/* Note the ASCII-hex output goes to stdout. [Most other output from functions
- in this file go to sg_warnings_strm (default stderr).]
+ in this file go to sg_warnings_strm (default stderr).]
'no_ascii' allows for 3 output types:
> 0 each line has address then up to 8 ASCII-hex 16 bit words
= 0 in addition, the ASCI bytes pairs are listed to the right
diff --git a/lib/sg_lib_data.c b/lib/sg_lib_data.c
index b02f3e63..0c46d637 100644
--- a/lib/sg_lib_data.c
+++ b/lib/sg_lib_data.c
@@ -379,9 +379,9 @@ struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
{0x03,0x02,"Excessive write errors"},
{0x04,0x00,"Logical unit not ready, cause not reportable"},
{0x04,0x01,"Logical unit is in process of becoming ready"},
- {0x04,0x02,"Logical unit not ready, "
+ {0x04,0x02,"Logical unit not ready, "
"initializing command required"},
- {0x04,0x03,"Logical unit not ready, "
+ {0x04,0x03,"Logical unit not ready, "
"manual intervention required"},
{0x04,0x04,"Logical unit not ready, format in progress"},
{0x04,0x05,"Logical unit not ready, rebuild in progress"},
@@ -389,11 +389,11 @@ struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
{0x04,0x07,"Logical unit not ready, operation in progress"},
{0x04,0x08,"Logical unit not ready, long write in progress"},
{0x04,0x09,"Logical unit not ready, self-test in progress"},
- {0x04,0x0a,"Logical unit "
+ {0x04,0x0a,"Logical unit "
"not accessible, asymmetric access state transition"},
- {0x04,0x0b,"Logical unit "
+ {0x04,0x0b,"Logical unit "
"not accessible, target port in standby state"},
- {0x04,0x0c,"Logical unit "
+ {0x04,0x0c,"Logical unit "
"not accessible, target port in unavailable state"},
{0x04,0x0d,"Logical unit not ready, structure check required"},
{0x04,0x10,"Logical unit not ready, "
@@ -1038,7 +1038,7 @@ const char * sg_lib_pdt_strs[] = {
"automation/driver interface",
"security manager device",
"0x14", "0x15", "0x16", "0x17", "0x18",
- "0x19", "0x1a", "0x1b", "0x1c", "0x1d",
+ "0x19", "0x1a", "0x1b", "0x1c", "0x1d",
"well known logical unit",
"no physical device on this lu",
};
diff --git a/lib/sg_pt_freebsd.c b/lib/sg_pt_freebsd.c
index 47ac8e2c..7e5c4c2a 100644
--- a/lib/sg_pt_freebsd.c
+++ b/lib/sg_pt_freebsd.c
@@ -105,7 +105,7 @@ int scsi_pt_open_device(const char * device_name,
for (k = 0; k < FREEBSD_MAXDEV; k++)
if (! devicetable[k])
break;
-
+
// If no free entry found, return error. We have max allowed number
// of "file descriptors" already allocated.
if (k == FREEBSD_MAXDEV) {
diff --git a/lib/sg_pt_linux.c b/lib/sg_pt_linux.c
index 390d1eb3..d583acf1 100644
--- a/lib/sg_pt_linux.c
+++ b/lib/sg_pt_linux.c
@@ -259,7 +259,7 @@ int get_scsi_pt_result_category(const struct sg_pt_base * vp)
return SCSI_PT_RESULT_OS_ERR;
else if (ptp->io_hdr.host_status)
return SCSI_PT_RESULT_TRANSPORT_ERR;
- else if (dr_st && (SG_LIB_DRIVER_SENSE != dr_st))
+ else if (dr_st && (SG_LIB_DRIVER_SENSE != dr_st))
return SCSI_PT_RESULT_TRANSPORT_ERR;
else if ((SG_LIB_DRIVER_SENSE == dr_st) ||
(SAM_STAT_CHECK_CONDITION == scsi_st) ||
@@ -378,7 +378,7 @@ char * get_scsi_pt_transport_err_str(const struct sg_pt_base * vp,
n = snprintf(cp, m, "Driver_status=0x%02x [%s, %s]\n", ds, driv_cp,
sugg_cp);
m -= n;
- if (m < 1)
+ if (m < 1)
b[max_b_len - 1] = '\0';
return b;
}
diff --git a/lib/sg_pt_win32.c b/lib/sg_pt_win32.c
index 623557e6..314be05f 100644
--- a/lib/sg_pt_win32.c
+++ b/lib/sg_pt_win32.c
@@ -184,7 +184,7 @@ int scsi_pt_open_device(const char * device_name,
}
return index + WIN32_FDOFFSET;
}
-
+
/* Returns 0 if successful. If error in Unix returns negated errno. */
int scsi_pt_close_device(int device_fd)
@@ -236,7 +236,7 @@ void set_scsi_pt_cdb(struct sg_pt_base * vp, const unsigned char * cdb,
{
struct sg_pt_win32_scsi * psp = &vp->impl;
- if (psp->swb.spt.CdbLength > 0)
+ if (psp->swb.spt.CdbLength > 0)
++psp->in_err;
if (cdb_len > (int)sizeof(psp->swb.spt.Cdb)) {
++psp->in_err;
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 1e42d3d5..71590977 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -79,7 +79,7 @@ fi
%{_libdir}/*.la
%changelog
-* Mon Jun 02 2008 - dgilbert at interlog dot com
+* Wed Jun 04 2008 - dgilbert at interlog dot com
- add sg_sat_phy_event, sync with drafts prior to this date
* sg3_utils-1.26
diff --git a/src/sg_dd.c b/src/sg_dd.c
index df10b4c7..859ff7b8 100644
--- a/src/sg_dd.c
+++ b/src/sg_dd.c
@@ -18,7 +18,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
-#include <sys/time.h>
+#include <sys/time.h>
#include <linux/major.h>
#include <linux/fs.h> /* <sys/mount.h> */
@@ -41,8 +41,8 @@
This program is a specialisation of the Unix "dd" command in which
either the input or the output file is a scsi generic device, raw
- device, a block device or a normal file. The block size ('bs') is
- assumed to be 512 if not given. This program complains if 'ibs' or
+ device, a block device or a normal file. The block size ('bs') is
+ assumed to be 512 if not given. This program complains if 'ibs' or
'obs' are given with a value that differs from 'bs' (or the default 512).
If 'if' is not given or 'if=-' then stdin is assumed. If 'of' is
not given or 'of=-' then stdout assumed.
@@ -90,7 +90,7 @@ static char * version_str = "5.67 20080530";
#ifndef RAW_MAJOR
#define RAW_MAJOR 255 /*unlikey value */
-#endif
+#endif
#define FT_OTHER 1 /* filetype is probably normal */
#define FT_SG 2 /* filetype is sg char device or supports
@@ -184,9 +184,9 @@ print_stats(const char * str)
{
if (0 != dd_count)
fprintf(stderr, " remaining block count=%"PRId64"\n", dd_count);
- fprintf(stderr, "%s%"PRId64"+%d records in\n", str, in_full - in_partial,
+ fprintf(stderr, "%s%"PRId64"+%d records in\n", str, in_full - in_partial,
in_partial);
- fprintf(stderr, "%s%"PRId64"+%d records out\n", str, out_full - out_partial,
+ fprintf(stderr, "%s%"PRId64"+%d records out\n", str, out_full - out_partial,
out_partial);
if (oflag.sparse)
fprintf(stderr, "%s%"PRId64" bypassed records out\n", str, out_sparse);
@@ -243,7 +243,7 @@ dd_filetype(const char * filename)
if (stat(filename, &st) < 0)
return FT_ERROR;
if (S_ISCHR(st.st_mode)) {
- if ((MEM_MAJOR == major(st.st_rdev)) &&
+ if ((MEM_MAJOR == major(st.st_rdev)) &&
(DEV_NULL_MINOR_NUM == minor(st.st_rdev)))
return FT_DEV_NULL;
if (RAW_MAJOR == major(st.st_rdev))
@@ -658,7 +658,7 @@ sg_read_low(int sg_fd, unsigned char * buff, int blocks, int64_t from_block,
sg_chk_n_print3("reading", &io_hdr, verbose > 1);
return res;
}
- if (diop && *diop &&
+ if (diop && *diop &&
((io_hdr.info & SG_INFO_DIRECT_IO_MASK) != SG_INFO_DIRECT_IO))
*diop = 0; /* flag that dio not done (completely) */
sum_of_resids += io_hdr.resid;
@@ -847,7 +847,7 @@ sg_read(int sg_fd, unsigned char * buff, int blocks, int64_t from_block,
}
/* remember for next read_long attempt, if required */
read_long_blk_inc = nl - bs;
-
+
if (verbose)
fprintf(stderr, "read_long(10): adjusted len=%d\n", nl);
r = sg_ll_read_long10(sg_fd, 0, corrct, lba, buffp, nl,
@@ -1014,7 +1014,7 @@ sg_write(int sg_fd, unsigned char * buff, int blocks, int64_t to_block,
} else
return res;
}
- if (diop && *diop &&
+ if (diop && *diop &&
((io_hdr.info & SG_INFO_DIRECT_IO_MASK) != SG_INFO_DIRECT_IO))
*diop = 0; /* flag that dio not done (completely) */
return 0;
@@ -1142,7 +1142,7 @@ main(int argc, char * argv[])
iflag.cdbsz = DEF_SCSI_CDBSZ;
oflag.cdbsz = DEF_SCSI_CDBSZ;
if (argc < 2) {
- fprintf(stderr,
+ fprintf(stderr,
"Won't default both IFILE to stdin _and_ OFILE to stdout\n");
fprintf(stderr, "For more information use '--help'\n");
return SG_LIB_SYNTAX_ERROR;
@@ -1209,7 +1209,7 @@ main(int argc, char * argv[])
if ('\0' != inf[0]) {
fprintf(stderr, "Second IFILE argument??\n");
return SG_LIB_SYNTAX_ERROR;
- } else
+ } else
strncpy(inf, buf, INOUTF_SZ);
} else if (0 == strcmp(key, "iflag")) {
if (process_flags(buf, &iflag)) {
@@ -1225,7 +1225,7 @@ main(int argc, char * argv[])
if ('\0' != outf[0]) {
fprintf(stderr, "Second OFILE argument??\n");
return SG_LIB_SYNTAX_ERROR;
- } else
+ } else
strncpy(outf, buf, INOUTF_SZ);
} else if (0 == strcmp(key, "oflag")) {
if (process_flags(buf, &oflag)) {
@@ -1512,14 +1512,14 @@ main(int argc, char * argv[])
}
}
if ((STDIN_FILENO == infd) && (STDOUT_FILENO == outfd)) {
- fprintf(stderr,
+ fprintf(stderr,
"Can't have both 'if' as stdin _and_ 'of' as stdout\n");
fprintf(stderr, "For more information use '--help'\n");
return SG_LIB_SYNTAX_ERROR;
}
if (oflag.sparse) {
if (STDOUT_FILENO == outfd) {
- fprintf(stderr, "oflag=sparse needs seekable output file\n");
+ fprintf(stderr, "oflag=sparse needs seekable output file\n");
return SG_LIB_SYNTAX_ERROR;
}
}
@@ -1567,11 +1567,11 @@ main(int argc, char * argv[])
if (FT_SG & out_type) {
res = scsi_read_capacity(outfd, &out_num_sect, &out_sect_sz);
if (SG_LIB_CAT_UNIT_ATTENTION == res) {
- fprintf(stderr,
+ fprintf(stderr,
"Unit attention (readcap out), continuing\n");
res = scsi_read_capacity(outfd, &out_num_sect, &out_sect_sz);
} else if (SG_LIB_CAT_ABORTED_COMMAND == res) {
- fprintf(stderr,
+ fprintf(stderr,
"Aborted command (readcap out), continuing\n");
res = scsi_read_capacity(outfd, &out_num_sect, &out_sect_sz);
}
@@ -1588,7 +1588,7 @@ main(int argc, char * argv[])
"bs=%d, device claims=%d\n", outf, blk_sz,
out_sect_sz);
} else if (FT_BLOCK & out_type) {
- if (0 != read_blkdev_capacity(outfd, &out_num_sect,
+ if (0 != read_blkdev_capacity(outfd, &out_num_sect,
&out_sect_sz)) {
fprintf(stderr, "Unable to read block capacity on %s\n",
outf);
@@ -1603,8 +1603,8 @@ main(int argc, char * argv[])
if (out_num_sect > seek)
out_num_sect -= seek;
#ifdef SG_DEBUG
- fprintf(stderr,
- "Start of loop, count=%"PRId64", in_num_sect=%"PRId64", out_num_sect=%"PRId64"\n",
+ fprintf(stderr,
+ "Start of loop, count=%"PRId64", in_num_sect=%"PRId64", out_num_sect=%"PRId64"\n",
dd_count, in_num_sect, out_num_sect);
#endif
if (dd_count < 0) {
@@ -1836,7 +1836,7 @@ main(int argc, char * argv[])
first = 0;
}
if (0 != ret) {
- fprintf(stderr, "sg_write failed,%s seek=%"PRId64"\n",
+ fprintf(stderr, "sg_write failed,%s seek=%"PRId64"\n",
((-2 == ret) ? " try reducing bpt," : ""), seek);
break;
} else {
@@ -1927,7 +1927,7 @@ main(int argc, char * argv[])
int fd;
char c;
- fprintf(stderr, ">> Direct IO requested but incomplete %d times\n",
+ fprintf(stderr, ">> Direct IO requested but incomplete %d times\n",
dio_incomplete);
if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) {
if (1 == read(fd, &c, 1)) {
@@ -1939,7 +1939,7 @@ main(int argc, char * argv[])
}
}
if (sum_of_resids)
- fprintf(stderr, ">> Non-zero sum of residual counts=%d\n",
+ fprintf(stderr, ">> Non-zero sum of residual counts=%d\n",
sum_of_resids);
return (ret >= 0) ? ret : SG_LIB_CAT_OTHER;
}
diff --git a/src/sg_emc_trespass.c b/src/sg_emc_trespass.c
index 6f270000..90f3dead 100644
--- a/src/sg_emc_trespass.c
+++ b/src/sg_emc_trespass.c
@@ -20,7 +20,7 @@
*
* Based on sg_start.c; credits from there also apply.
* Minor modifications for sg_lib, D. Gilbert 2004/10/19
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -36,7 +36,7 @@ static int debug = 0;
static int do_trespass(int fd, int hr, int short_cmd)
{
unsigned char long_trespass_pg[] =
- { 0, 0, 0, 0, 0, 0, 0, 0x00,
+ { 0, 0, 0, 0, 0, 0, 0, 0x00,
TRESPASS_PAGE, /* Page code */
0x09, /* Page length - 2 */
0x81, /* Trespass code + Honor reservation bit */
@@ -44,7 +44,7 @@ static int do_trespass(int fd, int hr, int short_cmd)
0, 0, 0, 0, 0, 0 /* Reserved bytes / unknown */
};
unsigned char short_trespass_pg[] =
- { 0, 0, 0, 0,
+ { 0, 0, 0, 0,
TRESPASS_PAGE, /* Page code */
0x02, /* Page length - 2 */
0x81, /* Trespass code + Honor reservation bit */
@@ -116,8 +116,8 @@ int main(int argc, char * argv[])
int hr = 0;
int short_cmd = 0;
int ret = 0;
-
- if (argc < 2)
+
+ if (argc < 2)
usage ();
for (k = 1; k < argc; ++k) {
@@ -149,7 +149,7 @@ int main(int argc, char * argv[])
usage();
return SG_LIB_SYNTAX_ERROR;
}
-
+
fd = open(file_name, O_RDWR | O_NONBLOCK);
if (fd < 0) {
fprintf(stderr, "Error trying to open %s\n", file_name);
@@ -157,9 +157,9 @@ int main(int argc, char * argv[])
usage();
return SG_LIB_FILE_ERROR;
}
-
+
ret = do_trespass(fd, hr, short_cmd);
-
+
close (fd);
return (ret >= 0) ? ret : SG_LIB_CAT_OTHER;
}
diff --git a/src/sg_format.c b/src/sg_format.c
index 6064ae69..322e0a31 100644
--- a/src/sg_format.c
+++ b/src/sg_format.c
@@ -27,7 +27,7 @@
** ST336704FC 71132960
** ST318304FC 35145034 (Factory spec is 35885167 sectors)
** ST336605FC ???
-** ST336753FC 71132960 (Factory spec is 71687372 sectors)
+** ST336753FC 71132960 (Factory spec is 71687372 sectors)
*/
#include <stdio.h>
@@ -60,14 +60,14 @@
#if defined(MSC_VER) || defined(__MINGW32__)
#define HAVE_MS_SLEEP
#endif
-
+
#ifdef HAVE_MS_SLEEP
#include <windows.h>
#define sleep_for(seconds) Sleep( (seconds) * 1000)
#else
#define sleep_for(seconds) sleep(seconds)
#endif
-
+
#define MAX_BUFF_SZ 252
static unsigned char dbuff[MAX_BUFF_SZ];
@@ -225,16 +225,16 @@ print_read_cap(int fd, int do_16, int verbose)
(resp_buff[6] << 8) |
resp_buff[7]);
printf("Read Capacity (10) results:\n");
- printf(" Number of blocks=%u\n",
+ printf(" Number of blocks=%u\n",
last_blk_addr + 1);
printf(" Block size=%u bytes\n", block_size);
return (int)block_size;
}
}
- if (SG_LIB_CAT_NOT_READY == res)
+ if (SG_LIB_CAT_NOT_READY == res)
fprintf(stderr, "READ CAPACITY (%d): device not ready\n",
(do_16 ? 16 : 10));
- else if (SG_LIB_CAT_INVALID_OP == res)
+ else if (SG_LIB_CAT_INVALID_OP == res)
fprintf(stderr, "READ CAPACITY (%d) not supported\n",
(do_16 ? 16 : 10));
else if (SG_LIB_CAT_ILLEGAL_REQ == res)
@@ -516,9 +516,9 @@ int main(int argc, char **argv)
"supported\n", (mode6 ? 6 : 10));
fprintf(stderr, " try again %s the '--six' "
"option\n", (mode6 ? "without" : "with"));
-
+
} else if (SG_LIB_CAT_ILLEGAL_REQ == res) {
- if (long_lba && (! mode6))
+ if (long_lba && (! mode6))
fprintf(stderr, "bad field in MODE SENSE "
"(%d) [longlba flag not supported?]"
"\n", (mode6 ? 6 : 10));
diff --git a/src/sg_get_config.c b/src/sg_get_config.c
index d5a04cac..0a125e22 100644
--- a/src/sg_get_config.c
+++ b/src/sg_get_config.c
@@ -1080,7 +1080,7 @@ main(int argc, char * argv[])
}
}
- res = sg_ll_get_config(sg_fd, rt, starting, resp_buffer,
+ res = sg_ll_get_config(sg_fd, rt, starting, resp_buffer,
sizeof(resp_buffer), 1, verbose);
ret = res;
if (0 == res) {
diff --git a/src/sg_ident.c b/src/sg_ident.c
index 67bc3cc3..fc7ceac9 100644
--- a/src/sg_ident.c
+++ b/src/sg_ident.c
@@ -96,7 +96,7 @@ static void decode_ii(const unsigned char * iip, int ii_len, int itype,
if (ascii)
printf("%.*s\n", ii_len, (const char *)iip);
else
- dStrHex((const char *)iip, ii_len, 0);
+ dStrHex((const char *)iip, ii_len, 0);
}
}
}
@@ -228,7 +228,7 @@ int main(int argc, char * argv[])
memset(rdi_buff, 0x0, sizeof(rdi_buff));
if (do_set || do_clear) {
if (do_set) {
- res = fread(rdi_buff, 1, REPORT_ID_INFO_SANITY_LEN + 2, stdin);
+ res = fread(rdi_buff, 1, REPORT_ID_INFO_SANITY_LEN + 2, stdin);
if (res <= 0) {
fprintf(stderr, "no data read from stdin; to clear "
"identifying information use '--clear' instead\n");
@@ -272,7 +272,7 @@ int main(int argc, char * argv[])
} else { /* do report identifying information */
res = sg_ll_report_id_info(sg_fd, itype, rdi_buff, 4, 1, verbose);
if (0 == res) {
- ii_len = (rdi_buff[0] << 24) + (rdi_buff[1] << 16) +
+ ii_len = (rdi_buff[0] << 24) + (rdi_buff[1] << 16) +
(rdi_buff[2] << 8) + rdi_buff[3];
if ((! raw) && (verbose > 0))
printf("Reported identifying information length = %d\n",
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 6cf2f128..5d4f0f87 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -33,7 +33,7 @@
It is mainly based on the SCSI SPC-4 document at http://www.t10.org .
Acknowledgment:
- - Martin Schwenke <martin at meltin dot net> added the raw switch and
+ - Martin Schwenke <martin at meltin dot net> added the raw switch and
other improvements [20020814]
- Lars Marowsky-Bree <lmb at suse dot de> contributed Unit Path Report
VPD page decoding for EMC CLARiiON devices [20041016]
@@ -621,7 +621,7 @@ static void
dStrRaw(const char* str, int len)
{
int k;
-
+
for (k = 0 ; k < len; ++k)
printf("%c", str[k]);
}
@@ -644,8 +644,8 @@ static struct vpd_name vpd_name_arr[] = {
{VPD_MODE_PG_POLICY, 0, "Mode page policy"},
{VPD_SCSI_PORTS, 0, "SCSI ports"},
{VPD_ATA_INFO, 0, "ATA information"},
- {VPD_BLOCK_LIMITS, 0, "Block limits (sbc2)"},
- {VPD_BLOCK_DEV_CHARS, 0, "Block device characteristics (sbc3)"},
+ {VPD_BLOCK_LIMITS, 0, "Block limits (sbc2)"},
+ {VPD_BLOCK_DEV_CHARS, 0, "Block device characteristics (sbc3)"},
{0xb0, PDT_TAPE, "Sequential access device capabilities (ssc3)"},
{0xb2, PDT_TAPE, "TapeAlert supported flags (ssc3)"},
{0xb0, PDT_OSD, "OSD information (osd)"},
@@ -661,7 +661,7 @@ static const char *
get_vpd_page_str(int vpd_page_num, int scsi_ptype)
{
int k;
- int vpd_name_arr_sz =
+ int vpd_name_arr_sz =
(int)(sizeof(vpd_name_arr) / sizeof(vpd_name_arr[0]));
if ((vpd_page_num >= 0xb0) && (vpd_page_num < 0xc0)) {
@@ -713,7 +713,7 @@ static const char * assoc_arr[] =
"target device that contains addressed lu",
"reserved [0x3]",
};
-
+
static const char * network_service_type_arr[] =
{
"unspecified",
@@ -745,7 +745,7 @@ decode_net_man_vpd(unsigned char * buff, int len, int do_hex)
len -= 4;
ucp = buff + 4;
for (k = 0; k < len; k += bump, ucp += bump) {
- printf(" %s, Service type: %s\n",
+ printf(" %s, Service type: %s\n",
assoc_arr[(ucp[0] >> 5) & 0x3],
network_service_type_arr[ucp[0] & 0x1f]);
na_len = (ucp[2] << 8) + ucp[3];
@@ -764,7 +764,7 @@ decode_net_man_vpd(unsigned char * buff, int len, int do_hex)
}
}
}
-
+
static const char * mode_page_policy_arr[] =
{
"shared",
@@ -853,7 +853,7 @@ decode_scsi_ports_vpd(unsigned char * buff, int len, int do_hex)
bump += tpd_len + 4;
}
}
-
+
static const char * code_set_arr[] =
{
"Reserved [0x0]",
@@ -1008,7 +1008,7 @@ decode_dev_ids(const char * leadin, unsigned char * buff, int len, int do_hex)
for (m = 0; m < 8; ++m)
printf("%02x", (unsigned int)ip[m]);
printf("]\n");
- } else if (3 == naa) { /* NAA Locally assigned */
+ } else if (3 == naa) { /* NAA Locally assigned */
if (8 != i_len) {
fprintf(stderr, " << unexpected NAA 3 identifier "
"length: 0x%x>>\n", i_len);
@@ -1020,14 +1020,14 @@ decode_dev_ids(const char * leadin, unsigned char * buff, int len, int do_hex)
for (m = 0; m < 8; ++m)
printf("%02x", (unsigned int)ip[m]);
printf("]\n");
- } else if (5 == naa) { /* NAA IEEE Registered */
+ } else if (5 == naa) { /* NAA IEEE Registered */
if (8 != i_len) {
fprintf(stderr, " << unexpected NAA 5 identifier "
"length: 0x%x>>\n", i_len);
dStrHex((const char *)ip, i_len, 0);
break;
}
- c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
+ c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
(ip[2] << 4) | ((ip[3] & 0xf0) >> 4));
vsei = ip[3] & 0xf;
for (m = 1; m < 5; ++m) {
@@ -1048,7 +1048,7 @@ decode_dev_ids(const char * leadin, unsigned char * buff, int len, int do_hex)
dStrHex((const char *)ip, i_len, 0);
break;
}
- c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
+ c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
(ip[2] << 4) | ((ip[3] & 0xf0) >> 4));
vsei = ip[3] & 0xf;
for (m = 1; m < 5; ++m) {
@@ -1154,7 +1154,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
switch (proto_id) {
case TPROTO_FCP:
printf("%s FCP-2 World Wide Name:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 8, 0);
@@ -1163,7 +1163,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
case TPROTO_SPI:
printf("%s Parallel SCSI initiator SCSI address: 0x%x\n",
leadin, ((ucp[2] << 8) | ucp[3]));
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
printf("%s relative port number (of corresponding target): "
@@ -1178,7 +1178,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
break;
case TPROTO_1394:
printf("%s IEEE 1394 EUI-64 name:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 8, 0);
@@ -1186,7 +1186,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
break;
case TPROTO_SRP:
printf("%s RDMA initiator port identifier:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 16, 0);
@@ -1213,7 +1213,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
ull |= ucp[4 + j];
}
printf("%s SAS address: 0x%" PRIx64 "\n", leadin, ull);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
bump = 24;
@@ -1746,7 +1746,7 @@ process_std_inq(int sg_fd, const struct opts_t * optsp)
if (rsp_buff[6] & 0x10)
printf("MultiP=1 (VS=%d) ", !!(rsp_buff[6] & 0x20));
else
- printf("MultiP=0 ");
+ printf("MultiP=0 ");
printf("[MChngr=%d] [ACKREQQ=%d] Addr16=%d\n [RelAdr=%d] ",
!!(rsp_buff[6] & 0x08), !!(rsp_buff[6] & 0x04),
!!(rsp_buff[6] & 0x01), !!(rsp_buff[7] & 0x80));
@@ -1761,7 +1761,7 @@ process_std_inq(int sg_fd, const struct opts_t * optsp)
if (act_len >= len)
printf(" length=%d (0x%x)", len, len);
else
- printf(" length=%d (0x%x), but only fetched %d bytes",
+ printf(" length=%d (0x%x), but only fetched %d bytes",
len, len, act_len);
if ((ansi_version >= 2) && (len < SAFE_STD_INQ_RESP_LEN))
printf(" [for SCSI>=2, len>=36 is expected]");
@@ -1794,7 +1794,7 @@ process_std_inq(int sg_fd, const struct opts_t * optsp)
}
if (optsp->do_descriptors) {
for (j = 0, k = 58; ((j < 8) && ((k + 1) < act_len));
- k +=2, ++j)
+ k +=2, ++j)
vdesc_arr[j] = ((rsp_buff[k] << 8) +
rsp_buff[k + 1]);
}
@@ -1903,7 +1903,7 @@ process_cmddt(int sg_fd, const struct opts_t * optsp)
}
}
else {
- res = sg_ll_inquiry(sg_fd, 1, 0, optsp->page_num, rsp_buff,
+ res = sg_ll_inquiry(sg_fd, 1, 0, optsp->page_num, rsp_buff,
DEF_ALLOC_LEN, 1, optsp->do_verbose);
if (0 == res) {
peri_type = rsp_buff[0] & 0x1f;
@@ -1927,21 +1927,21 @@ process_cmddt(int sg_fd, const struct opts_t * optsp)
support_num = rsp_buff[1] & 7;
num = rsp_buff[5];
switch (support_num) {
- case 0:
+ case 0:
if (0 == reserved_cmddt)
- desc_p = "no data available";
+ desc_p = "no data available";
else
desc_p = "ignored cmddt bit, standard INQUIRY "
"response";
break;
case 1: desc_p = "not supported"; break;
case 2: desc_p = "reserved (2)"; break;
- case 3: desc_p = "supported as per standard";
+ case 3: desc_p = "supported as per standard";
prnt_cmd = 1;
break;
case 4: desc_p = "vendor specific (4)"; break;
case 5: desc_p = "supported in vendor specific way";
- prnt_cmd = 1;
+ prnt_cmd = 1;
break;
case 6: desc_p = "vendor specific (6)"; break;
case 7: desc_p = "reserved (7)"; break;
@@ -1959,7 +1959,7 @@ process_cmddt(int sg_fd, const struct opts_t * optsp)
else {
if (! optsp->do_raw) {
printf("CmdDt INQUIRY, opcode=0x%.2x: [", optsp->page_num);
- sg_get_opcode_name((unsigned char)optsp->page_num, 0,
+ sg_get_opcode_name((unsigned char)optsp->page_num, 0,
sizeof(op_name) - 1, op_name);
op_name[sizeof(op_name) - 1] = '\0';
printf("%s]\n", op_name);
@@ -1996,7 +1996,7 @@ process_evpd(int sg_fd, const struct opts_t * optsp)
MX_ALLOC_LEN);
return SG_LIB_CAT_MALFORMED;
} else if (len > DEF_ALLOC_LEN) {
- if (sg_ll_inquiry(sg_fd, 0, 1, optsp->page_num, rsp_buff, len, 1,
+ if (sg_ll_inquiry(sg_fd, 0, 1, optsp->page_num, rsp_buff, len, 1,
optsp->do_verbose))
return SG_LIB_CAT_OTHER;
}
@@ -2008,7 +2008,7 @@ process_evpd(int sg_fd, const struct opts_t * optsp)
else if (0 == optsp->page_num) { /* decode this mandatory page */
peri_type = rsp_buff[0] & 0x1f;
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(peri_type, sizeof(buff), buff));
printf(" Supported VPD pages:\n");
num = rsp_buff[3];
@@ -2649,7 +2649,7 @@ err_out:
/* Following code permits ATA IDENTIFY commands to be performed on
ATA non "Packet Interface" devices (e.g. ATA disks).
GPL-ed code borrowed from smartmontools (smartmontools.sf.net).
- Copyright (C) 2002-4 Bruce Allen
+ Copyright (C) 2002-4 Bruce Allen
<smartmontools-support@lists.sourceforge.net>
*/
#ifndef ATA_IDENTIFY_DEVICE
diff --git a/src/sg_logs.c b/src/sg_logs.c
index 5a3ccd21..7720fc81 100644
--- a/src/sg_logs.c
+++ b/src/sg_logs.c
@@ -22,7 +22,7 @@
* any later version.
This program outputs information provided by a SCSI LOG SENSE command.
-
+
*/
static char * version_str = "0.81 20080510"; /* SPC-4 revision 12 */
@@ -803,7 +803,7 @@ get_pcb_str(int pcb, char * outp, int maxoutlen)
int n;
n = sprintf(buff, "du=%d [ds=%d] tsd=%d etc=%d ", ((pcb & 0x80) ? 1 : 0),
- ((pcb & 0x40) ? 1 : 0), ((pcb & 0x20) ? 1 : 0),
+ ((pcb & 0x40) ? 1 : 0), ((pcb & 0x20) ? 1 : 0),
((pcb & 0x10) ? 1 : 0));
if (pcb & 0x10)
n += sprintf(buff + n, "tmc=%d ", ((pcb & 0xc) >> 2));
@@ -973,7 +973,7 @@ show_non_medium_error_page(unsigned char * resp, int len, int show_pcb)
switch (pc) {
case 0:
printf(" Non-medium error count"); break;
- default:
+ default:
if (pc <= 0x7fff)
printf(" Reserved [0x%x]", pc);
else
@@ -1081,14 +1081,14 @@ static const char * self_test_code[] = {
"reserved"};
static const char * self_test_result[] = {
- "completed without error",
- "aborted by SEND DIAGNOSTIC",
- "aborted other than by SEND DIAGNOSTIC",
- "unknown error, unable to complete",
- "self test completed with failure in test segment (which one unkown)",
- "first segment in self test failed",
- "second segment in self test failed",
- "another segment in self test failed",
+ "completed without error",
+ "aborted by SEND DIAGNOSTIC",
+ "aborted other than by SEND DIAGNOSTIC",
+ "unknown error, unable to complete",
+ "self test completed with failure in test segment (which one unkown)",
+ "first segment in self test failed",
+ "second segment in self test failed",
+ "another segment in self test failed",
"reserved", "reserved", "reserved", "reserved", "reserved", "reserved",
"reserved",
"self test in progress"};
@@ -1217,8 +1217,8 @@ show_start_stop_page(unsigned char * resp, int len, int show_pcb, int verbose)
switch (pc) {
case 1:
if (10 == extra)
- printf(" Date of manufacture, year: %.4s, week: %.2s",
- &ucp[4], &ucp[8]);
+ printf(" Date of manufacture, year: %.4s, week: %.2s",
+ &ucp[4], &ucp[8]);
else if (verbose) {
printf(" Date of manufacture parameter length "
"strange: %d\n", extra - 4);
@@ -1227,8 +1227,8 @@ show_start_stop_page(unsigned char * resp, int len, int show_pcb, int verbose)
break;
case 2:
if (10 == extra)
- printf(" Accounting date, year: %.4s, week: %.2s",
- &ucp[4], &ucp[8]);
+ printf(" Accounting date, year: %.4s, week: %.2s",
+ &ucp[4], &ucp[8]);
else if (verbose) {
printf(" Accounting date parameter length strange: %d\n",
extra - 4);
@@ -1295,7 +1295,7 @@ show_ie_page(unsigned char * resp, int len, int show_pcb, int full)
if (0 == pc) {
if (extra > 5) {
if (full) {
- printf(" IE asc = 0x%x, ascq = 0x%x", ucp[4], ucp[5]);
+ printf(" IE asc = 0x%x, ascq = 0x%x", ucp[4], ucp[5]);
if (ucp[4]) {
if(sg_get_asc_ascq_str(ucp[4], ucp[5], sizeof(b), b))
printf("\n [%s]", b);
@@ -2197,7 +2197,7 @@ show_background_scan_results_page(unsigned char * resp, int len, int show_pcb,
j = (ucp[4] << 24) + (ucp[5] << 16) + (ucp[6] << 8) + ucp[7];
printf("%d [%d:%d]\n", j, (j / 60), (j % 60));
j = (ucp[8] >> 4) & 0xf;
- if (j <
+ if (j <
(int)(sizeof(reassign_status) / sizeof(reassign_status[0])))
printf(" %s\n", reassign_status[j]);
else
@@ -2259,55 +2259,55 @@ show_sequential_access_page(unsigned char * resp, int len, int show_pcb,
}
gbytes = ull / 1000000000;
switch (pc) {
- case 0:
+ case 0:
printf(" Data bytes received with WRITE commands: %" PRIu64
" GB", gbytes);
if (verbose)
printf(" [%" PRIu64 " bytes]", ull);
printf("\n");
break;
- case 1:
+ case 1:
printf(" Data bytes written to media by WRITE commands: %" PRIu64
" GB", gbytes);
if (verbose)
printf(" [%" PRIu64 " bytes]", ull);
printf("\n");
break;
- case 2:
+ case 2:
printf(" Data bytes read from media by READ commands: %" PRIu64
" GB", gbytes);
if (verbose)
printf(" [%" PRIu64 " bytes]", ull);
printf("\n");
break;
- case 3:
+ case 3:
printf(" Data bytes transferred by READ commands: %" PRIu64
" GB", gbytes);
if (verbose)
printf(" [%" PRIu64 " bytes]", ull);
printf("\n");
break;
- case 4:
+ case 4:
printf(" Native capacity from BOP to EOD: %" PRIu64 " MB\n",
ull);
break;
- case 5:
+ case 5:
printf(" Native capacity from BOP to EW of current partition: "
"%" PRIu64 " MB\n", ull);
break;
- case 6:
+ case 6:
printf(" Minimum native capacity from EW to EOP of current "
"partition: %" PRIu64 " MB\n", ull);
break;
- case 7:
+ case 7:
printf(" Native capacity from BOP to current position: %"
PRIu64 " MB\n", ull);
break;
- case 8:
+ case 8:
printf(" Maximum native capacity in device object buffer: %"
PRIu64 " MB\n", ull);
break;
- case 0x100:
+ case 0x100:
if (ull > 0)
printf(" Cleaning action required\n");
else
@@ -2364,48 +2364,48 @@ show_device_stats_page(unsigned char * resp, int len, int show_pcb)
ull |= xp[j];
}
switch (pc) {
- case 0:
+ case 0:
printf(" Lifetime media loads: %" PRIu64 "\n", ull);
break;
- case 1:
+ case 1:
printf(" Lifetime cleaning operations: %" PRIu64 "\n", ull);
break;
- case 2:
+ case 2:
printf(" Lifetime power on hours: %" PRIu64 "\n", ull);
break;
- case 3:
+ case 3:
printf(" Lifetime media motion (head) hours: %" PRIu64 "\n",
ull);
break;
- case 4:
+ case 4:
printf(" Lifetime metres of tape processed: %" PRIu64 "\n",
ull);
break;
- case 5:
+ case 5:
printf(" Lifetime media motion (head) hours when "
"incompatible media last loaded: %" PRIu64 "\n", ull);
break;
- case 6:
+ case 6:
printf(" Lifetime power on hours when last temperature "
"condition occurred: %" PRIu64 "\n", ull);
break;
- case 7:
+ case 7:
printf(" Lifetime power on hours when last power "
"consumption condition occurred: %" PRIu64 "\n", ull);
break;
- case 8:
+ case 8:
printf(" Media motion (head) hours since last successful "
"cleaning operation: %" PRIu64 "\n", ull);
break;
- case 9:
+ case 9:
printf(" Media motion (head) hours since 2nd to last "
"successful cleaning: %" PRIu64 "\n", ull);
break;
- case 0xa:
+ case 0xa:
printf(" Media motion (head) hours since 3rd to last "
"successful cleaning: %" PRIu64 "\n", ull);
break;
- case 0xb:
+ case 0xb:
printf(" Lifetime power on hours when last operator "
"initiated forced reset\n and/or emergency "
"eject occurred: %" PRIu64 "\n", ull);
@@ -2417,7 +2417,7 @@ show_device_stats_page(unsigned char * resp, int len, int show_pcb)
}
} else {
switch (pc) {
- case 0x1000:
+ case 0x1000:
printf(" Media motion (head) hours for each medium type:\n");
printf(" <<to be decoded, dump in hex for now>>:\n");
dStrHex((const char *)ucp, pl, 0);
@@ -2467,93 +2467,93 @@ show_media_stats_page(unsigned char * resp, int len, int show_pcb)
ull |= xp[j];
}
switch (pc) {
- case 0:
+ case 0:
printf(" Number of moves: %" PRIu64 "\n", ull);
break;
- case 1:
+ case 1:
printf(" Number of picks: %" PRIu64 "\n", ull);
break;
- case 2:
+ case 2:
printf(" Number of pick retries: %" PRIu64 "\n", ull);
break;
- case 3:
+ case 3:
printf(" Number of places: %" PRIu64 "\n", ull);
break;
- case 4:
+ case 4:
printf(" Number of place retries: %" PRIu64 "\n", ull);
break;
- case 5:
+ case 5:
printf(" Number of volume tags read by volume "
"tag reader: %" PRIu64 "\n", ull);
break;
- case 6:
+ case 6:
printf(" Number of invalid volume tags returned by "
"volume tag reader: %" PRIu64 "\n", ull);
break;
- case 7:
+ case 7:
printf(" Number of library door opens: %" PRIu64 "\n", ull);
break;
- case 8:
+ case 8:
printf(" Number of import/export door opens: %" PRIu64 "\n",
ull);
break;
- case 9:
+ case 9:
printf(" Number of physical inventory scans: %" PRIu64 "\n",
ull);
break;
- case 0xa:
+ case 0xa:
printf(" Number of medium transport unrecovered errors: "
"%" PRIu64 "\n", ull);
break;
- case 0xb:
+ case 0xb:
printf(" Number of medium transport recovered errors: "
"%" PRIu64 "\n", ull);
break;
- case 0xc:
+ case 0xc:
printf(" Number of medium transport X axis translation "
"unrecovered errors: %" PRIu64 "\n", ull);
break;
- case 0xd:
+ case 0xd:
printf(" Number of medium transport X axis translation "
"recovered errors: %" PRIu64 "\n", ull);
break;
- case 0xe:
+ case 0xe:
printf(" Number of medium transport Y axis translation "
"unrecovered errors: %" PRIu64 "\n", ull);
break;
- case 0xf:
+ case 0xf:
printf(" Number of medium transport Y axis translation "
"recovered errors: %" PRIu64 "\n", ull);
break;
- case 0x10:
+ case 0x10:
printf(" Number of medium transport Z axis translation "
"unrecovered errors: %" PRIu64 "\n", ull);
break;
- case 0x11:
+ case 0x11:
printf(" Number of medium transport Z axis translation "
"recovered errors: %" PRIu64 "\n", ull);
break;
- case 0x12:
+ case 0x12:
printf(" Number of medium transport rotational translation "
"unrecovered errors: %" PRIu64 "\n", ull);
break;
- case 0x13:
+ case 0x13:
printf(" Number of medium transport rotational translation "
"recovered errors: %" PRIu64 "\n", ull);
break;
- case 0x14:
+ case 0x14:
printf(" Number of medium transport inversion translation "
"unrecovered errors: %" PRIu64 "\n", ull);
break;
- case 0x15:
+ case 0x15:
printf(" Number of medium transport inversion translation "
"recovered errors: %" PRIu64 "\n", ull);
break;
- case 0x16:
+ case 0x16:
printf(" Number of medium transport auxiliary translation "
"unrecovered errors: %" PRIu64 "\n", ull);
break;
- case 0x17:
+ case 0x17:
printf(" Number of medium transport auxiliary translation "
"recovered errors: %" PRIu64 "\n", ull);
break;
@@ -2884,7 +2884,7 @@ show_seagate_factory_page(unsigned char * resp, int len, int show_pcb)
}
static void
-show_ascii_page(unsigned char * resp, int len,
+show_ascii_page(unsigned char * resp, int len,
struct sg_simple_inquiry_resp * inq_dat,
const struct opts_t * optsp)
{
@@ -3083,7 +3083,7 @@ show_ascii_page(unsigned char * resp, int len,
break;
}
if (! done) {
- printf("No ascii information for page = 0x%x, here is hex:\n",
+ printf("No ascii information for page = 0x%x, here is hex:\n",
resp[0] & 0x3f);
if (len > 128) {
dStrHex((const char *)resp, 64, 1);
@@ -3094,7 +3094,7 @@ show_ascii_page(unsigned char * resp, int len,
dStrHex((const char *)resp, len, 1);
}
}
-
+
static int
fetchTemperature(int sg_fd, unsigned char * resp, int max_len,
struct opts_t * optsp)
@@ -3146,7 +3146,7 @@ main(int argc, char * argv[])
memset(&opts, 0, sizeof(opts));
memset(rsp_buff, 0, sizeof(rsp_buff));
/* N.B. some disks only give data for current cumulative */
- opts.page_control = 1;
+ opts.page_control = 1;
res = process_cl(&opts, argc, argv);
if (res)
return SG_LIB_SYNTAX_ERROR;
@@ -3289,7 +3289,7 @@ main(int argc, char * argv[])
opts.subpg_code = parr[++k];
else
opts.subpg_code = NOT_SUBPG_LOG;
-
+
res = do_logs(sg_fd, rsp_buff, resp_len, 1, &opts);
if (0 == res) {
pg_len = (rsp_buff[2] << 8) + rsp_buff[3];
diff --git a/src/sg_luns.c b/src/sg_luns.c
index e2dd7c6b..0476bed1 100644
--- a/src/sg_luns.c
+++ b/src/sg_luns.c
@@ -45,14 +45,14 @@
/* A utility program for the Linux OS SCSI subsystem.
*
*
- * This program issues the SCSI command REPORT LUNS to the given SCSI device.
+ * This program issues the SCSI command REPORT LUNS to the given SCSI device.
*/
static char * version_str = "1.14 20080510";
#define MAX_RLUNS_BUFF_LEN (1024 * 64)
#define DEF_RLUNS_BUFF_LEN MAX_RLUNS_BUFF_LEN
-
+
static unsigned char reportLunsBuff[MAX_RLUNS_BUFF_LEN];
@@ -102,7 +102,7 @@ usage()
/* Decoded according to SAM-4 rev 4. Note that one draft: BCC rev 0,
* defines its own "bridge addressing method" in place of the SAM-3
- * "logical addressing method". */
+ * "logical addressing method". */
static void
decode_lun(const char * leadin, unsigned char * lunp)
{
diff --git a/src/sg_map.c b/src/sg_map.c
index fa3d5bac..d5f89106 100644
--- a/src/sg_map.c
+++ b/src/sg_map.c
@@ -145,7 +145,7 @@ static int sysfs_sg_scan(const char * dir_name)
return num;
}
-static void make_dev_name(char * fname, const char * leadin, int k,
+static void make_dev_name(char * fname, const char * leadin, int k,
int do_numeric)
{
char buff[64];
@@ -323,7 +323,7 @@ int main(int argc, char * argv[])
if (do_all_s || do_sr)
scan_dev_type("/dev/sr", MAX_SR_DEVS, 1, LIN_DEV_TYPE_SR, last_sg_ind);
if (do_all_s || do_scd)
- scan_dev_type("/dev/scd", MAX_SR_DEVS, 1, LIN_DEV_TYPE_SCD,
+ scan_dev_type("/dev/scd", MAX_SR_DEVS, 1, LIN_DEV_TYPE_SCD,
last_sg_ind);
if (do_all_s || do_st)
scan_dev_type("/dev/nst", MAX_ST_DEVS, 1, LIN_DEV_TYPE_ST,
@@ -353,7 +353,7 @@ int main(int argc, char * argv[])
printf(do_extra ? " -3 -3 -3 -3 -3" : " some error");
break;
case 1:
- if (do_extra)
+ if (do_extra)
printf(" %d %d %d %d %d", map_arr[k].sg_dat.host_no,
map_arr[k].sg_dat.channel, map_arr[k].sg_dat.scsi_id,
map_arr[k].sg_dat.lun, map_arr[k].sg_dat.scsi_type);
@@ -383,7 +383,7 @@ int main(int argc, char * argv[])
break;
}
if (do_inquiry)
- printf(" %.8s %.16s %.4s", map_arr[k].vendor,
+ printf(" %.8s %.16s %.4s", map_arr[k].vendor,
map_arr[k].product, map_arr[k].revision);
break;
default:
@@ -394,8 +394,8 @@ int main(int argc, char * argv[])
}
return 0;
}
-
-static int find_dev_in_sg_arr(My_scsi_idlun * my_idlun, int host_no,
+
+static int find_dev_in_sg_arr(My_scsi_idlun * my_idlun, int host_no,
int last_sg_ind)
{
int k;
@@ -430,7 +430,7 @@ static void scan_dev_type(const char * leadin, int max_dev, int do_numeric,
if (res < 0) {
snprintf(ebuff, EBUFF_SZ, "Error closing %s ", fname);
perror("sg_map: close error");
-#ifndef IGN_CLOSE_ERR
+#ifndef IGN_CLOSE_ERR
return;
#else
++num_errors;
@@ -484,8 +484,8 @@ static void scan_dev_type(const char * leadin, int max_dev, int do_numeric,
#endif
continue;
}
-#ifdef DEBUG
- printf ("%i(%x) %i %i %i %i\n", host_no, my_idlun.host_unique_id,
+#ifdef DEBUG
+ printf ("%i(%x) %i %i %i %i\n", host_no, my_idlun.host_unique_id,
(my_idlun.dev_id>>24)&0xff, (my_idlun.dev_id>>16)&0xff,
(my_idlun.dev_id>>8)&0xff, my_idlun.dev_id&0xff);
#endif
@@ -495,7 +495,7 @@ static void scan_dev_type(const char * leadin, int max_dev, int do_numeric,
map_arr[ind].lin_dev_type = lin_dev_type;
}
else
- printf("Strange, could not find device %s mapped to sg device??\n",
+ printf("Strange, could not find device %s mapped to sg device??\n",
fname);
}
}
diff --git a/src/sg_modes.c b/src/sg_modes.c
index c793dca2..99bce2c6 100644
--- a/src/sg_modes.c
+++ b/src/sg_modes.c
@@ -23,7 +23,7 @@
Does 10 byte MODE SENSE commands by default, Trent Piepho added a "-6"
switch for force 6 byte mode sense commands.
This utility cannot modify mode pages. See the sdparm utility for that.
-
+
*/
static char * version_str = "1.29 20080218";
@@ -757,28 +757,28 @@ list_page_codes(int scsi_ptype, int inq_byte6, int t_proto)
dp = mode_page_cs_table(-1, &num);
pe_dp = mode_page_cs_table(scsi_ptype, &num_ptype);
while (1) {
- pg = dp ? dp->page_code : PG_CODE_ALL + 1;
- spg = dp ? dp->subpage_code : SPG_CODE_ALL;
+ pg = dp ? dp->page_code : PG_CODE_ALL + 1;
+ spg = dp ? dp->subpage_code : SPG_CODE_ALL;
c = (pg << 8) + spg;
- pg = pe_dp ? pe_dp->page_code : PG_CODE_ALL + 1;
+ pg = pe_dp ? pe_dp->page_code : PG_CODE_ALL + 1;
spg = pe_dp ? pe_dp->subpage_code : SPG_CODE_ALL;
d = (pg << 8) + spg;
if (valid_transport &&
((PROTO_SPECIFIC_1 == c) || (PROTO_SPECIFIC_2 == c)))
dp = (--num <= 0) ? NULL : (dp + 1); /* skip protocol specific */
- else if (c == d) {
+ else if (c == d) {
if (pe_dp->subpage_code)
printf(" 0x%02x,0x%02x * %s\n", pe_dp->page_code,
- pe_dp->subpage_code, pe_dp->desc);
+ pe_dp->subpage_code, pe_dp->desc);
else
printf(" 0x%02x * %s\n", pe_dp->page_code,
- pe_dp->desc);
+ pe_dp->desc);
dp = (--num <= 0) ? NULL : (dp + 1);
pe_dp = (--num_ptype <= 0) ? NULL : (pe_dp + 1);
- } else if (c < d) {
+ } else if (c < d) {
if (dp->subpage_code)
printf(" 0x%02x,0x%02x %s\n", dp->page_code,
- dp->subpage_code, dp->desc);
+ dp->subpage_code, dp->desc);
else
printf(" 0x%02x %s\n", dp->page_code,
dp->desc);
@@ -786,10 +786,10 @@ list_page_codes(int scsi_ptype, int inq_byte6, int t_proto)
} else {
if (pe_dp->subpage_code)
printf(" 0x%02x,0x%02x %s\n", pe_dp->page_code,
- pe_dp->subpage_code, pe_dp->desc);
+ pe_dp->subpage_code, pe_dp->desc);
else
printf(" 0x%02x %s\n", pe_dp->page_code,
- pe_dp->desc);
+ pe_dp->desc);
pe_dp = (--num_ptype <= 0) ? NULL : (pe_dp + 1);
}
if ((NULL == dp) && (NULL == pe_dp))
@@ -802,7 +802,7 @@ list_page_codes(int scsi_ptype, int inq_byte6, int t_proto)
while (dp) {
if (dp->subpage_code)
printf(" 0x%02x,0x%02x %s\n", dp->page_code,
- dp->subpage_code, dp->desc);
+ dp->subpage_code, dp->desc);
else
printf(" 0x%02x %s\n", dp->page_code,
dp->desc);
@@ -816,7 +816,7 @@ list_page_codes(int scsi_ptype, int inq_byte6, int t_proto)
while (dp) {
if (dp->subpage_code)
printf(" 0x%02x,0x%02x %s\n", dp->page_code,
- dp->subpage_code, dp->desc);
+ dp->subpage_code, dp->desc);
else
printf(" 0x%02x %s\n", dp->page_code,
dp->desc);
@@ -830,7 +830,7 @@ list_page_codes(int scsi_ptype, int inq_byte6, int t_proto)
while (dp) {
if (dp->subpage_code)
printf(" 0x%02x,0x%02x %s\n", dp->page_code,
- dp->subpage_code, dp->desc);
+ dp->subpage_code, dp->desc);
else
printf(" 0x%02x %s\n", dp->page_code,
dp->desc);
@@ -1020,7 +1020,7 @@ main(int argc, char * argv[])
inq_pdt = inq_out.peripheral_type;
inq_byte6 = inq_out.byte_6;
if (0 == opts.do_raw)
- printf(" %.8s %.16s %.4s peripheral_type: %s [0x%x]\n",
+ printf(" %.8s %.16s %.4s peripheral_type: %s [0x%x]\n",
inq_out.vendor, inq_out.product, inq_out.revision,
sg_get_pdt_str(inq_pdt, sizeof(pdt_name), pdt_name), inq_pdt);
if (opts.do_list) {
@@ -1143,7 +1143,7 @@ main(int argc, char * argv[])
if (1 == opts.do_raw)
dStrRaw((const char *)rsp_buff, md_len);
else {
- ucp = rsp_buff + bd_len + headerlen;
+ ucp = rsp_buff + bd_len + headerlen;
md_len -= bd_len + headerlen;
spf = ((ucp[0] & 0x40) ? 1 : 0);
len = (spf ? ((ucp[2] << 8) + ucp[3] + 4) : (ucp[1] + 2));
@@ -1160,11 +1160,11 @@ main(int argc, char * argv[])
dStrHex((const char *)rsp_buff, headerlen, 1);
if (0 == inq_pdt)
printf(" Mode data length=%d, medium type=0x%.2x, WP=%d,"
- " DpoFua=%d, longlba=%d\n", md_len, medium_type,
+ " DpoFua=%d, longlba=%d\n", md_len, medium_type,
!!(specific & 0x80), !!(specific & 0x10), longlba);
else
printf(" Mode data length=%d, medium type=0x%.2x, specific"
- " param=0x%.2x, longlba=%d\n", md_len, medium_type,
+ " param=0x%.2x, longlba=%d\n", md_len, medium_type,
specific, longlba);
if (md_len > rsp_buff_size) {
printf("Only fetched %d bytes of response, truncate output\n",
@@ -1185,13 +1185,13 @@ main(int argc, char * argv[])
len = 16;
density_code_off = 8;
}
- else if (0 == inq_pdt) {
+ else if (0 == inq_pdt) {
printf("> Direct access device block descriptors:\n");
density_code_off = 4;
}
else
printf("> General mode parameter block descriptors:\n");
-
+
ucp = rsp_buff + headerlen;
while (num > 0) {
printf(" Density code=0x%x\n",
diff --git a/src/sg_opcodes.c b/src/sg_opcodes.c
index a081c42f..92867da8 100644
--- a/src/sg_opcodes.c
+++ b/src/sg_opcodes.c
@@ -517,8 +517,8 @@ static void list_all_codes(unsigned char * rsoc_buff, int rsoc_len,
char sa_buff[8];
unsigned char ** sort_arr = NULL;
- cd_len = ((rsoc_buff[0] << 24) | (rsoc_buff[1] << 16) |
- (rsoc_buff[2] << 8) | rsoc_buff[3]);
+ cd_len = ((rsoc_buff[0] << 24) | (rsoc_buff[1] << 16) |
+ (rsoc_buff[2] << 8) | rsoc_buff[3]);
if (cd_len > (rsoc_len - 4)) {
printf("sg_opcodes: command data length=%d, allocation=%d; "
"truncate\n", cd_len, rsoc_len - 4);
@@ -552,7 +552,7 @@ static void list_all_codes(unsigned char * rsoc_buff, int rsoc_len,
sort_arr[j] = ucp;
len = (ucp[5] & 0x2) ? 20 : 8;
}
- qsort(sort_arr, j, sizeof(unsigned char *),
+ qsort(sort_arr, j, sizeof(unsigned char *),
(alpha ? opcode_alpha_compare : opcode_num_compare));
}
for (k = 0, j = 0; k < cd_len; ++j, k += len) {
@@ -564,7 +564,7 @@ static void list_all_codes(unsigned char * rsoc_buff, int rsoc_len,
NAME_BUFF_SZ, name_buff);
snprintf(sa_buff, sizeof(sa_buff), "%.4x", serv_act);
} else {
- sg_get_opcode_name(ucp[0], peri_type,
+ sg_get_opcode_name(ucp[0], peri_type,
NAME_BUFF_SZ, name_buff);
memset(sa_buff, ' ', sizeof(sa_buff));
}
@@ -662,7 +662,7 @@ static void list_one(unsigned char * rsoc_buff, int cd_len, int rep_opts,
break;
default:
snprintf(name_buff, NAME_BUFF_SZ, "support reserved [0x%x]",
- rsoc_buff[1] & 7);
+ rsoc_buff[1] & 7);
cp = name_buff;
break;
}
@@ -710,7 +710,7 @@ int main(int argc, char * argv[])
fprintf(stderr, "Version string: %s\n", version_str);
return 0;
}
-
+
if (NULL == opts.device_name) {
fprintf(stderr, "No DEVICE argument given\n");
if (opts.opt_new)
@@ -944,7 +944,7 @@ static int do_rsoc(int sg_fd, int rctd, int rep_opts, int rq_opcode,
int verbose)
{
int res, k;
- unsigned char rsocCmdBlk[RSOC_CMD_LEN] = {SG_MAINTENANCE_IN, RSOC_SA, 0,
+ unsigned char rsocCmdBlk[RSOC_CMD_LEN] = {SG_MAINTENANCE_IN, RSOC_SA, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_io_hdr io_hdr;
diff --git a/src/sg_persist.c b/src/sg_persist.c
index e5e52698..22b5a311 100644
--- a/src/sg_persist.c
+++ b/src/sg_persist.c
@@ -23,7 +23,7 @@
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- This program issues the SCSI PERSISTENT IN and OUT commands.
+ This program issues the SCSI PERSISTENT IN and OUT commands.
*/
@@ -89,7 +89,7 @@ static const char * prin_sa_strs[] = {
"[reserved 0x6]",
"[reserved 0x7]",
};
-static const int num_prin_sa_strs = sizeof(prin_sa_strs) /
+static const int num_prin_sa_strs = sizeof(prin_sa_strs) /
sizeof(prin_sa_strs[0]);
static const char * prout_sa_strs[] = {
@@ -103,7 +103,7 @@ static const char * prout_sa_strs[] = {
"Register and move",
"[reserved 0x8]",
};
-static const int num_prout_sa_strs = sizeof(prout_sa_strs) /
+static const int num_prout_sa_strs = sizeof(prout_sa_strs) /
sizeof(prout_sa_strs[0]);
@@ -189,7 +189,7 @@ static void decode_transport_id(const char * leadin, unsigned char * ucp,
switch (proto_id) {
case TPROTO_FCP: /* Fibre channel */
printf("%s FCP-2 World Wide Name:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 8, 0);
@@ -198,7 +198,7 @@ static void decode_transport_id(const char * leadin, unsigned char * ucp,
case TPROTO_SPI: /* Parallel SCSI */
printf("%s Parallel SCSI initiator SCSI address: 0x%x\n",
leadin, ((ucp[2] << 8) | ucp[3]));
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
printf("%s relative port number (of corresponding target): "
@@ -213,7 +213,7 @@ static void decode_transport_id(const char * leadin, unsigned char * ucp,
break;
case TPROTO_1394: /* IEEE 1394 */
printf("%s IEEE 1394 EUI-64 name:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 8, 0);
@@ -221,7 +221,7 @@ static void decode_transport_id(const char * leadin, unsigned char * ucp,
break;
case TPROTO_SRP:
printf("%s RDMA initiator port identifier:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 16, 0);
@@ -248,7 +248,7 @@ static void decode_transport_id(const char * leadin, unsigned char * ucp,
ull |= ucp[4 + j];
}
printf("%s SAS address: 0x%" PRIx64 "\n", leadin, ull);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
bump = 24;
@@ -340,10 +340,10 @@ static int prin_work(int sg_fd, int prin_sa, int do_verbose, int do_hex)
}
}
} else {
- pr_gen = ((pr_buff[0] << 24) | (pr_buff[1] << 16) |
- (pr_buff[2] << 8) | pr_buff[3]);
- add_len = ((pr_buff[4] << 24) | (pr_buff[5] << 16) |
- (pr_buff[6] << 8) | pr_buff[7]);
+ pr_gen = ((pr_buff[0] << 24) | (pr_buff[1] << 16) |
+ (pr_buff[2] << 8) | pr_buff[3]);
+ add_len = ((pr_buff[4] << 24) | (pr_buff[5] << 16) |
+ (pr_buff[6] << 8) | pr_buff[7]);
if (do_hex) {
printf(" PR generation=0x%x, ", pr_gen);
if (add_len <= 0)
@@ -417,7 +417,7 @@ static int prin_work(int sg_fd, int prin_sa, int do_verbose, int do_hex)
else {
printf(" All target ports bit clear\n");
rel_pt_addr = ((ucp[18] << 8) | ucp[19]);
- printf(" Relative port address: 0x%x\n",
+ printf(" Relative port address: 0x%x\n",
rel_pt_addr);
}
if (ucp[12] & 0x1) {
@@ -439,7 +439,7 @@ static int prin_work(int sg_fd, int prin_sa, int do_verbose, int do_hex)
return 0;
}
-static int prout_work(int sg_fd, int prout_sa, unsigned int prout_type,
+static int prout_work(int sg_fd, int prout_sa, unsigned int prout_type,
uint64_t param_rk, uint64_t param_sark,
int param_alltgpt, int param_aptpl,
unsigned char * transportidp, int transportid_len,
@@ -498,7 +498,7 @@ static int prout_work(int sg_fd, int prout_sa, unsigned int prout_type,
return 0;
}
-static int prout_rmove_work(int sg_fd, unsigned int prout_type,
+static int prout_rmove_work(int sg_fd, unsigned int prout_type,
uint64_t param_rk, uint64_t param_sark, int param_unreg,
int param_aptpl, unsigned int rel_target_port,
unsigned char * transportidp, int transportid_len,
@@ -719,7 +719,7 @@ int main(int argc, char * argv[])
while (1) {
int option_index = 0;
- c = getopt_long(argc, argv, "AcCd:GHhiIkK:LMnoPQrRsS:T:UvVX:YZ",
+ c = getopt_long(argc, argv, "AcCd:GHhiIkK:LMnoPQrRsS:T:UvVX:YZ",
long_options, &option_index);
if (c == -1)
break;
@@ -835,8 +835,8 @@ int main(int argc, char * argv[])
return 0;
case 'X':
memset(transportid_arr, 0, sizeof(transportid_arr));
- if (0 != build_transportid(optarg, transportid_arr,
- &transportid_arr_len,
+ if (0 != build_transportid(optarg, transportid_arr,
+ &transportid_arr_len,
&num_transportids,
sizeof(transportid_arr))) {
fprintf(stderr, "bad argument to '--transport-id'\n");
@@ -957,7 +957,7 @@ int main(int argc, char * argv[])
else
printf(" Peripheral device type: 0x%x\n", peri_type);
} else {
- printf("sg_persist: %s doesn't respond to a SCSI INQUIRY\n",
+ printf("sg_persist: %s doesn't respond to a SCSI INQUIRY\n",
device_name);
return SG_LIB_CAT_OTHER;
}
diff --git a/src/sg_raw.c b/src/sg_raw.c
index 6d1016ac..29320a43 100644
--- a/src/sg_raw.c
+++ b/src/sg_raw.c
@@ -9,7 +9,7 @@
* any later version.
*
* This program can be used to send raw SCSI commands (with an optional
- * data phase) through a Generic SCSI interface.
+ * data phase) through a Generic SCSI interface.
*/
#include <stdlib.h>
@@ -447,7 +447,7 @@ main(int argc, char *argv[])
} else {
const char * cp = "stdout";
- if (opts.datain_file &&
+ if (opts.datain_file &&
! ((1 == strlen(opts.datain_file)) &&
('-' == opts.datain_file[0])))
cp = opts.datain_file;
diff --git a/src/sg_rbuf.c b/src/sg_rbuf.c
index 6d3f56be..7f1f3c12 100644
--- a/src/sg_rbuf.c
+++ b/src/sg_rbuf.c
@@ -1,6 +1,6 @@
#define _XOPEN_SOURCE 500
#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
+#define _GNU_SOURCE
#endif
#include <unistd.h>
@@ -564,10 +564,10 @@ int main(int argc, char * argv[])
if (rawp) free(rawp);
return (res >= 0) ? res : SG_LIB_CAT_OTHER;
}
- if (opts.do_dio &&
+ if (opts.do_dio &&
((io_hdr.info & SG_INFO_DIRECT_IO_MASK) != SG_INFO_DIRECT_IO))
dio_incomplete = 1; /* flag that dio not done (completely) */
-
+
#ifdef SG_DEBUG
if (clear) {
for (j = 0; j < buf_size; ++j) {
@@ -593,7 +593,7 @@ int main(int argc, char * argv[])
a = res_tm.tv_sec;
a += (0.000001 * res_tm.tv_usec);
b = (double)buf_size * num;
- printf("time to read data from buffer was %d.%06d secs",
+ printf("time to read data from buffer was %d.%06d secs",
(int)res_tm.tv_sec, (int)res_tm.tv_usec);
if ((a > 0.00001) && (b > 511))
printf(", %.2f MB/sec\n", b / (a * 1000000.0));
diff --git a/src/sg_rdac.c b/src/sg_rdac.c
index d5be61f1..d78f3e31 100644
--- a/src/sg_rdac.c
+++ b/src/sg_rdac.c
@@ -103,7 +103,7 @@ static int fail_all_paths(int fd)
rdac_page->quiescence = RDAC_QUIESCENCE_TIME;
rdac_page->options = RDAC_FORCE_QUIESCENCE;
rdac_page->current_mode_lsb = RDAC_FAIL_ALL_PATHS;
-
+
res = sg_ll_mode_select6(fd, 1 /* pf */, 0 /* sp */,
fail_paths_pg, 118,
1, (do_verbose ? 2 : 0));
@@ -243,7 +243,7 @@ static void print_rdac_mode( unsigned char *ptr )
printf("active/active mode; ");
break;
default:
- printf("(Unknown status 0x%x); ",
+ printf("(Unknown status 0x%x); ",
rdac_ptr->alternate_mode_msb);
break;
}
@@ -316,7 +316,7 @@ int main(int argc, char * argv[])
int fail_all = 0;
int fail_path = 0;
int ret = 0;
-
+
if (argc < 2) {
usage ();
return SG_LIB_SYNTAX_ERROR;
@@ -362,14 +362,14 @@ int main(int argc, char * argv[])
usage();
return SG_LIB_FILE_ERROR;
}
-
+
if (fail_all) {
res = fail_all_paths(fd);
} else if (fail_path) {
res = fail_this_path(fd, lun);
} else {
- res = sg_ll_mode_sense6(fd, /*DBD*/ 0, /* page control */0,
- 0x2c, 0, rsp_buff, 252,
+ res = sg_ll_mode_sense6(fd, /*DBD*/ 0, /* page control */0,
+ 0x2c, 0, rsp_buff, 252,
1, do_verbose);
if (!res) {
diff --git a/src/sg_read.c b/src/sg_read.c
index 9e191344..b18bfa33 100644
--- a/src/sg_read.c
+++ b/src/sg_read.c
@@ -19,7 +19,7 @@
#include <sys/sysmacros.h>
#include <sys/mman.h>
#include <sys/time.h>
-#include <linux/major.h>
+#include <linux/major.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -37,10 +37,10 @@
This program reads data from the given SCSI device (typically a disk
or cdrom) and discards that data. Its primary goal is to time
multiple reads all starting from the same logical address. Its interface
- is a subset of another member of this package: sg_dd which is a
+ is a subset of another member of this package: sg_dd which is a
"dd" variant. The input file can be a scsi generic device, a block device,
a raw device or a seekable file. Streams such as stdin are not acceptable.
- The block size ('bs') is assumed to be 512 if not given.
+ The block size ('bs') is assumed to be 512 if not given.
This version should compile with Linux sg drivers with version numbers
>= 30000 . For mmap-ed IO the sg version number >= 30122 .
@@ -65,7 +65,7 @@ static const char * version_str = "1.18 20071226";
#ifndef RAW_MAJOR
#define RAW_MAJOR 255 /*unlikey value */
-#endif
+#endif
#define FT_OTHER 1 /* filetype other than sg or raw device */
#define FT_SG 2 /* filetype is sg char device */
@@ -374,7 +374,7 @@ static int sg_bread(int sg_fd, unsigned char * buff, int blocks,
return -1;
}
if (blocks > 0) {
- if (diop && *diop &&
+ if (diop && *diop &&
((io_hdr.info & SG_INFO_DIRECT_IO_MASK) != SG_INFO_DIRECT_IO))
*diop = 0; /* flag that dio not done (completely) */
sum_of_resids += io_hdr.resid;
@@ -584,7 +584,7 @@ int main(int argc, char * argv[])
if (verbose > 2) {
if (ioctl(infd, SG_GET_RESERVED_SIZE, &t) >= 0)
fprintf(stderr, " SG_GET_RESERVED_SIZE yields: %d\n", t);
- }
+ }
t = bs * bpt;
if ((do_mmap) && (0 != (t % psz)))
t = ((t / psz) + 1) * psz; /* round up to next pagesize */
@@ -698,12 +698,12 @@ int main(int argc, char * argv[])
buf_sz = MIN_RESERVED_SIZE;
blocks_per = (buf_sz + bs - 1) / bs;
blocks = blocks_per;
- fprintf(stderr,
+ fprintf(stderr,
"Reducing read to %d blocks per loop\n", blocks_per);
res = sg_bread(infd, wrkPos, blocks, skip, bs, scsi_cdbsz,
fua, dpo, &dio_tmp, do_mmap, no_dxfer);
} else if (2 == res) {
- fprintf(stderr,
+ fprintf(stderr,
"Unit attention, try again (r)\n");
res = sg_bread(infd, wrkPos, blocks, skip, bs, scsi_cdbsz,
fua, dpo, &dio_tmp, do_mmap, no_dxfer);
@@ -798,7 +798,7 @@ int main(int argc, char * argv[])
b = 0.0;
c = 0.0;
}
-
+
if (1 == do_time) {
fprintf(stderr, "Time for all %s commands was "
"%d.%06d secs", read_str, (int)res_tm.tv_sec,
@@ -815,7 +815,7 @@ int main(int argc, char * argv[])
fprintf(stderr, ", %.2f MB/sec\n", c / (a * 1000000.0));
else
fprintf(stderr, "\n");
- } else {
+ } else {
fprintf(stderr, "Time from start of %s command "
"#%d to end was %d.%06d secs", read_str, do_time,
(int)res_tm.tv_sec, (int)res_tm.tv_usec);
@@ -846,7 +846,7 @@ int main(int argc, char * argv[])
int fd;
char c;
- fprintf(stderr, ">> Direct IO requested but incomplete %d times\n",
+ fprintf(stderr, ">> Direct IO requested but incomplete %d times\n",
dio_incomplete);
if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) {
if (1 == read(fd, &c, 1)) {
@@ -858,7 +858,7 @@ int main(int argc, char * argv[])
}
}
if (sum_of_resids)
- fprintf(stderr, ">> Non-zero sum of residual counts=%d\n",
+ fprintf(stderr, ">> Non-zero sum of residual counts=%d\n",
sum_of_resids);
return (ret >= 0) ? ret : SG_LIB_CAT_OTHER;
}
diff --git a/src/sg_read_long.c b/src/sg_read_long.c
index 6f1aba45..5359fcb4 100644
--- a/src/sg_read_long.c
+++ b/src/sg_read_long.c
@@ -22,7 +22,7 @@
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- This program issues the SCSI command READ LONG to a given SCSI device.
+ This program issues the SCSI command READ LONG to a given SCSI device.
It sends the command with the logical block address passed as the lba
argument, and the transfer length set to the xfer_len argument. the
buffer to be writen to the device filled with 0xff, this buffer includes
diff --git a/src/sg_readcap.c b/src/sg_readcap.c
index 573ca3ff..e3fd6efb 100644
--- a/src/sg_readcap.c
+++ b/src/sg_readcap.c
@@ -418,9 +418,9 @@ int main(int argc, char * argv[])
double sz_mb, sz_gb;
total_sz *= block_size;
- sz_mb = ((double)(last_blk_addr + 1) * block_size) /
+ sz_mb = ((double)(last_blk_addr + 1) * block_size) /
(double)(1048576);
- sz_gb = ((double)(last_blk_addr + 1) * block_size) /
+ sz_gb = ((double)(last_blk_addr + 1) * block_size) /
(double)(1000000000L);
printf("Hence:\n");
#ifdef SG3_UTILS_MINGW
@@ -503,9 +503,9 @@ int main(int argc, char * argv[])
double sz_mb, sz_gb;
total_sz *= block_size;
- sz_mb = ((double)(llast_blk_addr + 1) * block_size) /
+ sz_mb = ((double)(llast_blk_addr + 1) * block_size) /
(double)(1048576);
- sz_gb = ((double)(llast_blk_addr + 1) * block_size) /
+ sz_gb = ((double)(llast_blk_addr + 1) * block_size) /
(double)(1000000000L);
printf("Hence:\n");
#ifdef SG3_UTILS_MINGW
@@ -518,11 +518,11 @@ int main(int argc, char * argv[])
}
goto good;
}
- else if (SG_LIB_CAT_INVALID_OP == res)
+ else if (SG_LIB_CAT_INVALID_OP == res)
fprintf(stderr, "READ CAPACITY (16) not supported\n");
- else if (SG_LIB_CAT_NOT_READY == res)
+ else if (SG_LIB_CAT_NOT_READY == res)
fprintf(stderr, "READ CAPACITY (16) failed, device not ready\n");
- else if (SG_LIB_CAT_ABORTED_COMMAND == res)
+ else if (SG_LIB_CAT_ABORTED_COMMAND == res)
fprintf(stderr, "READ CAPACITY (16) failed, aborted command\n");
else if (SG_LIB_CAT_ILLEGAL_REQ == res)
fprintf(stderr, "bad field in READ CAPACITY (16) cdb "
diff --git a/src/sg_reassign.c b/src/sg_reassign.c
index c77ad1a7..5c249588 100644
--- a/src/sg_reassign.c
+++ b/src/sg_reassign.c
@@ -49,7 +49,7 @@
*
* This utility invokes the REASSIGN BLOCKS SCSI command to reassign
* an existing (possibly damaged) lba on a direct access device (e.g.
- * a disk) to a new physical location. The previous contents is
+ * a disk) to a new physical location. The previous contents is
* recoverable then it is written to the remapped lba otherwise
* vendor specific data is written.
*/
@@ -415,14 +415,14 @@ main(int argc, char * argv[])
fprintf(stderr, ME "open error: %s: %s\n", device_name,
safe_strerror(-sg_fd));
return SG_LIB_FILE_ERROR;
- }
+ }
if (got_addr) {
if (dummy) {
fprintf(stderr, ">>> dummy: REASSIGN BLOCKS not executed\n");
if (verbose) {
fprintf(stderr, " Would have reassigned these blocks:\n");
- for (j = 0; j < addr_arr_len; ++j)
+ for (j = 0; j < addr_arr_len; ++j)
printf(" 0x%" PRIx64 "\n", addr_arr[j]);
}
return 0;
diff --git a/src/sg_requests.c b/src/sg_requests.c
index dbc432a9..44e2f1bf 100644
--- a/src/sg_requests.c
+++ b/src/sg_requests.c
@@ -44,7 +44,7 @@
/* A utility program for the Linux OS SCSI subsystem.
*
*
- * This program issues the SCSI command REQUEST SENSE to the given SCSI device.
+ * This program issues the SCSI command REQUEST SENSE to the given SCSI device.
*/
static char * version_str = "1.21 20080510";
@@ -285,7 +285,7 @@ main(int argc, char * argv[])
fprintf(stderr, "No progress indication found, "
"iteration %d\n", k + 1);
/* N.B. exits first time there isn't a progress indication */
- break;
+ break;
} else
printf("Progress indication: %d%% done\n",
(progress * 100) / 65536);
diff --git a/src/sg_rmsn.c b/src/sg_rmsn.c
index bc04b2ff..2467cdd5 100644
--- a/src/sg_rmsn.c
+++ b/src/sg_rmsn.c
@@ -154,7 +154,7 @@ int main(int argc, char * argv[])
1, verbose);
ret = res;
if (0 == res) {
- sn_len = (rmsn_buff[0] << 24) + (rmsn_buff[1] << 16) +
+ sn_len = (rmsn_buff[0] << 24) + (rmsn_buff[1] << 16) +
(rmsn_buff[2] << 8) + rmsn_buff[3];
if (! raw)
printf("Reported serial number length = %d\n", sn_len);
@@ -184,7 +184,7 @@ int main(int argc, char * argv[])
} else {
printf("Serial number:\n");
if (sn_len > 0)
- dStrHex((const char *)ucp + 4, sn_len, 0);
+ dStrHex((const char *)ucp + 4, sn_len, 0);
}
}
}
diff --git a/src/sg_rtpg.c b/src/sg_rtpg.c
index b02352f9..802a9baa 100644
--- a/src/sg_rtpg.c
+++ b/src/sg_rtpg.c
@@ -259,7 +259,7 @@ int main(int argc, char * argv[])
ret = res;
if (0 == res) {
report_len = (reportTgtGrpBuff[0] << 24) +
- (reportTgtGrpBuff[1] << 16) +
+ (reportTgtGrpBuff[1] << 16) +
(reportTgtGrpBuff[2] << 8) +
reportTgtGrpBuff[3] + 4;
if (report_len > (int)sizeof(reportTgtGrpBuff)) {
diff --git a/src/sg_safte.c b/src/sg_safte.c
index d94f3d22..74241c2a 100644
--- a/src/sg_safte.c
+++ b/src/sg_safte.c
@@ -56,8 +56,8 @@ static char * version_str = "0.24 20080513";
#define EBUFF_SZ 256
#define RB_MODE_DESC 3
-#define RWB_MODE_DATA 2
-#define RWB_MODE_VENDOR 1
+#define RWB_MODE_DATA 2
+#define RWB_MODE_VENDOR 1
#define RB_DESC_LEN 4
#define SAFTE_CFG_FLAG_DOORLOCK 1
@@ -112,7 +112,7 @@ read_safte_configuration(int sg_fd, unsigned char *rb_buff,
safte_cfg.psupplies = rb_buff[1];
safte_cfg.slots = rb_buff[2];
safte_cfg.temps = rb_buff[4];
- if (rb_buff[3])
+ if (rb_buff[3])
safte_cfg.flags |= SAFTE_CFG_FLAG_DOORLOCK;
if (rb_buff[5])
safte_cfg.flags |= SAFTE_CFG_FLAG_ALARM;
diff --git a/src/sg_sat_identify.c b/src/sg_sat_identify.c
index 3877d41f..35e225ff 100644
--- a/src/sg_sat_identify.c
+++ b/src/sg_sat_identify.c
@@ -184,7 +184,7 @@ static int do_identify_dev(int sg_fd, int do_packet, int cdb_len,
fprintf(stderr, "ATA PASS-THROUGH (%d), bad "
"field in cdb\n", cdb_len);
}
- return ret;
+ return ret;
case SPC_SK_NO_SENSE:
case SPC_SK_RECOVERED_ERROR:
if ((0x0 == ssh.asc) &&
diff --git a/src/sg_sat_phy_event.c b/src/sg_sat_phy_event.c
index f675b46b..3f200360 100644
--- a/src/sg_sat_phy_event.c
+++ b/src/sg_sat_phy_event.c
@@ -162,7 +162,7 @@ dStrRaw(const char* str, int len)
/* ATA READ LOG EXT command [2Fh, PIO data-in] */
/* N.B. "log_addr" is the log page number, "page_in_log" is usually zero */
-static int
+static int
do_read_log_ext(int sg_fd, int log_addr, int page_in_log, int feature,
int blk_count, void * resp, int mx_resp_len, int cdb_len,
int ck_cond, int extend, int do_hex, int do_raw, int verbose)
@@ -244,7 +244,7 @@ do_read_log_ext(int sg_fd, int log_addr, int page_in_log, int feature,
fprintf(stderr, "ATA PASS-THROUGH (%d), bad "
"field in cdb\n", cdb_len);
}
- return ret;
+ return ret;
case SPC_SK_NO_SENSE:
case SPC_SK_RECOVERED_ERROR:
if ((0x0 == ssh.asc) &&
diff --git a/src/sg_sat_set_features.c b/src/sg_sat_set_features.c
index 3b1f58f7..d44c73d3 100644
--- a/src/sg_sat_set_features.c
+++ b/src/sg_sat_set_features.c
@@ -185,7 +185,7 @@ static int do_set_features(int sg_fd, int feature, int count, int lba,
fprintf(stderr, "ATA PASS-THROUGH (%d), bad "
"field in cdb\n", cdb_len);
}
- return ret;
+ return ret;
case SPC_SK_NO_SENSE:
case SPC_SK_RECOVERED_ERROR:
if ((0x0 == ssh.asc) &&
diff --git a/src/sg_scan.c b/src/sg_scan.c
index 51951937..abb61431 100644
--- a/src/sg_scan.c
+++ b/src/sg_scan.c
@@ -268,10 +268,10 @@ int main(int argc, char * argv[])
if ((! has_file_args) && (stat(sysfs_sg_dir, &a_stat) >= 0) &&
(S_ISDIR(a_stat.st_mode)))
has_sysfs_sg = sysfs_sg_scan(sysfs_sg_dir);
-
+
flags = O_NONBLOCK | (writeable ? O_RDWR : O_RDONLY);
- for (k = 0, res = 0, j = 0, sg_fd = -1;
+ for (k = 0, res = 0, j = 0, sg_fd = -1;
(k < max_file_args) && (has_file_args || (num_errors < MAX_ERRORS));
++k, res = ((sg_fd >= 0) ? close(sg_fd) : 0)) {
if (res < 0) {
@@ -373,7 +373,7 @@ int main(int argc, char * argv[])
if (do_inquiry) {
if (-1 == sg_ver3) {
sg_ver3 = 0;
- if ((ioctl(sg_fd, SG_GET_VERSION_NUM, &f) >= 0) &&
+ if ((ioctl(sg_fd, SG_GET_VERSION_NUM, &f) >= 0) &&
(f >= 30000))
sg_ver3 = 1;
}
@@ -440,7 +440,7 @@ int sg3_inq(int sg_fd, unsigned char * inqBuff, int do_extra)
printf(" %.8s %.16s %.4s ", p + 8, p + 16, p + 32);
printf("[rmb=%d cmdq=%d pqual=%d pdev=0x%x] ",
- !!(p[1] & 0x80), !!(p[7] & 2), (p[0] & 0xe0) >> 5,
+ !!(p[1] & 0x80), !!(p[7] & 2), (p[0] & 0xe0) >> 5,
(p[0] & 0x1f));
if (do_extra && sg_io)
printf("dur=%ums\n", io_hdr.duration);
@@ -581,7 +581,7 @@ void printswap(char *output, char *in, unsigned int n)
int ata_command_interface(int device, char *data)
{
unsigned char buff[ATA_IDENTIFY_BUFF_SZ + HDIO_DRIVE_CMD_OFFSET];
- int retval;
+ int retval;
buff[0] = ATA_IDENTIFY_DEVICE;
buff[3] = 1;
diff --git a/src/sg_senddiag.c b/src/sg_senddiag.c
index fa7dc856..84e55aab 100644
--- a/src/sg_senddiag.c
+++ b/src/sg_senddiag.c
@@ -345,7 +345,7 @@ static int process_cl(struct opts_t * optsp, int argc, char * argv[])
/* Return of 0 -> success, otherwise see sg_ll_send_diag() */
static int do_senddiag(int sg_fd, int sf_code, int pf_bit, int sf_bit,
- int devofl_bit, int unitofl_bit, void * outgoing_pg,
+ int devofl_bit, int unitofl_bit, void * outgoing_pg,
int outgoing_len, int noisy, int verbose)
{
int long_duration = 0;
@@ -553,7 +553,7 @@ static void list_page_codes()
printf("Page_Code Description\n");
for (k = 0; k < num; ++k, ++pcdp)
printf(" 0x%02x %s\n", pcdp->page_code,
- (pcdp->desc ? pcdp->desc : "<unknown>"));
+ (pcdp->desc ? pcdp->desc : "<unknown>"));
}
@@ -605,7 +605,7 @@ int main(int argc, char * argv[])
return SG_LIB_SYNTAX_ERROR;
}
}
-
+
if ((opts.do_doff || opts.do_uoff) && (! opts.do_deftest)) {
if (opts.opt_new) {
printf("setting --doff or --uoff only useful when -t is set\n");
diff --git a/src/sg_ses.c b/src/sg_ses.c
index 6637b3f8..6aff6cc6 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -158,8 +158,8 @@ usage()
}
/* Return of 0 -> success, SG_LIB_CAT_INVALID_OP -> Send diagnostic not
- * supported, SG_LIB_CAT_ILLEGAL_REQ -> bad field in cdb,
- * SG_LIB_CAT_NOT_READY, SG_LIB_CAT_UNIT_ATTENTION,
+ * supported, SG_LIB_CAT_ILLEGAL_REQ -> bad field in cdb,
+ * SG_LIB_CAT_NOT_READY, SG_LIB_CAT_UNIT_ATTENTION,
* SG_LIB_CAT_ABORTED_COMMAND, -1 -> other failures */
static int
do_senddiag(int sg_fd, int pf_bit, void * outgoing_pg, int outgoing_len,
@@ -409,7 +409,7 @@ truncated:
}
/* Returns number of elements written to 'tdhp' or -1 if there is
- a problem */
+ a problem */
static int
populate_type_desc_hdr_arr(int fd, struct type_desc_hdr_t * tdhp,
unsigned int * generationp, int verbose)
@@ -639,7 +639,7 @@ print_element_status(const char * pad, const unsigned char * statp, int etype,
case TEMPERATURE_ETC: /* temperature sensor */
if ((! filter) || ((0xc0 & statp[1]) || (0xf & statp[3]))) {
printf("%sIdent=%d, Fail=%d, OT failure=%d, OT warning=%d, "
- "UT failure=%d\n", pad, !!(statp[1] & 0x80),
+ "UT failure=%d\n", pad, !!(statp[1] & 0x80),
!!(statp[1] & 0x40), !!(statp[3] & 0x8),
!!(statp[3] & 0x4), !!(statp[3] & 0x2));
printf("%sUT warning=%d\n", pad, !!(statp[3] & 0x1));
@@ -857,7 +857,7 @@ print_element_status(const char * pad, const unsigned char * statp, int etype,
break;
case SAS_CONNECTOR_ETC:
printf("%sIdent=%d, %s, Connector physical "
- "link=0x%x\n", pad, !!(statp[1] & 0x80),
+ "link=0x%x\n", pad, !!(statp[1] & 0x80),
find_sas_connector_type((statp[1] & 0x7f), buff, sizeof(buff)),
statp[2]);
printf("%sFail=%d\n", pad, !!(statp[3] & 0x40));
@@ -972,7 +972,7 @@ ses_threshold_helper(const char * pad, const unsigned char *tp, int etype,
printf("%s low warning=%s, low critical=%s (in degrees Celsius)\n", pad,
reserved_or_num(b, 128, tp[2] - TEMPERATURE_OFFSET,
-TEMPERATURE_OFFSET),
- reserved_or_num(b2, 128, tp[3] - TEMPERATURE_OFFSET,
+ reserved_or_num(b2, 128, tp[3] - TEMPERATURE_OFFSET,
-TEMPERATURE_OFFSET));
break;
case 0xb: /* UPS */
@@ -1538,7 +1538,7 @@ read_hex(const char * inp, unsigned char * arr, int * arr_len)
}
arr[off + k] = h;
lcp = strpbrk(lcp, " ,\t");
- if (NULL == lcp)
+ if (NULL == lcp)
break;
lcp += strspn(lcp, " ,\t");
if ('\0' == *lcp)
@@ -1634,14 +1634,14 @@ ses_process_status(int sg_fd, int page_code, int do_raw, int do_hex,
dStrHex((const char *)rsp_buff, rsp_len, 0);
} else {
switch (page_code) {
- case DPC_SUPPORTED:
+ case DPC_SUPPORTED:
ses_supported_pages_sdg("Supported diagnostic pages",
rsp_buff, rsp_len);
break;
- case DPC_CONFIGURATION:
+ case DPC_CONFIGURATION:
ses_configuration_sdg(rsp_buff, rsp_len);
break;
- case DPC_ENC_STATUS:
+ case DPC_ENC_STATUS:
res = populate_type_desc_hdr_arr(sg_fd, type_desc_hdr_arr,
&ref_gen_code, verbose);
if (res < 0)
@@ -1649,7 +1649,7 @@ ses_process_status(int sg_fd, int page_code, int do_raw, int do_hex,
ses_enc_status_dp(type_desc_hdr_arr, res, ref_gen_code,
rsp_buff, rsp_len, inner_hex, filter);
break;
- case DPC_HELP_TEXT:
+ case DPC_HELP_TEXT:
printf("Help text diagnostic page (for primary "
"subenclosure):\n");
if (rsp_len > 4)
@@ -1657,7 +1657,7 @@ ses_process_status(int sg_fd, int page_code, int do_raw, int do_hex,
else
printf(" <empty>\n");
break;
- case DPC_STRING:
+ case DPC_STRING:
printf("String In diagnostic page (for primary "
"subenclosure):\n");
if (rsp_len > 4)
@@ -1665,7 +1665,7 @@ ses_process_status(int sg_fd, int page_code, int do_raw, int do_hex,
else
printf(" <empty>\n");
break;
- case DPC_THRESHOLD:
+ case DPC_THRESHOLD:
res = populate_type_desc_hdr_arr(sg_fd, type_desc_hdr_arr,
&ref_gen_code, verbose);
if (res < 0)
@@ -1673,7 +1673,7 @@ ses_process_status(int sg_fd, int page_code, int do_raw, int do_hex,
ses_threshold_sdg(type_desc_hdr_arr, res, ref_gen_code,
rsp_buff, rsp_len, inner_hex, verbose);
break;
- case DPC_ELEM_DESC:
+ case DPC_ELEM_DESC:
res = populate_type_desc_hdr_arr(sg_fd, type_desc_hdr_arr,
&ref_gen_code, verbose);
if (res < 0)
@@ -1681,16 +1681,16 @@ ses_process_status(int sg_fd, int page_code, int do_raw, int do_hex,
ses_element_desc_sdg(type_desc_hdr_arr, res, ref_gen_code,
rsp_buff, rsp_len);
break;
- case DPC_SHORT_ENC_STATUS:
+ case DPC_SHORT_ENC_STATUS:
printf("Short enclosure status diagnostic page, "
"status=0x%x\n", rsp_buff[1]);
break;
- case DPC_ENC_BUSY:
+ case DPC_ENC_BUSY:
printf("Enclosure busy diagnostic page, "
"busy=%d [vendor specific=0x%x]\n",
rsp_buff[1] & 1, (rsp_buff[1] >> 1) & 0xff);
break;
- case DPC_ADD_ELEM_STATUS:
+ case DPC_ADD_ELEM_STATUS:
res = populate_type_desc_hdr_arr(sg_fd, type_desc_hdr_arr,
&ref_gen_code, verbose);
if (res < 0)
@@ -1698,20 +1698,20 @@ ses_process_status(int sg_fd, int page_code, int do_raw, int do_hex,
ses_additional_elem_sdg(type_desc_hdr_arr, res, ref_gen_code,
rsp_buff, rsp_len, inner_hex);
break;
- case DPC_SUBENC_HELP_TEXT:
+ case DPC_SUBENC_HELP_TEXT:
ses_subenc_help_sdg(rsp_buff, rsp_len);
break;
- case DPC_SUBENC_STRING:
+ case DPC_SUBENC_STRING:
ses_subenc_string_sdg(rsp_buff, rsp_len);
break;
- case DPC_SUPPORTED_SES:
+ case DPC_SUPPORTED_SES:
ses_supported_pages_sdg("Supported SES diagnostic pages",
rsp_buff, rsp_len);
break;
- case DPC_DOWNLOAD_MICROCODE:
+ case DPC_DOWNLOAD_MICROCODE:
ses_download_code_sdg(rsp_buff, rsp_len);
break;
- case DPC_SUBENC_NICKNAME:
+ case DPC_SUBENC_NICKNAME:
ses_subenc_nickname_sdg(rsp_buff, rsp_len);
break;
default:
@@ -1864,7 +1864,7 @@ main(int argc, char * argv[])
const struct diag_page_code * pcdp = &dpc_arr[0];
const struct element_type_t * etp = &element_type_arr[0];
-
+
printf("Known diagnostic pages (followed by page code):\n");
for (k = 0; k < num; ++k, ++pcdp)
printf(" %s [0x%x]\n", pcdp->desc, pcdp->page_code);
diff --git a/src/sg_start.c b/src/sg_start.c
index 9d52a50c..bec9e555 100644
--- a/src/sg_start.c
+++ b/src/sg_start.c
@@ -20,14 +20,14 @@
Start/Stop parameter by Kurt Garloff <garloff at suse dot de>, 6/2000
Sync cache parameter by Kurt Garloff <garloff at suse dot de>, 1/2001
- Guard block device answering sg's ioctls.
+ Guard block device answering sg's ioctls.
<dgilbert at interlog dot com> 12/2002
Convert to SG_IO ioctl so can use sg or block devices in 2.6.* 3/2003
This utility was written for the Linux 2.4 kernel series. It should
now build for the Linux 2.6 kernel series and various other Operating
Systems.
-
+
*/
static char * version_str = "0.57 20080325"; /* sbc3r14; mmc6r01a */
@@ -485,7 +485,7 @@ main(int argc, char * argv[])
else if ((0 == opts.do_loej) && (-1 == opts.do_fl) && (0 == opts.do_pc))
opts.do_start = 1;
/* default action is to start when no other active options */
-
+
if (0 == opts.device_name) {
fprintf(stderr, "No DEVICE argument given\n");
if (opts.opt_new)
@@ -507,7 +507,7 @@ main(int argc, char * argv[])
return SG_LIB_SYNTAX_ERROR;
}
}
-
+
fd = sg_cmds_open_device(opts.device_name, 0 /* rw */, opts.do_verbose);
if (fd < 0) {
fprintf(stderr, "Error trying to open %s: %s\n",
diff --git a/src/sg_stpg.c b/src/sg_stpg.c
index 77f8679d..72fc35ac 100644
--- a/src/sg_stpg.c
+++ b/src/sg_stpg.c
@@ -276,7 +276,7 @@ encode_tpgs_states(unsigned char *buff, struct tgtgrp *tgtState, int numgrp)
desc[2] = (tgtState[i].id >> 8) & 0x0f;
desc[3] = tgtState[i].id & 0x0f;
}
-}
+}
/* Read numbers (up to 32 bits in size) from command line (comma separated */
/* list). Assumed decimal unless prefixed by '0x', '0X' or contains */
@@ -356,9 +356,9 @@ build_state_arr(const char * inp, int * state_arr, int * state_arr_len,
try_num = 0;
switch (toupper(*lcp)) {
case 'A':
- if ('N' == toupper(*(lcp + 1)))
+ if ('N' == toupper(*(lcp + 1)))
state_arr[k] = 1;
- else if ('O' == toupper(*(lcp + 1)))
+ else if ('O' == toupper(*(lcp + 1)))
state_arr[k] = 0;
else
try_num = 1;
@@ -598,7 +598,7 @@ main(int argc, char * argv[])
ret = res;
if (0 == res) {
report_len = (reportTgtGrpBuff[0] << 24) +
- (reportTgtGrpBuff[1] << 16) +
+ (reportTgtGrpBuff[1] << 16) +
(reportTgtGrpBuff[2] << 8) +
reportTgtGrpBuff[3] + 4;
if (report_len > (int)sizeof(reportTgtGrpBuff)) {
@@ -633,7 +633,7 @@ main(int argc, char * argv[])
tgtStatePtr->id = (ucp[2] << 8) + ucp[3];
tgtStatePtr->current = ucp[0] & 0x0f;
tgtStatePtr->valid = ucp[1];
-
+
tgt_port_count = ucp[7];
tgtStatePtr++;
diff --git a/src/sg_test_rwbuf.c b/src/sg_test_rwbuf.c
index cba502fc..031d579f 100644
--- a/src/sg_test_rwbuf.c
+++ b/src/sg_test_rwbuf.c
@@ -1,21 +1,21 @@
/* sg_test_rwbuf.c */
/*
- * Program to test the SCSI host adapter by issueing
+ * Program to test the SCSI host adapter by issueing
* write and read operations on a device's buffer
* and calculating checksums.
- * NOTE: If you can not reserve the buffer of the device
+ * NOTE: If you can not reserve the buffer of the device
* for this purpose (SG_GET_RESERVED_SIZE), you risk
* serious data corruption, if the device is accessed by
* somebody else in the meantime.
* (c) 2000 Kurt Garloff <garloff at suse dot de>
* heavily based on Doug Gilbert's sg_rbuf program.
* (c) 1999-2008 Doug Gilbert
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* $Id: sg_test_rwbuf.c,v 1.1 2000/03/02 13:50:03 garloff Exp $
*
* 2003/11/11 switch sg3_utils version to use SG_IO ioctl [dpg]
@@ -44,11 +44,11 @@ static char * version_str = "1.07 20080318";
#define BPI (signed)(sizeof(int))
#define RB_MODE_DESC 3
-#define RWB_MODE_DATA 2
+#define RWB_MODE_DATA 2
#define RB_DESC_LEN 4
/* The microcode in a SCSI device is _not_ modified by doing a WRITE BUFFER
- * with mode set to "data" (0x2) as done by this utility. Therefore this
+ * with mode set to "data" (0x2) as done by this utility. Therefore this
* utility is safe in that respect. [Mode values 0x4, 0x5, 0x6 and 0x7 are
* the dangerous ones :-)]
*/
@@ -62,7 +62,7 @@ static unsigned char *cmpbuf = NULL;
/* Options */
-static int size = -1;
+static int size = -1;
static char do_quick = 0;
static int addwrite = 0;
static int addread = 0;
@@ -124,10 +124,10 @@ int find_out_about_buffer (int sg_fd)
sg_chk_n_print3("READ BUFFER descriptor error", &io_hdr, 1);
return res;
}
-
+
buf_capacity = ((rbBuff[1] << 16) | (rbBuff[2] << 8) | rbBuff[3]);
buf_granul = (unsigned char)rbBuff[0];
-#if 0
+#if 0
printf("READ BUFFER reports: %02x %02x %02x %02x\n",
rbBuff[0], rbBuff[1], rbBuff[2], rbBuff[3]);
#endif
@@ -179,22 +179,22 @@ int do_checksum (int *buf, int len, int quiet)
void do_fill_buffer (int *buf, int len)
{
- int sum;
+ int sum;
int i; int rln = len;
srand (time (0));
retry:
- if (len >= BPI)
+ if (len >= BPI)
base = 0x12345678 + rand ();
- else
+ else
base = 0x12345678 + (char) rand ();
sum = base;
for (i = 0; i < len/BPI - 1; i++)
{
/* we rely on rand() giving full range of int */
- buf[i] = rand ();
+ buf[i] = rand ();
sum += buf[i];
}
- while (rln%BPI)
+ while (rln%BPI)
{
((char*)buf)[--rln] = rand ();
sum += ((char*)buf)[rln];
@@ -472,7 +472,7 @@ int main (int argc, char * argv[])
usage();
return SG_LIB_SYNTAX_ERROR;
}
-
+
sg_fd = open(device_name, O_RDWR | O_NONBLOCK);
if (sg_fd < 0) {
perror("sg_test_rwbuf: open error");
@@ -493,7 +493,7 @@ int main (int argc, char * argv[])
ret = SG_LIB_CAT_OTHER;
goto err_out;
}
-
+
cmpbuf = (unsigned char *)malloc(size);
for (k = 0; k < times; ++k) {
ret = write_buffer (sg_fd, size);
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index 641a0022..d8343a8e 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -267,7 +267,7 @@ static void
dStrRaw(const char * str, int len)
{
int k;
-
+
for (k = 0 ; k < len; ++k)
printf("%c", str[k]);
}
@@ -316,7 +316,7 @@ decode_id_vpd(unsigned char * buff, int len, int subvalue, int do_long,
VPD_ASSOC_TDEVICE, m_d, m_cs, do_long, do_quiet);
}
}
-
+
static const char * network_service_type_arr[] =
{
"unspecified",
@@ -352,7 +352,7 @@ decode_net_man_vpd(unsigned char * buff, int len, int do_hex)
len -= 4;
ucp = buff + 4;
for (k = 0; k < len; k += bump, ucp += bump) {
- printf(" %s, Service type: %s\n",
+ printf(" %s, Service type: %s\n",
assoc_arr[(ucp[0] >> 5) & 0x3],
network_service_type_arr[ucp[0] & 0x1f]);
na_len = (ucp[2] << 8) + ucp[3];
@@ -371,7 +371,7 @@ decode_net_man_vpd(unsigned char * buff, int len, int do_hex)
}
}
}
-
+
static const char * mode_page_policy_arr[] =
{
"shared",
@@ -472,7 +472,7 @@ decode_scsi_ports_vpd(unsigned char * buff, int len, int do_hex, int do_long,
bump += tpd_len + 4;
}
}
-
+
static const char * code_set_arr[] =
{
"Reserved [0x0]",
@@ -812,7 +812,7 @@ decode_dev_ids(const char * print_if_found, unsigned char * buff, int len,
dStrHex((const char *)ip, i_len, 0);
break;
}
- c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
+ c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
(ip[2] << 4) | ((ip[3] & 0xf0) >> 4));
vsei = ip[3] & 0xf;
for (m = 1; m < 5; ++m) {
@@ -840,7 +840,7 @@ decode_dev_ids(const char * print_if_found, unsigned char * buff, int len,
dStrHex((const char *)ip, i_len, 0);
break;
}
- c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
+ c_id = (((ip[0] & 0xf) << 20) | (ip[1] << 12) |
(ip[2] << 4) | ((ip[3] & 0xf0) >> 4));
vsei = ip[3] & 0xf;
for (m = 1; m < 5; ++m) {
@@ -957,7 +957,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
switch (proto_id) {
case TPROTO_FCP: /* Fibre channel */
printf("%s FCP-2 World Wide Name:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 8, 0);
@@ -966,7 +966,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
case TPROTO_SPI: /* Scsi Parallel Interface */
printf("%s Parallel SCSI initiator SCSI address: 0x%x\n",
leadin, ((ucp[2] << 8) | ucp[3]));
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
printf("%s relative port number (of corresponding target): "
@@ -981,7 +981,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
break;
case TPROTO_1394: /* IEEE 1394 */
printf("%s IEEE 1394 EUI-64 name:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 8, 0);
@@ -989,7 +989,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
break;
case TPROTO_SRP:
printf("%s RDMA initiator port identifier:\n", leadin);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
dStrHex((const char *)&ucp[8], 16, 0);
@@ -1016,7 +1016,7 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len)
ull |= ucp[4 + j];
}
printf("%s SAS address: 0x%" PRIx64 "\n", leadin, ull);
- if (0 != format_code)
+ if (0 != format_code)
printf("%s [Unexpected format code: %d]\n", leadin,
format_code);
bump = 24;
@@ -1467,7 +1467,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
num = rsp_buff[3];
if (num > (len - 4))
@@ -1524,7 +1524,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
memset(obuff, 0, sizeof(obuff));
len -= 4;
@@ -1575,7 +1575,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_id_vpd(rsp_buff, len, subvalue, do_long, do_quiet);
}
@@ -1619,7 +1619,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_softw_inf_id(rsp_buff, len, do_hex);
}
@@ -1702,7 +1702,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_x_inq_vpd(rsp_buff, len, do_hex);
}
@@ -1746,7 +1746,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_mode_policy_vpd(rsp_buff, len, do_hex);
}
@@ -1790,7 +1790,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_scsi_ports_vpd(rsp_buff, len, do_hex, do_long, do_quiet);
}
@@ -1837,7 +1837,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_ata_info_vpd(rsp_buff, len, do_long, do_hex);
}
@@ -1881,7 +1881,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_proto_lu_vpd(rsp_buff, len, do_hex);
}
@@ -1925,7 +1925,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_proto_port_vpd(rsp_buff, len, do_hex);
}
@@ -1985,7 +1985,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_b0_vpd(rsp_buff, len, do_hex, pdt);
}
@@ -2050,7 +2050,7 @@ svpd_decode_standard(int sg_fd, int num_vpd, int subvalue, int maxlen,
pdt = rsp_buff[0] & 0x1f;
if (verbose || do_long)
printf(" [PQual=%d Peripheral device type: %s]\n",
- (rsp_buff[0] & 0xe0) >> 5,
+ (rsp_buff[0] & 0xe0) >> 5,
sg_get_pdt_str(pdt, sizeof(buff), buff));
decode_b1_vpd(rsp_buff, len, do_hex, pdt);
}
diff --git a/src/sg_vpd_vendor.c b/src/sg_vpd_vendor.c
index 20c179d2..77f8c9e2 100644
--- a/src/sg_vpd_vendor.c
+++ b/src/sg_vpd_vendor.c
@@ -90,7 +90,7 @@ struct svpd_values_name_t {
/* Size of this array must match the array of the same name in sg_vpd.c */
-static unsigned char rsp_buff[MX_ALLOC_LEN + 2];
+static unsigned char rsp_buff[MX_ALLOC_LEN + 2];
/* Supported vendor specific VPD pages */
@@ -166,7 +166,7 @@ static void
dStrRaw(const char* str, int len)
{
int k;
-
+
for (k = 0 ; k < len; ++k)
printf("%c", str[k]);
}
diff --git a/src/sg_write_long.c b/src/sg_write_long.c
index ff9008dc..fa3f2e6a 100644
--- a/src/sg_write_long.c
+++ b/src/sg_write_long.c
@@ -22,7 +22,7 @@
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- This program issues the SCSI command WRITE LONG to a given SCSI device.
+ This program issues the SCSI command WRITE LONG to a given SCSI device.
It sends the command with the logical block address passed as the lba
argument, and the transfer length set to the xfer_len argument. the
buffer to be writen to the device filled with 0xff, this buffer includes
@@ -105,7 +105,7 @@ int main(int argc, char * argv[])
char ebuff[EBUFF_SZ];
const char * ten_or;
int ret = 1;
-
+
memset(file_name, 0, sizeof file_name);
while (1) {
int option_index = 0;
@@ -195,7 +195,7 @@ int main(int argc, char * argv[])
safe_strerror(-sg_fd));
return SG_LIB_FILE_ERROR;
}
-
+
if (wr_uncor) {
if ('\0' != file_name[0])
fprintf(stderr, ">>> warning: when '--wr_uncor' given "
diff --git a/src/sginfo.c b/src/sginfo.c
index b7fc6347..7a6c6d4a 100644
--- a/src/sginfo.c
+++ b/src/sginfo.c
@@ -33,7 +33,7 @@
* -V access Verify Error Recovery Page.
* -T trace commands (for debugging, double for more debug)
* -z do a single fetch for mode pages (rather than double fetch)
- *
+ *
* Only one of the following three options can be specified.
* None of these three implies the current values are returned.
* -m Display modifiable fields instead of current values
@@ -60,13 +60,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * Michael Weller (eowmob at exp-math dot uni-essen dot de)
+ * Michael Weller (eowmob at exp-math dot uni-essen dot de)
* 11/23/94 massive extensions from 1.4a
* 08/23/97 fix problems with defect lists
*
- * Douglas Gilbert (dgilbert at interlog dot com)
+ * Douglas Gilbert (dgilbert at interlog dot com)
* 990628 port to sg .... (version 1.81)
* up 4KB limit on defect list to 32KB
* 'sginfo -l' also shows sg devices and mapping to other
@@ -86,21 +86,21 @@
* cleaned parameter parsing a bit (it's still a terrible mess!)
* Use sr (instead of scd) and sg%d (instead of sga,b,...) in -l
* and support much more devs in -l (incl. nosst)
- * Fix segfault in defect list (len=0xffff) and adapt formatting
+ * Fix segfault in defect list (len=0xffff) and adapt formatting
* to large disks. Support up to 256kB defect lists with
- * 0xB7 (12byte) command if necessary and fallback to 0x37
+ * 0xB7 (12byte) command if necessary and fallback to 0x37
* (10byte) in case of failure. Report truncation.
- * sizeof(buffer) (which is sizeof(char*) == 4 or 32 bit archs)
+ * sizeof(buffer) (which is sizeof(char*) == 4 or 32 bit archs)
* was used incorrectly all over the place. Fixed.
* [version 1.95]
- * Douglas Gilbert (dgilbert at interlog dot com)
+ * Douglas Gilbert (dgilbert at interlog dot com)
* 20020113 snprintf() type cleanup [version 1.96]
* 20021211 correct sginfo MODE_SELECT, protect against block devices
* that answer sg's ioctls. [version 1.97]
* 20021228 scan for some "scd<n>" as well as "sr<n>" device names [1.98]
* 20021020 Update control page [1.99]
*
- * Thomas Steudten (thomas at steudten dot com)
+ * Thomas Steudten (thomas at steudten dot com)
* 20040521 add -Fhead feature [version 2.04]
*
* Tim Hunt (tim at timhunt dot net)
@@ -148,7 +148,7 @@ static char *device_name;
#define INQUIRY_RESP_INITIAL_LEN 36
-#define MAX_HEADS 127
+#define MAX_HEADS 127
#define HEAD_SORT_TOKEN 0x55
#define SIZEOF_BUFFER (16*1024)
@@ -179,24 +179,24 @@ struct mpage_info {
};
/* declarations of functions decoding known mode pages */
-static int common_disconnect_reconnect(struct mpage_info * mpi,
+static int common_disconnect_reconnect(struct mpage_info * mpi,
const char * prefix);
static int common_control(struct mpage_info * mpi, const char * prefix);
-static int common_control_extension(struct mpage_info * mpi,
+static int common_control_extension(struct mpage_info * mpi,
const char * prefix);
static int common_proto_spec_lu(struct mpage_info * mpi, const char * prefix);
-static int common_proto_spec_port(struct mpage_info * mpi,
+static int common_proto_spec_port(struct mpage_info * mpi,
const char * prefix);
-static int common_proto_spec_port_sp1(struct mpage_info * mpi,
+static int common_proto_spec_port_sp1(struct mpage_info * mpi,
const char * prefix);
-static int common_proto_spec_port_sp2(struct mpage_info * mpi,
+static int common_proto_spec_port_sp2(struct mpage_info * mpi,
const char * prefix);
-static int common_power_condition(struct mpage_info * mpi,
+static int common_power_condition(struct mpage_info * mpi,
const char * prefix);
static int common_informational(struct mpage_info * mpi, const char * prefix);
static int disk_error_recovery(struct mpage_info * mpi, const char * prefix);
static int disk_format(struct mpage_info * mpi, const char * prefix);
-static int disk_verify_error_recovery(struct mpage_info * mpi,
+static int disk_verify_error_recovery(struct mpage_info * mpi,
const char * prefix);
static int disk_geometry(struct mpage_info * mpi, const char * prefix);
static int disk_notch_parameters(struct mpage_info * mpi, const char * prefix);
@@ -246,20 +246,20 @@ static struct mpage_name_func mpage_common[] =
{ 0x16, 0, PC_COMMON, "Extended, device-type specific", NULL},
{ 0x18, 0, PC_COMMON, "Protocol specific lu", common_proto_spec_lu},
{ 0x19, 0, PC_COMMON, "Protocol specific port", common_proto_spec_port},
- { 0x19, 1, PC_COMMON, "Protocol specific port, subpage 1 overload",
+ { 0x19, 1, PC_COMMON, "Protocol specific port, subpage 1 overload",
common_proto_spec_port_sp1},
- { 0x19, 2, PC_COMMON, "Protocol specific port, subpage 2 overload",
+ { 0x19, 2, PC_COMMON, "Protocol specific port, subpage 2 overload",
common_proto_spec_port_sp2},
-/* { 0x19, 2, PC_COMMON, "SPI-4 Saved Training configuration",
+/* { 0x19, 2, PC_COMMON, "SPI-4 Saved Training configuration",
spi4_training_config}, */
{ 0x19, 3, PC_COMMON, "SPI-4 Negotiated Settings", spi4_negotiated},
- { 0x19, 4, PC_COMMON, "SPI-4 Report transfer capabilities",
+ { 0x19, 4, PC_COMMON, "SPI-4 Report transfer capabilities",
spi4_report_xfer},
{ 0x1a, 0, PC_COMMON, "Power Condition", common_power_condition},
{ 0x1c, 0, PC_COMMON, "Informational Exceptions", common_informational},
{ MP_LIST_PAGES, 0, PC_COMMON, "Return all pages", NULL},
};
-static const int mpage_common_len = sizeof(mpage_common) /
+static const int mpage_common_len = sizeof(mpage_common) /
sizeof(mpage_common[0]);
static struct mpage_name_func mpage_disk[] =
@@ -281,7 +281,7 @@ static const int mpage_disk_len = sizeof(mpage_disk) / sizeof(mpage_disk[0]);
static struct mpage_name_func mpage_cdvd[] =
{
- { 1, 0, PC_CDVD, "Read-Write Error Recovery (cdvd)",
+ { 1, 0, PC_CDVD, "Read-Write Error Recovery (cdvd)",
cdvd_error_recovery},
{ 3, 0, PC_CDVD, "MRW", cdvd_mrw},
{ 5, 0, PC_CDVD, "Write parameters", cdvd_write_param},
@@ -290,7 +290,7 @@ static struct mpage_name_func mpage_cdvd[] =
{ 0xe, 0, PC_CDVD, "CD audio control", cdvd_audio_control},
{ 0x18, 0, PC_CDVD, "Feature set support & version", cdvd_feature},
{ 0x1a, 0, PC_CDVD, "Power Condition", common_power_condition},
- { 0x1c, 0, PC_CDVD, "Fault/failure reporting control",
+ { 0x1c, 0, PC_CDVD, "Fault/failure reporting control",
common_informational},
{ 0x1d, 0, PC_CDVD, "Time-out & protect", cdvd_timeout},
{ 0x2a, 0, PC_CDVD, "MM capabilities & mechanical status", cdvd_mm_capab},
@@ -445,7 +445,7 @@ static int do_scsi_io(struct scsi_cmnd_io * sio)
}
}
-struct mpage_name_func * get_mpage_info(int page_no, int subpage_no,
+struct mpage_name_func * get_mpage_info(int page_no, int subpage_no,
struct mpage_name_func * mpp, int elems)
{
int k;
@@ -546,11 +546,11 @@ static char * get_page_name(struct mpage_info * mpi)
mpf = get_mpage_name_func(mpi);
if ((NULL == mpf) || (NULL == mpf->name)) {
if (mpi->subpage)
- snprintf(unkn_page_str, sizeof(unkn_page_str),
- "page number=0x%x, subpage number=0x%x",
+ snprintf(unkn_page_str, sizeof(unkn_page_str),
+ "page number=0x%x, subpage number=0x%x",
mpi->page, mpi->subpage);
else
- snprintf(unkn_page_str, sizeof(unkn_page_str),
+ snprintf(unkn_page_str, sizeof(unkn_page_str),
"page number=0x%x", mpi->page);
return unkn_page_str;
}
@@ -604,7 +604,7 @@ static int64_t getnbyte_ll(const unsigned char *pnt, int nbyte)
return result;
}
-static int putnbyte(unsigned char *pnt, unsigned int value,
+static int putnbyte(unsigned char *pnt, unsigned int value,
unsigned int nbyte)
{
int i;
@@ -649,7 +649,7 @@ static void bitfield(unsigned char *pageaddr, char * text, int mask, int shift)
}
#if 0
-static void notbitfield(unsigned char *pageaddr, char * text, int mask,
+static void notbitfield(unsigned char *pageaddr, char * text, int mask,
int shift)
{
if (modifiable) {
@@ -695,12 +695,12 @@ static void hexdatafield(unsigned char * pageaddr, int nbytes, char * text)
unsigned char *ptr;
unsigned tmp;
- /* Though in main we ensured that a @string has the right format,
+ /* Though in main we ensured that a @string has the right format,
we have to check that we are working on a @ hexdata field */
check_parm_type(1);
- ptr = (unsigned char *) (unsigned long)
+ ptr = (unsigned char *) (unsigned long)
(replacement_values[next_parameter++]);
ptr++; /* Skip @ */
@@ -758,7 +758,7 @@ static int modePageOffset(const unsigned char * resp, int len, int modese_6)
resp_len = (resp[0] << 8) + resp[1] + 2;
bd_len = (resp[6] << 8) + resp[7];
/* LongLBA doesn't change this calculation */
- offset = bd_len + MPHEADER10_LEN;
+ offset = bd_len + MPHEADER10_LEN;
}
if ((offset + 2) > len) {
printf("modePageOffset: raw_curr too small, offset=%d "
@@ -787,7 +787,7 @@ static int get_mode_page6(struct mpage_info * mpi, int dbd,
cmd[1] = 0x00 | (dbd ? 0x8 : 0); /* disable block descriptors bit */
cmd[2] = (mpi->page_control << 6) | mpi->page;
cmd[3] = mpi->subpage; /* subpage code */
- cmd[4] = initial_len;
+ cmd[4] = initial_len;
cmd[5] = 0x00; /* control */
sci.cmnd = cmd;
@@ -799,7 +799,7 @@ static int get_mode_page6(struct mpage_info * mpi, int dbd,
if (status) {
if (mpi->subpage)
fprintf(stdout, ">>> Unable to read %s mode page 0x%x, subpage "
- "0x%x [mode_sense_6]\n", get_page_name(mpi), mpi->page,
+ "0x%x [mode_sense_6]\n", get_page_name(mpi), mpi->page,
mpi->subpage);
else
fprintf(stdout, ">>> Unable to read %s mode page (0x%x) "
@@ -828,7 +828,7 @@ static int get_mode_page6(struct mpage_info * mpi, int dbd,
if (status) {
if (mpi->subpage)
fprintf(stdout, ">>> Unable to read %s mode page 0x%x, subpage "
- "0x%x [mode_sense_6]\n", get_page_name(mpi), mpi->page,
+ "0x%x [mode_sense_6]\n", get_page_name(mpi), mpi->page,
mpi->subpage);
else
fprintf(stdout, ">>> Unable to read %s mode page (0x%x) "
@@ -844,7 +844,7 @@ static int get_mode_page6(struct mpage_info * mpi, int dbd,
}
/* Reads mode (sub-)page via 10 byte MODE SENSE, returns 0 if ok */
-static int get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd,
+static int get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd,
unsigned char * resp, int sngl_fetch)
{
int status, off;
@@ -854,7 +854,7 @@ static int get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd,
memset(resp, 0, 4);
cmd[0] = SMODE_SENSE_10; /* MODE SENSE (10) */
- cmd[1] = 0x00 | (llbaa ? 0x10 : 0) | (dbd ? 0x8 : 0);
+ cmd[1] = 0x00 | (llbaa ? 0x10 : 0) | (dbd ? 0x8 : 0);
cmd[2] = (mpi->page_control << 6) | mpi->page;
cmd[3] = mpi->subpage;
cmd[4] = 0x00; /* (reserved) */
@@ -873,7 +873,7 @@ static int get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd,
if (status) {
if (mpi->subpage)
fprintf(stdout, ">>> Unable to read %s mode page 0x%x, subpage "
- "0x%x [mode_sense_10]\n", get_page_name(mpi), mpi->page,
+ "0x%x [mode_sense_10]\n", get_page_name(mpi), mpi->page,
mpi->subpage);
else
fprintf(stdout, ">>> Unable to read %s mode page (0x%x) "
@@ -892,8 +892,8 @@ static int get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd,
return status;
}
- cmd[7] = (mpi->resp_len >> 8) & 0xff;
- cmd[8] = (mpi->resp_len & 0xff);
+ cmd[7] = (mpi->resp_len >> 8) & 0xff;
+ cmd[8] = (mpi->resp_len & 0xff);
sci.cmnd = cmd;
sci.cmnd_len = sizeof(cmd);
sci.dxfer_dir = DXFER_FROM_DEVICE;
@@ -903,7 +903,7 @@ static int get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd,
if (status) {
if (mpi->subpage)
fprintf(stdout, ">>> Unable to read %s mode page 0x%x, subpage "
- "0x%x [mode_sense_10]\n", get_page_name(mpi), mpi->page,
+ "0x%x [mode_sense_10]\n", get_page_name(mpi), mpi->page,
mpi->subpage);
else
fprintf(stdout, ">>> Unable to read %s mode page (0x%x) "
@@ -918,15 +918,15 @@ static int get_mode_page10(struct mpage_info * mpi, int llbaa, int dbd,
return status;
}
-static int get_mode_page(struct mpage_info * mpi, int dbd,
+static int get_mode_page(struct mpage_info * mpi, int dbd,
unsigned char * resp)
{
int res;
if (mode6byte)
- res = get_mode_page6(mpi, dbd, resp, single_fetch);
+ res = get_mode_page6(mpi, dbd, resp, single_fetch);
else
- res = get_mode_page10(mpi, 0, dbd, resp, single_fetch);
+ res = get_mode_page10(mpi, 0, dbd, resp, single_fetch);
if (UNKNOWN_OPCODE == res)
fprintf(stdout, ">>>>> Try command again with%s '-6' "
"argument\n", (mode6byte ? "out the" : " a"));
@@ -944,7 +944,7 @@ static int get_mode_page(struct mpage_info * mpi, int dbd,
/* Contents should point to the mode parameter header that we obtained
in a prior read operation. This way we do not have to work out the
format of the beast. Assume 0 or 1 block descriptors. */
-static int put_mode_page6(struct mpage_info * mpi,
+static int put_mode_page6(struct mpage_info * mpi,
const unsigned char * msense6_resp, int sp_bit)
{
int status;
@@ -959,7 +959,7 @@ static int put_mode_page6(struct mpage_info * mpi,
cmd[1] = 0x10 | (sp_bit ? 1 : 0); /* always set PF bit */
cmd[2] = 0x00;
cmd[3] = 0x00; /* (reserved) */
- cmd[4] = resplen; /* parameter list length */
+ cmd[4] = resplen; /* parameter list length */
cmd[5] = 0x00; /* (reserved) */
memcpy(cbuffer1, msense6_resp, resplen);
@@ -987,7 +987,7 @@ static int put_mode_page6(struct mpage_info * mpi,
if (status) {
if (mpi->subpage)
fprintf(stdout, ">>> Unable to store %s mode page 0x%x,"
- " subpage 0x%x [msel_6]\n", get_page_name(mpi),
+ " subpage 0x%x [msel_6]\n", get_page_name(mpi),
mpi->page, mpi->subpage);
else
fprintf(stdout, ">>> Unable to store %s mode page 0x%x [msel_6]\n",
@@ -999,7 +999,7 @@ static int put_mode_page6(struct mpage_info * mpi,
/* Contents should point to the mode parameter header that we obtained
in a prior read operation. This way we do not have to work out the
format of the beast. Assume 0 or 1 block descriptors. */
-static int put_mode_page10(struct mpage_info * mpi,
+static int put_mode_page10(struct mpage_info * mpi,
const unsigned char * msense10_resp, int sp_bit)
{
int status;
@@ -1045,7 +1045,7 @@ static int put_mode_page10(struct mpage_info * mpi,
if (status) {
if (mpi->subpage)
fprintf(stdout, ">>> Unable to store %s mode page 0x%x,"
- " subpage 0x%x [msel_10]\n", get_page_name(mpi),
+ " subpage 0x%x [msel_10]\n", get_page_name(mpi),
mpi->page, mpi->subpage);
else
fprintf(stdout, ">>> Unable to store %s mode page 0x%x "
@@ -1054,22 +1054,22 @@ static int put_mode_page10(struct mpage_info * mpi,
return status;
}
-static int put_mode_page(struct mpage_info * mpi,
+static int put_mode_page(struct mpage_info * mpi,
const unsigned char * msense_resp)
{
if (mode6byte)
- return put_mode_page6(mpi, msense_resp, ! negate_sp_bit);
+ return put_mode_page6(mpi, msense_resp, ! negate_sp_bit);
else
- return put_mode_page10(mpi, msense_resp, ! negate_sp_bit);
+ return put_mode_page10(mpi, msense_resp, ! negate_sp_bit);
}
-int setup_mode_page(struct mpage_info * mpi, int nparam,
+int setup_mode_page(struct mpage_info * mpi, int nparam,
unsigned char * buff, unsigned char ** o_pagestart)
{
int status, offset, rem_pglen;
unsigned char * pgp;
-
- status = get_mode_page(mpi, 0, buff);
+
+ status = get_mode_page(mpi, 0, buff);
if (status) {
printf("\n");
return status;
@@ -1083,12 +1083,12 @@ int setup_mode_page(struct mpage_info * mpi, int nparam,
pgp = buff + offset;
*o_pagestart = pgp;
rem_pglen = (0x40 & pgp[0]) ? ((pgp[2] << 8) + pgp[3]) : pgp[1];
-
+
if (x_interface && replace) {
- if ((nparam && (n_replacement_values != nparam)) ||
+ if ((nparam && (n_replacement_values != nparam)) ||
((! nparam) && (n_replacement_values != rem_pglen))) {
fprintf(stdout, "Wrong number of replacement values (%i instead "
- "of %i)\n", n_replacement_values,
+ "of %i)\n", n_replacement_values,
nparam ? nparam : rem_pglen);
return 1;
}
@@ -1117,7 +1117,7 @@ static int get_protocol_id(int port_not_lu, unsigned char * buff,
proto_id = buff[off + (spf ? 5 : 2)] & 0xf;
if (trace_cmd > 0)
printf("Protocol specific %s, protocol_id=%s\n",
- (port_not_lu ? "port" : "lu"),
+ (port_not_lu ? "port" : "lu"),
sg_get_trans_proto_str(proto_id, sizeof(b), b));
if (proto_idp)
*proto_idp = proto_id;
@@ -1422,7 +1422,7 @@ static int disk_notch_parameters(struct mpage_info * mpi, const char * prefix)
if (1 == mpi->page_control) /* modifiable */
printf("0");
else
- printf("0x%8.8x%8.8x", getnbyte(pagestart + 16, 4),
+ printf("0x%8.8x%8.8x", getnbyte(pagestart + 16, 4),
getnbyte(pagestart + 20, 4));
#endif
};
@@ -1468,7 +1468,7 @@ static int read_defect_list(int grown_only)
sorthead = 1;
headsp = (unsigned int *)malloc(sizeof(unsigned int) * MAX_HEADS);
if (headsp == NULL) {
- perror("malloc failed");
+ perror("malloc failed");
return status;
}
memset(headsp,0,sizeof(unsigned int) * MAX_HEADS);
@@ -1484,7 +1484,7 @@ static int read_defect_list(int grown_only)
reallen = -1;
cmd[0] = 0x37; /* READ DEFECT DATA (10) */
- cmd[1] = 0x00;
+ cmd[1] = 0x00;
cmd[2] = (table ? 0x08 : 0x10) | defectformat; /* List, Format */
cmd[3] = 0x00; /* (reserved) */
cmd[4] = 0x00; /* (reserved) */
@@ -1585,7 +1585,7 @@ static int read_defect_list(int grown_only)
len = (bp[4] << 24) + (bp[5] << 16) + (bp[6] << 8) + bp[7];
reallen = len;
}
-
+
if (len > 0) {
k = len + 8; /* length of defect list + header */
if (k > (int)sizeof(cbuffer)) {
@@ -1619,15 +1619,15 @@ static int read_defect_list(int grown_only)
sci.dxfer_len = k;
sci.dxferp = bp;
i = do_scsi_io(&sci);
- if (i)
+ if (i)
goto trytenbyte;
if (trace_cmd > 1) {
printf(" cdb response:\n");
dump(bp, 8);
}
- reallen = (bp[4] << 24) + (bp[5] << 16) + (bp[6] << 8) +
+ reallen = (bp[4] << 24) + (bp[5] << 16) + (bp[6] << 8) +
bp[7];
- if (reallen > len) {
+ if (reallen > len) {
trunc = 1;
}
df = (unsigned char *) (bp + 8);
@@ -1639,7 +1639,7 @@ trytenbyte:
trunc = 1;
}
k = len + 4; /* length of defect list + header */
- if (k > (int)sizeof(cbuffer) && NULL == heapp) {
+ if (k > (int)sizeof(cbuffer) && NULL == heapp) {
heapp = (unsigned char *)malloc(k);
if (heapp != NULL)
bp = heapp;
@@ -1648,7 +1648,7 @@ trytenbyte:
bp = cbuffer;
k = sizeof(cbuffer);
len = k - 4;
- trunc = 1;
+ trunc = 1;
}
cmd[0] = 0x37; /* READ DEFECT DATA (10) */
cmd[1] = 0x00;
@@ -1684,11 +1684,11 @@ trytenbyte:
printf("at least ");
reallen = len;
}
- printf("%d entries (%d bytes) in %s table.\n",
+ printf("%d entries (%d bytes) in %s table.\n",
reallen / ((0 == defect_format) ? 4 : 8), reallen,
table ? "grown (GLIST)" : "primary (manufacturer,PLIST)");
- if (!sorthead)
- printf("Format (%x) is: %s\n", defect_format,
+ if (!sorthead)
+ printf("Format (%x) is: %s\n", defect_format,
formatname(defect_format));
i = 0;
switch (defect_format) {
@@ -1725,7 +1725,7 @@ trytenbyte:
i = 0;
}
else if (!sorthead) printf("|");
- }
+ }
case 0: /* lba (32 bit) */
while (len > 0) {
printf("%10d", getnbyte(df, 4));
@@ -1760,7 +1760,7 @@ trytenbyte:
if (i && !sorthead)
printf("\n");
}
- if (trunc)
+ if (trunc)
printf("[truncated]\n");
}
if (heapp) {
@@ -1858,7 +1858,7 @@ static int disk_format(struct mpage_info * mpi, const char * prefix)
}
-static int disk_verify_error_recovery(struct mpage_info * mpi,
+static int disk_verify_error_recovery(struct mpage_info * mpi,
const char * prefix)
{
int status;
@@ -1890,7 +1890,7 @@ static int disk_verify_error_recovery(struct mpage_info * mpi,
}
#if 0
-static int peripheral_device_page(struct mpage_info * mpi,
+static int peripheral_device_page(struct mpage_info * mpi,
const char * prefix)
{
static char *idents[] =
@@ -1936,12 +1936,12 @@ static int peripheral_device_page(struct mpage_info * mpi,
if (bdlen < 0)
bdlen = 0;
else {
- status = setup_mode_page(mpi, 2, cbuffer, &bdlen,
+ status = setup_mode_page(mpi, 2, cbuffer, &bdlen,
&pagestart);
if (status)
return status;
}
-
+
hexfield(pagestart + 2, 2, "Interface Identifier");
if (!x_interface) {
for (ident = 0; ident < 35; ident++)
@@ -2594,7 +2594,7 @@ static int fcp_proto_spec_port(struct mpage_info * mpi, const char * prefix)
if (prefix[0])
printf("%s", prefix);
if (!x_interface && !replace) {
- printf("%s mode page (0x%x)\n", "Fibre Channel port control",
+ printf("%s mode page (0x%x)\n", "Fibre Channel port control",
mpi->page);
printf("----------------------------------------------------\n");
}
@@ -2696,7 +2696,7 @@ static int spi4_margin_control(struct mpage_info * mpi, const char * prefix)
if (prefix[0])
printf("%s", prefix);
if (!x_interface && !replace) {
- printf("%s mode subpage (0x%x,0x%x)\n", "SPI-4 Margin control",
+ printf("%s mode subpage (0x%x,0x%x)\n", "SPI-4 Margin control",
mpi->page, mpi->subpage);
printf("--------------------------------------------\n");
}
@@ -2714,7 +2714,7 @@ static int spi4_margin_control(struct mpage_info * mpi, const char * prefix)
}
/* Protocol specific mode page for SAS, phy control + discover (subpage 1) */
-static int sas_phy_control_discover(struct mpage_info * mpi,
+static int sas_phy_control_discover(struct mpage_info * mpi,
const char * prefix)
{
int status, off, num_phys, k;
@@ -2768,7 +2768,7 @@ static int sas_phy_control_discover(struct mpage_info * mpi,
}
-static int common_proto_spec_port_sp1(struct mpage_info * mpi,
+static int common_proto_spec_port_sp1(struct mpage_info * mpi,
const char * prefix)
{
int status, proto_id;
@@ -2861,7 +2861,7 @@ static int sas_shared_spec_port(struct mpage_info * mpi, const char * prefix)
return 0;
}
-static int common_proto_spec_port_sp2(struct mpage_info * mpi,
+static int common_proto_spec_port_sp2(struct mpage_info * mpi,
const char * prefix)
{
int status, proto_id;
@@ -2951,12 +2951,12 @@ static void print_hex_page(struct mpage_info * mpi, const char * prefix,
printf("mode page: 0x%02x subpage: 0x%02x [%s]\n",
mpi->page, mpi->subpage, pg_name);
else
- printf("mode page: 0x%02x subpage: 0x%02x\n", mpi->page,
+ printf("mode page: 0x%02x subpage: 0x%02x\n", mpi->page,
mpi->subpage);
printf("------------------------------\n");
} else {
if (pg_name && (unkn_page_str != pg_name))
- printf("mode page: 0x%02x [%s]\n", mpi->page,
+ printf("mode page: 0x%02x [%s]\n", mpi->page,
pg_name);
else
printf("mode page: 0x%02x\n", mpi->page);
@@ -2965,8 +2965,8 @@ static void print_hex_page(struct mpage_info * mpi, const char * prefix,
}
for (k = off; k < len; k++)
{
- char nm[8];
-
+ char nm[8];
+
snprintf(nm, sizeof(nm), "0x%02x", k);
hexdatafield(pagestart + k, 1, nm);
}
@@ -2982,21 +2982,21 @@ static int do_user_page(struct mpage_info * mpi, int decode_in_hex)
char prefix[96];
struct mpage_info local_mp_i;
struct mpage_name_func * mpf;
- int multiple = ((MP_LIST_PAGES == mpi->page) ||
+ int multiple = ((MP_LIST_PAGES == mpi->page) ||
(MP_LIST_SUBPAGES == mpi->subpage));
if (replace && multiple) {
printf("Can't list all (sub)pages and use replace (-R) together\n");
return 1;
}
- status = get_mode_page(mpi, 0, cbuffer2);
+ status = get_mode_page(mpi, 0, cbuffer2);
if (status) {
printf("\n");
return status;
} else {
offset = modePageOffset(cbuffer2, mpi->resp_len, mode6byte);
if (offset < 0) {
- fprintf(stdout, "mode page=0x%x has bad page format\n",
+ fprintf(stdout, "mode page=0x%x has bad page format\n",
mpi->page);
fprintf(stdout, " perhaps '-z' switch may help\n");
return -1;
@@ -3026,7 +3026,7 @@ static int do_user_page(struct mpage_info * mpi, int decode_in_hex)
prefix[0] = '\0';
done = 0;
- if ((! decode_in_hex) && ((mpf = get_mpage_name_func(&local_mp_i))) &&
+ if ((! decode_in_hex) && ((mpf = get_mpage_name_func(&local_mp_i))) &&
mpf->func) {
if (multiple && x_interface && !replace) {
if (local_mp_i.subpage)
@@ -3042,7 +3042,7 @@ static int do_user_page(struct mpage_info * mpi, int decode_in_hex)
done = 1;
status |= res;
}
- }
+ }
if (! done) {
if (x_interface && replace)
return put_mode_page(&local_mp_i, cbuffer2);
@@ -3050,7 +3050,7 @@ static int do_user_page(struct mpage_info * mpi, int decode_in_hex)
if (multiple && x_interface && !replace) {
if (local_mp_i.subpage)
snprintf(prefix, sizeof(prefix), "sginfo -u 0x%x,0x%x"
- " -XR %s ", local_mp_i.page, local_mp_i.subpage,
+ " -XR %s ", local_mp_i.page, local_mp_i.subpage,
device_name);
else
snprintf(prefix, sizeof(prefix), "sginfo -u 0x%x -XR "
@@ -3209,7 +3209,7 @@ static int do_serial_number()
}
pagestart = cbuffer;
-
+
pagelen = 4 + pagestart[3];
cmd[0] = 0x12; /* INQUIRY */
@@ -3347,7 +3347,7 @@ static void show_devices(int raw)
}
err = ioctl(fd, SCSI_IOCTL_GET_IDLUN, &m_idlun);
if (err < 0) {
- snprintf(ebuff, EBUFF_SZ,
+ snprintf(ebuff, EBUFF_SZ,
"SCSI(2) ioctl on %s failed", dev_name);
perror(ebuff);
close(fd);
@@ -3434,7 +3434,7 @@ static void show_devices(int raw)
((m_idlun.mux4 & 0xff) == sg_map_arr[j].target_id) &&
(((m_idlun.mux4 >> 16) & 0xff) == sg_map_arr[j].channel) &&
(((m_idlun.mux4 >> 8) & 0xff) == sg_map_arr[j].lun)) {
- printf("%s [=%s scsi%d ch=%d id=%d lun=%d]\n", name,
+ printf("%s [=%s scsi%d ch=%d id=%d lun=%d]\n", name,
sg_map_arr[j].dev_name, bus,
((m_idlun.mux4 >> 16) & 0xff), m_idlun.mux4 & 0xff,
((m_idlun.mux4 >> 8) & 0xff));
@@ -3442,7 +3442,7 @@ static void show_devices(int raw)
}
}
if (NULL == sg_map_arr[j].dev_name)
- printf("%s [scsi%d ch=%d id=%d lun=%d]\n", name, bus,
+ printf("%s [scsi%d ch=%d id=%d lun=%d]\n", name, bus,
((m_idlun.mux4 >> 16) & 0xff), m_idlun.mux4 & 0xff,
((m_idlun.mux4 >> 8) & 0xff));
close(fd);
@@ -3497,7 +3497,7 @@ static int open_sg_io_dev(char * devname)
return -9999;
}
close(fd);
-
+
for (k = 0; k < MAX_SG_DEVS; k++) {
make_dev_name(name, k, do_numeric);
fd = open(name, O_RDWR | O_NONBLOCK);
@@ -3526,11 +3526,11 @@ static int open_sg_io_dev(char * devname)
close(fd);
fd = -9999;
}
- if ((bus == bbus) &&
+ if ((bus == bbus) &&
((m_idlun.mux4 & 0xff) == (mm_idlun.mux4 & 0xff)) &&
- (((m_idlun.mux4 >> 8) & 0xff) ==
+ (((m_idlun.mux4 >> 8) & 0xff) ==
((mm_idlun.mux4 >> 8) & 0xff)) &&
- (((m_idlun.mux4 >> 16) & 0xff) ==
+ (((m_idlun.mux4 >> 16) & 0xff) ==
((mm_idlun.mux4 >> 16) & 0xff)))
break;
else {
@@ -3600,7 +3600,7 @@ static void usage(char *errtext)
"\t-R Replace parameters - best used with -X (expert use only)\n"
"\t [replacement parameters placed after device on command line]\n\n",
stdout);
- printf("\t sginfo version: %s; See man page for more details.\n",
+ printf("\t sginfo version: %s; See man page for more details.\n",
version_str);
exit(2);
}
@@ -3673,7 +3673,7 @@ int main(int argc, char *argv[])
defectformat = 0x4;
else if (!strcasecmp(optarg, "head"))
defectformat = HEAD_SORT_TOKEN;
- else
+ else
usage("Illegal -F parameter, must be one of logical, "
"physical, index or head");
break;
@@ -3755,7 +3755,7 @@ int main(int argc, char *argv[])
else if (j < 1)
usage("argument following '-u' should be of form "
"<pg>[,<subpg>]");
- if ((mp_i.page < 0) || (mp_i.page > MP_LIST_PAGES) ||
+ if ((mp_i.page < 0) || (mp_i.page > MP_LIST_PAGES) ||
(mp_i.subpage < 0) || (mp_i.subpage > MP_LIST_SUBPAGES))
usage("mode pages range from 0 .. 63, subpages from "
"1 .. 255");
@@ -3786,7 +3786,7 @@ int main(int argc, char *argv[])
usage("-R requires -X");
if (replace && mp_i.page_control)
usage("-R not allowed for -m, -M or -S");
- if (x_interface && replace && ((MP_LIST_PAGES == mp_i.page) ||
+ if (x_interface && replace && ((MP_LIST_PAGES == mp_i.page) ||
(MP_LIST_SUBPAGES == mp_i.subpage)))
usage("-XR can be used only with exactly one page.");
@@ -3810,7 +3810,7 @@ int main(int argc, char *argv[])
/*Ensure that this string contains an even number of hex-digits */
int len = strlen(argv[optind + j] + 1);
- if ((len & 1) || (len != (int)strspn(argv[optind + j] + 1,
+ if ((len & 1) || (len != (int)strspn(argv[optind + j] + 1,
"0123456789ABCDEFabcdef")))
usage("Odd number of chars or non-hex digit in @hexdatafield");
diff --git a/src/sgm_dd.c b/src/sgm_dd.c
index b3afc7f4..465ce47a 100644
--- a/src/sgm_dd.c
+++ b/src/sgm_dd.c
@@ -20,7 +20,7 @@
#include <sys/sysmacros.h>
#include <sys/mman.h>
#include <sys/time.h>
-#include <linux/major.h>
+#include <linux/major.h>
#include <linux/fs.h> /* <sys/mount.h> */
#ifdef HAVE_CONFIG_H
@@ -41,7 +41,7 @@
This program is a specialisation of the Unix "dd" command in which
either the input or the output file is a scsi generic device or a
- raw device. The block size ('bs') is assumed to be 512 if not given.
+ raw device. The block size ('bs') is assumed to be 512 if not given.
This program complains if 'ibs' or 'obs' are given with a value
that differs from 'bs' (or the default 512).
If 'if' is not given or 'if=-' then stdin is assumed. If 'of' is
@@ -99,7 +99,7 @@ static char * version_str = "1.34 20071226 shared_mmap";
#ifndef RAW_MAJOR
#define RAW_MAJOR 255 /*unlikey value */
-#endif
+#endif
#define FT_OTHER 1 /* filetype other than one of following */
#define FT_SG 2 /* filetype is sg char device */
@@ -163,7 +163,7 @@ static void print_stats()
if (0 != dd_count)
fprintf(stderr, " remaining block count=%"PRId64"\n", dd_count);
fprintf(stderr, "%"PRId64"+%d records in\n", in_full - in_partial, in_partial);
- fprintf(stderr, "%"PRId64"+%d records out\n", out_full - out_partial,
+ fprintf(stderr, "%"PRId64"+%d records out\n", out_full - out_partial,
out_partial);
}
@@ -285,7 +285,7 @@ void usage()
"2->IFILE,\n"
" 3->OFILE+IFILE\n"
" if file or device to read from (def: stdin)\n");
- fprintf(stderr,
+ fprintf(stderr,
" iflag comma separated list from: [direct,dpo,dsync,"
"excl,fua,\n"
" null]\n"
@@ -938,7 +938,7 @@ int main(int argc, char * argv[])
if (in_flags.dsync)
flags |= O_SYNC;
if ((infd = open(inf, flags)) < 0) {
- snprintf(ebuff, EBUFF_SZ,
+ snprintf(ebuff, EBUFF_SZ,
ME "could not open %s for sg reading", inf);
perror(ebuff);
return SG_LIB_FILE_ERROR;
@@ -1182,7 +1182,7 @@ int main(int argc, char * argv[])
if (out_num_sect > seek)
out_num_sect -= seek;
#ifdef SG_DEBUG
- fprintf(stderr,
+ fprintf(stderr,
"Start of loop, count=%"PRId64", in_num_sect=%"PRId64", out_num_sect=%"PRId64"\n",
dd_count, in_num_sect, out_num_sect);
#endif
@@ -1238,7 +1238,7 @@ int main(int argc, char * argv[])
if (wrkMmap) {
wrkPos = wrkMmap;
if (! (mmap_shareable && out_flags.smmap && (FT_SG == out_type)))
- mmap_shareable = 0;
+ mmap_shareable = 0;
} else {
if ((FT_RAW == in_type) || (FT_RAW == out_type)) {
wrkBuff = (unsigned char *)malloc(blk_sz * bpt + psz);
@@ -1261,7 +1261,7 @@ int main(int argc, char * argv[])
blocks_per = bpt;
#ifdef SG_DEBUG
- fprintf(stderr, "Start of loop, count=%"PRId64", blocks_per=%d\n",
+ fprintf(stderr, "Start of loop, count=%"PRId64", blocks_per=%d\n",
dd_count, blocks_per);
#endif
if (do_time) {
@@ -1280,7 +1280,7 @@ int main(int argc, char * argv[])
while (dd_count > 0) {
blocks = (dd_count > blocks_per) ? blocks_per : dd_count;
if (FT_SG == in_type) {
- ret = sg_read(infd, wrkPos, blocks, skip, blk_sz, scsi_cdbsz_in,
+ ret = sg_read(infd, wrkPos, blocks, skip, blk_sz, scsi_cdbsz_in,
in_flags.fua, in_flags.dpo, 1);
if ((SG_LIB_CAT_UNIT_ATTENTION == ret) ||
(SG_LIB_CAT_ABORTED_COMMAND == ret)) {
@@ -1407,10 +1407,10 @@ int main(int argc, char * argv[])
}
print_stats();
if (sum_of_resids)
- fprintf(stderr, ">> Non-zero sum of residual counts=%d\n",
+ fprintf(stderr, ">> Non-zero sum of residual counts=%d\n",
sum_of_resids);
if (num_dio_not_done)
- fprintf(stderr, ">> dio requested but _not_ done %d times\n",
+ fprintf(stderr, ">> dio requested but _not_ done %d times\n",
num_dio_not_done);
if ((verbose > 0) && out_flags.smmap && (shared_mm_req > 0)) {
fprintf(stderr, ">> shared_mm_req=%d, shared_mm_done=%d\n",
diff --git a/src/sgp_dd.c b/src/sgp_dd.c
index 572bfd31..ebcb5c9a 100644
--- a/src/sgp_dd.c
+++ b/src/sgp_dd.c
@@ -45,7 +45,7 @@
program complains if 'ibs' or 'obs' are given with some other value
than 'bs'. If 'if' is not given or 'if=-' then stdin is assumed. If
'of' is not given or 'of=-' then stdout assumed.
-
+
A non-standard argument "bpt" (blocks per transfer) is added to control
the maximum number of blocks in each transfer. The default value is 128.
For example if "bs=512" and "bpt=32" then a maximum of 32 blocks (16 KiB
@@ -283,7 +283,7 @@ static char * tsafe_strerror(int code, char * ebp)
ebp[STRERR_BUFF_LEN - 1] = '\0';
return ebp;
}
-
+
/* Following macro from D.R. Butenhof's POSIX threads book:
ISBN 0-201-63392-2 . [Highly recommended book.] */
@@ -558,7 +558,7 @@ static void * read_write_thread(void * v_clp)
status = pthread_mutex_lock(&clp->out_mutex);
if (0 != status) err_exit(status, "lock out_mutex");
if (FT_DEV_NULL != clp->out_type) {
- while ((! clp->out_stop) &&
+ while ((! clp->out_stop) &&
((rep->blk + seek_skip) != clp->out_blk)) {
/* if write would be out of sequence then wait */
pthread_cleanup_push(cleanup_out, (void *)clp);
@@ -635,13 +635,13 @@ static int normal_in_operation(Rq_coll * clp, Rq_elem * rep, int blocks)
if (clp->in_flags.coe) {
memset(rep->buffp, 0, rep->num_blks * rep->bs);
fprintf(stderr, ">> substituted zeros for in blk=%"PRId64" for "
- "%d bytes, %s\n", rep->blk,
- rep->num_blks * rep->bs,
+ "%d bytes, %s\n", rep->blk,
+ rep->num_blks * rep->bs,
tsafe_strerror(errno, strerr_buff));
res = rep->num_blks * clp->bs;
}
else {
- fprintf(stderr, "error in normal read, %s\n",
+ fprintf(stderr, "error in normal read, %s\n",
tsafe_strerror(errno, strerr_buff));
clp->in_stop = 1;
guarded_stop_out(clp);
@@ -679,7 +679,7 @@ static void normal_out_operation(Rq_coll * clp, Rq_elem * rep, int blocks)
if (res < 0) {
if (clp->out_flags.coe) {
fprintf(stderr, ">> ignored error for out blk=%"PRId64" for "
- "%d bytes, %s\n", rep->blk,
+ "%d bytes, %s\n", rep->blk,
rep->num_blks * rep->bs,
tsafe_strerror(errno, strerr_buff));
res = rep->num_blks * clp->bs;
@@ -942,7 +942,7 @@ static int sg_start_io(Rq_elem * rep)
int cdbsz = rep->wr ? rep->cdbsz_out : rep->cdbsz_in;
int res;
- if (sg_build_scsi_cdb(rep->cmd, cdbsz, rep->num_blks, rep->blk,
+ if (sg_build_scsi_cdb(rep->cmd, cdbsz, rep->num_blks, rep->blk,
rep->wr, fua, dpo)) {
fprintf(stderr, ME "bad cdb build, start_blk=%"PRId64", blocks=%d\n",
rep->blk, rep->num_blks);
@@ -1258,7 +1258,7 @@ int main(int argc, char * argv[])
usage();
return 0;
} else if (0 == strncmp(key, "--vers", 6)) {
- fprintf(stderr, ME ": %s\n",
+ fprintf(stderr, ME ": %s\n",
version_str);
return 0;
}
@@ -1445,7 +1445,7 @@ int main(int argc, char * argv[])
if (FT_SG == rcoll.in_type) {
res = scsi_read_capacity(rcoll.infd, &in_num_sect, &in_sect_sz);
if (2 == res) {
- fprintf(stderr,
+ fprintf(stderr,
"Unit attention, media changed(in), continuing\n");
res = scsi_read_capacity(rcoll.infd, &in_num_sect,
&in_sect_sz);
@@ -1480,7 +1480,7 @@ int main(int argc, char * argv[])
if (FT_SG == rcoll.out_type) {
res = scsi_read_capacity(rcoll.outfd, &out_num_sect, &out_sect_sz);
if (2 == res) {
- fprintf(stderr,
+ fprintf(stderr,
"Unit attention, media changed(out), continuing\n");
res = scsi_read_capacity(rcoll.outfd, &out_num_sect,
&out_sect_sz);
@@ -1657,7 +1657,7 @@ int main(int argc, char * argv[])
}
close(fd);
}
- }
+ }
if (rcoll.sum_of_resids)
fprintf(stderr, ">> Non-zero sum of residual counts=%d\n",
rcoll.sum_of_resids);
diff --git a/utils/hxascdmp.c b/utils/hxascdmp.c
index fb636950..a7ba2020 100644
--- a/utils/hxascdmp.c
+++ b/utils/hxascdmp.c
@@ -54,16 +54,16 @@ dStrHex(const char* str, int len, long start)
char buff[MAX_LINE_LENGTH];
long a = start;
const int bpstart = BINARY_START_COL;
- const int cpstart = BINARY_START_COL +
+ const int cpstart = BINARY_START_COL +
((CHARS_PER_HEX_BYTE * bytes_per_line) + 1) + 5;
int cpos = cpstart;
int bpos = bpstart;
int midline_space = (bytes_per_line / 2) + 1;
int i, k, line_length;
-
- if (len <= 0)
+
+ if (len <= 0)
return;
- line_length = BINARY_START_COL +
+ line_length = BINARY_START_COL +
(bytes_per_line * (1 + CHARS_PER_HEX_BYTE)) + 7;
if (line_length >= MAX_LINE_LENGTH) {
fprintf(stderr, "bytes_per_line causes maximum line length of %d "
@@ -112,10 +112,10 @@ dStrHexOnly(const char* str, int len, long start)
int bpos = bpstart;
int midline_space = (bytes_per_line / 2) + 1;
int i, k, line_length;
-
- if (len <= 0)
+
+ if (len <= 0)
return;
- line_length = BINARY_START_COL +
+ line_length = BINARY_START_COL +
(bytes_per_line * CHARS_PER_HEX_BYTE) + 4;
if (line_length >= MAX_LINE_LENGTH) {
fprintf(stderr, "bytes_per_line causes maximum line length of %d "
@@ -228,7 +228,7 @@ main(int argc, const char ** argv)
ret = 1;
} else {
start = 0;
- printf("%shex dump of file: %s\n",
+ printf("%shex dump of file: %s\n",
(doHex ? "" : "ASCII "), argv[k]);
while ((res = read(inFile, buff, num)) > 0) {
if (doHex)