From owner-svn-src-all@FreeBSD.ORG Sun Dec 11 11:38:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA547106564A; Sun, 11 Dec 2011 11:38:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACA018FC12; Sun, 11 Dec 2011 11:38:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBBBcoBH050884; Sun, 11 Dec 2011 11:38:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBBBcojY050881; Sun, 11 Dec 2011 11:38:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201112111138.pBBBcojY050881@svn.freebsd.org> From: Ed Schouten Date: Sun, 11 Dec 2011 11:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228407 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Dec 2011 11:38:51 -0000 Author: ed Date: Sun Dec 11 11:38:50 2011 New Revision: 228407 URL: http://svn.freebsd.org/changeset/base/228407 Log: 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. Modified: head/sbin/camcontrol/fwdownload.c head/sbin/camcontrol/modeedit.c Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Sun Dec 11 09:56:48 2011 (r228406) +++ head/sbin/camcontrol/fwdownload.c Sun Dec 11 11:38:50 2011 (r228407) @@ -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; Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Sun Dec 11 09:56:48 2011 (r228406) +++ head/sbin/camcontrol/modeedit.c Sun Dec 11 11:38:50 2011 (r228407) @@ -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. */