[Midnightbsd-cvs] src [8424] trunk/sbin/camcontrol: fix warnings
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Sep 18 17:10:06 EDT 2016
Revision: 8424
http://svnweb.midnightbsd.org/src/?rev=8424
Author: laffer1
Date: 2016-09-18 17:10:06 -0400 (Sun, 18 Sep 2016)
Log Message:
-----------
fix warnings
Modified Paths:
--------------
trunk/sbin/camcontrol/camcontrol.c
trunk/sbin/camcontrol/camcontrol.h
trunk/sbin/camcontrol/fwdownload.c
trunk/sbin/camcontrol/modeedit.c
Modified: trunk/sbin/camcontrol/camcontrol.c
===================================================================
--- trunk/sbin/camcontrol/camcontrol.c 2016-09-18 21:09:47 UTC (rev 8423)
+++ trunk/sbin/camcontrol/camcontrol.c 2016-09-18 21:10:06 UTC (rev 8424)
@@ -5782,9 +5782,10 @@
#endif /* MINIMALISTIC */
void
-usage(int verbose)
+usage(int printlong)
{
- fprintf(verbose ? stdout : stderr,
+
+ fprintf(printlong ? stdout : stderr,
"usage: camcontrol <command> [device id][generic args][command args]\n"
" camcontrol devlist [-v]\n"
#ifndef MINIMALISTIC
@@ -5833,7 +5834,7 @@
" camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n"
#endif /* MINIMALISTIC */
" camcontrol help\n");
- if (!verbose)
+ if (!printlong)
return;
#ifndef MINIMALISTIC
fprintf(stdout,
Modified: trunk/sbin/camcontrol/camcontrol.h
===================================================================
--- trunk/sbin/camcontrol/camcontrol.h 2016-09-18 21:09:47 UTC (rev 8423)
+++ trunk/sbin/camcontrol/camcontrol.h 2016-09-18 21:10:06 UTC (rev 8424)
@@ -40,8 +40,10 @@
int got;
};
+extern int verbose;
+
int fwdownload(struct cam_device *device, int argc, char **argv,
- char *combinedopt, int verbose, int retry_count, int timeout,
+ char *combinedopt, int printerrors, int retry_count, int timeout,
const char */*type*/);
void mode_sense(struct cam_device *device, int mode_page, int page_control,
int dbd, int retry_count, int timeout, u_int8_t *data,
@@ -58,5 +60,5 @@
int iget(void *hook, char *name);
void arg_put(void *hook, int letter, void *arg, int count, char *name);
int get_confirmation(void);
-void usage(int verbose);
+void usage(int printlong);
#endif /* _CAMCONTROL_H */
Modified: trunk/sbin/camcontrol/fwdownload.c
===================================================================
--- trunk/sbin/camcontrol/fwdownload.c 2016-09-18 21:09:47 UTC (rev 8423)
+++ trunk/sbin/camcontrol/fwdownload.c 2016-09-18 21:10:06 UTC (rev 8424)
@@ -131,7 +131,7 @@
const struct fw_vendor *vp, int *num_bytes);
static int fw_download_img(struct cam_device *cam_dev,
const struct fw_vendor *vp, char *buf, int img_size,
- int sim_mode, int verbose, int retry_count, int timeout,
+ int sim_mode, int printerrors, int retry_count, int timeout,
const char */*name*/, const char */*type*/);
/*
@@ -238,7 +238,7 @@
*/
static int
fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
- char *buf, int img_size, int sim_mode, int verbose, int retry_count,
+ char *buf, int img_size, int sim_mode, int printerrors, int retry_count,
int timeout, const char *imgname, const char *type)
{
struct scsi_write_buffer cdb;
@@ -290,7 +290,7 @@
ccb->ccb_h.flags |= CAM_DEV_QFRZDIS;
if (cam_send_ccb(cam_dev, ccb) < 0) {
warnx("Error sending identify/test unit ready");
- if (verbose)
+ if (printerrors)
cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
CAM_EPF_ALL, stderr);
cam_freeccb(ccb);
@@ -298,7 +298,7 @@
}
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
warnx("Device is not ready");
- if (verbose)
+ if (printerrors)
cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
CAM_EPF_ALL, stderr);
cam_freeccb(ccb);
@@ -372,7 +372,7 @@
/* Execute the command. */
if (cam_send_ccb(cam_dev, ccb) < 0) {
warnx("Error writing image to device");
- if (verbose)
+ if (printerrors)
cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
CAM_EPF_ALL, stderr);
goto bailout;
@@ -398,7 +398,7 @@
int
fwdownload(struct cam_device *device, int argc, char **argv,
- char *combinedopt, int verbose, int retry_count, int timeout,
+ char *combinedopt, int printerrors, int retry_count, int timeout,
const char *type)
{
const struct fw_vendor *vp;
@@ -450,7 +450,7 @@
if (sim_mode)
fprintf(stdout, "Running in simulation mode\n");
- if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose,
+ if (fw_download_img(device, vp, buf, img_size, sim_mode, printerrors,
retry_count, timeout, fw_img_path, type) != 0) {
fprintf(stderr, "Firmware download failed\n");
goto fail;
Modified: trunk/sbin/camcontrol/modeedit.c
===================================================================
--- trunk/sbin/camcontrol/modeedit.c 2016-09-18 21:09:47 UTC (rev 8423)
+++ trunk/sbin/camcontrol/modeedit.c 2016-09-18 21:10:06 UTC (rev 8424)
@@ -48,8 +48,6 @@
#include <camlib.h>
#include "camcontrol.h"
-int verbose = 0;
-
#define DEFAULT_SCSI_MODE_DB "/usr/share/misc/scsi_modes"
#define DEFAULT_EDITOR "vi"
#define MAX_FORMAT_SPEC 4096 /* Max CDB format specifier. */
More information about the Midnightbsd-cvs
mailing list