summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-12-11 11:38:50 +0000
committered <ed@FreeBSD.org>2011-12-11 11:38:50 +0000
commit38db8319a95f2326f4158e57e8d099da65372eca (patch)
tree860f73e2ffa7cb5bb98d0be630eed20df6aedb17 /sbin/camcontrol
parenta5208fecbf6e7af0c050fdf4b1ea1b402c68b0ae (diff)
downloadFreeBSD-src-38db8319a95f2326f4158e57e8d099da65372eca.zip
FreeBSD-src-38db8319a95f2326f4158e57e8d099da65372eca.tar.gz
Add missing static keywords to global variables in camcontrol.
While there, make the vendor list const and add appropriate keywords to functions that use this list.
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r--sbin/camcontrol/fwdownload.c20
-rw-r--r--sbin/camcontrol/modeedit.c6
2 files changed, 13 insertions, 13 deletions
diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c
index e59ae4c..abb3726 100644
--- a/sbin/camcontrol/fwdownload.c
+++ b/sbin/camcontrol/fwdownload.c
@@ -88,7 +88,7 @@ struct fw_vendor {
int inc_cdb_offset;
};
-struct fw_vendor vendors_list[] = {
+static const struct fw_vendor vendors_list[] = {
{VENDOR_HITACHI, "HITACHI", 0x8000, 0x05, 0x05, 1, 0},
{VENDOR_HP, "HP", 0x8000, 0x07, 0x07, 0, 1},
{VENDOR_IBM, "IBM", 0x8000, 0x05, 0x05, 1, 0},
@@ -98,22 +98,22 @@ struct fw_vendor vendors_list[] = {
{VENDOR_UNKNOWN, NULL, 0x0000, 0x00, 0x00, 0, 0}
};
-static struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev);
-static char *fw_read_img(char *fw_img_path, struct fw_vendor *vp,
- int *num_bytes);
+static const struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev);
+static char *fw_read_img(const char *fw_img_path,
+ const struct fw_vendor *vp, int *num_bytes);
static int fw_download_img(struct cam_device *cam_dev,
- struct fw_vendor *vp, char *buf, int img_size,
+ const struct fw_vendor *vp, char *buf, int img_size,
int sim_mode, int verbose, int retry_count, int timeout);
/*
* Find entry in vendors list that belongs to
* the vendor of given cam device.
*/
-static struct fw_vendor *
+static const struct fw_vendor *
fw_get_vendor(struct cam_device *cam_dev)
{
char vendor[SID_VENDOR_SIZE + 1];
- struct fw_vendor *vp;
+ const struct fw_vendor *vp;
if (cam_dev == NULL)
return (NULL);
@@ -133,7 +133,7 @@ fw_get_vendor(struct cam_device *cam_dev)
* in num_bytes.
*/
static char *
-fw_read_img(char *fw_img_path, struct fw_vendor *vp, int *num_bytes)
+fw_read_img(const char *fw_img_path, const struct fw_vendor *vp, int *num_bytes)
{
int fd;
struct stat stbuf;
@@ -205,7 +205,7 @@ bailout1:
* device but do not sent any actual packets
*/
static int
-fw_download_img(struct cam_device *cam_dev, struct fw_vendor *vp,
+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)
{
@@ -319,7 +319,7 @@ int
fwdownload(struct cam_device *device, int argc, char **argv,
char *combinedopt, int verbose, int retry_count, int timeout)
{
- struct fw_vendor *vp;
+ const struct fw_vendor *vp;
char *fw_img_path = NULL;
char *buf;
int img_size;
diff --git a/sbin/camcontrol/modeedit.c b/sbin/camcontrol/modeedit.c
index eaf87d6..e43ce9c 100644
--- a/sbin/camcontrol/modeedit.c
+++ b/sbin/camcontrol/modeedit.c
@@ -83,15 +83,15 @@ struct editentry {
char *svalue;
} value;
};
-STAILQ_HEAD(, editentry) editlist; /* List of page entries. */
-int editlist_changed = 0; /* Whether any entries were changed. */
+static STAILQ_HEAD(, editentry) editlist; /* List of page entries. */
+static int editlist_changed = 0; /* Whether any entries were changed. */
struct pagename {
SLIST_ENTRY(pagename) link;
int pagenum;
char *name;
};
-SLIST_HEAD(, pagename) namelist; /* Page number to name mappings. */
+static SLIST_HEAD(, pagename) namelist; /* Page number to name mappings. */
static char format[MAX_FORMAT_SPEC]; /* Buffer for scsi cdb format def. */
OpenPOWER on IntegriCloud