camcontrol WARNS6 cleanup

Larry Lansing lansil at fuzzynerd.com
Sat Jan 8 23:46:56 PST 2005


These patches clean up all but one warning in camcontrol.  The same names
were used for local and global variables in camcontrol.c, so I've included
two patches for this file--one that renames the global variables, and
one that renames the local variables.  Please pick whichever one you like
better.

--
Larry Lansing


Index: Makefile
===================================================================
RCS file: /home/dcvs/src/sbin/camcontrol/Makefile,v
retrieving revision 1.3
diff -r1.3 Makefile
4a5
> WARNS=	6
Index: modeedit.c
===================================================================
RCS file: /home/dcvs/src/sbin/camcontrol/modeedit.c,v
retrieving revision 1.2
diff -r1.2 modeedit.c
119c119
< static int		 load_format(char *pagedb_path, int page);
---
> static int		 load_format(const char *pagedb_path, int page);
127,131d126
< void			 mode_edit(struct cam_device *device, int page,
< 				   int page_control, int dbd, int edit,
< 				   int binary, int retry_count, int timeout);
< void			 mode_list(struct cam_device *device, int page_control,
< 				   int dbd, int retry_count, int timeout);
148c143,144
< editentry_create(void *hook, int letter, void *arg, int count, char *name)
---
> editentry_create(void *hook __unused, int letter, void *arg, int count,
> 		 char *name)
169c165,166
< editentry_update(void *hook, int letter, void *arg, int count, char *name)
---
> editentry_update(void *hook __unused, int letter, void *arg, int count,
> 		 char *name)
196c193
< editentry_save(void *hook, char *name)
---
> editentry_save(void *hook __unused, char *name)
293c290
< 			char *convertend;
---
> 			char *conv_end;
295,299c292,296
< 			for (convertend = cval + dest->size;
< 			    convertend >= cval; convertend--) {
< 				if (*convertend == ' ')
< 					*convertend = '\0';
< 				else if (*convertend != '\0')
---
> 			for (conv_end = cval + dest->size;
> 			    conv_end >= cval; conv_end--) {
> 				if (*conv_end == ' ')
> 					*conv_end = '\0';
> 				else if (*conv_end != '\0')
358c355
< load_format(char *pagedb_path, int page)
---
> load_format(const char *pagedb_path, int page)
720c717
< 	char *editor;
---
> 	const char *editor;
787c784
< 	int index;			/* Index for scanning mode params. */
---
> 	int mode_idx;			/* Index for scanning mode params. */
797,799c794,796
< 	for (index = 0; index < mph->page_length; index++) {
< 		printf("%02x%c",mode_pars[index],
< 		    (((index + 1) % 8) == 0) ? '\n' : ' ');
---
> 	for (mode_idx = 0; mode_idx < mph->page_length; mode_idx++) {
> 		printf("%02x%c",mode_pars[mode_idx],
> 		    (((mode_idx + 1) % 8) == 0) ? '\n' : ' ');
818c815
< 	char *pagedb_path;		/* Path to modepage database. */
---
> 	const char *pagedb_path;	/* Path to modepage database. */
876c873
< 	char *pagedb_path;
---
> 	const char *pagedb_path;
Index: util.c
===================================================================
RCS file: /home/dcvs/src/sbin/camcontrol/util.c,v
retrieving revision 1.2
diff -r1.2 util.c
109c109
< arg_put(void *hook, int letter, void *arg, int count, char *name)
---
> arg_put(void *hook __unused, int letter, void *arg, int count, char *name)



First option:  Rename local variables.


Index: camcontrol.c
===================================================================
RCS file: /home/dcvs/src/sbin/camcontrol/camcontrol.c,v
retrieving revision 1.2
diff -r1.2 camcontrol.c
108c108
< 	char 		*optname;	
---
> 	const char 	*optname;	
165c165
< 			    char **subopt);
---
> 			    const char **subopt);
179,180c179,180
< static int parse_btl(char *tstr, int *bus, int *target, int *lun,
< 		     cam_argmask *arglist);
---
> static int parse_btl(char *tstr, int *mybus, int *mytarget, int *mylun,
> 		     cam_argmask *myarglist);
182,183c182,183
< static int rescan_or_reset_bus(int bus, int rescan);
< static int scanlun_or_reset_dev(int bus, int target, int lun, int scan);
---
> static int rescan_or_reset_bus(int mybus, int rescan);
> static int scanlun_or_reset_dev(int mybus, int mytarget, int mylun, int scan);
206c206,207
< getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, char **subopt)
---
> getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum,
> 	  const char **subopt)
216c217
< 			*subopt = (char *)opts->subopt;
---
> 			*subopt = (const char *)opts->subopt;
989c990,991
< parse_btl(char *tstr, int *bus, int *target, int *lun, cam_argmask *arglist)
---
> parse_btl(char *tstr, int *mybus, int *mytarget, int *mylun,
> 	  cam_argmask *myarglist)
999,1000c1001,1002
< 		*bus = strtol(tmpstr, NULL, 0);
< 		*arglist |= CAM_ARG_BUS;
---
> 		*mybus = strtol(tmpstr, NULL, 0);
> 		*myarglist |= CAM_ARG_BUS;
1004,1005c1006,1007
< 			*target = strtol(tmpstr, NULL, 0);
< 			*arglist |= CAM_ARG_TARGET;
---
> 			*mytarget = strtol(tmpstr, NULL, 0);
> 			*myarglist |= CAM_ARG_TARGET;
1009,1010c1011,1012
< 				*lun = strtol(tmpstr, NULL, 0);
< 				*arglist |= CAM_ARG_LUN;
---
> 				*mylun = strtol(tmpstr, NULL, 0);
> 				*myarglist |= CAM_ARG_LUN;
1025c1027
< 	int bus = -1, target = -1, lun = -1;
---
> 	int mybus = -1, mytarget = -1, mylun = -1;
1039c1041,1042
< 		rv = parse_btl(argv[optind], &bus, &target, &lun, &arglist);
---
> 		rv = parse_btl(argv[optind], &mybus, &mytarget, &mylun,
> 			       &arglist);
1049c1052
< 		error = scanlun_or_reset_dev(bus, target, lun, rescan);
---
> 		error = scanlun_or_reset_dev(mybus, mytarget, mylun, rescan);
1051c1054
< 		error = rescan_or_reset_bus(bus, rescan);
---
> 		error = rescan_or_reset_bus(mybus, rescan);
1057c1060
< rescan_or_reset_bus(int bus, int rescan)
---
> rescan_or_reset_bus(int mybus, int rescan)
1071c1074
< 	if (bus != -1) {
---
> 	if (mybus != -1) {
1073c1076
< 		ccb.ccb_h.path_id = bus;
---
> 		ccb.ccb_h.path_id = mybus;
1089c1092
< 			    rescan ? "Re-scan" : "Reset", bus);
---
> 			    rescan ? "Re-scan" : "Reset", mybus);
1092c1095
< 				rescan ? "Re-scan" : "Reset", bus,
---
> 				rescan ? "Re-scan" : "Reset", mybus,
1223c1226
< scanlun_or_reset_dev(int bus, int target, int lun, int scan)
---
> scanlun_or_reset_dev(int mybus, int mytarget, int mylun, int scan)
1231,1232c1234,1235
< 	if (bus < 0) {
< 		warnx("invalid bus number %d", bus);
---
> 	if (mybus < 0) {
> 		warnx("invalid bus number %d", mybus);
1236,1237c1239,1240
< 	if (target < 0) {
< 		warnx("invalid target number %d", target);
---
> 	if (mytarget < 0) {
> 		warnx("invalid target number %d", mytarget);
1241,1242c1244,1245
< 	if (lun < 0) {
< 		warnx("invalid lun number %d", lun);
---
> 	if (mylun < 0) {
> 		warnx("invalid lun number %d", mylun);
1258c1261
< 		device = cam_open_btl(bus, target, lun, O_RDWR, NULL);
---
> 		device = cam_open_btl(mybus, mytarget, mylun, O_RDWR, NULL);
1266,1268c1269,1271
< 	ccb.ccb_h.path_id = bus;
< 	ccb.ccb_h.target_id = target;
< 	ccb.ccb_h.target_lun = lun;
---
> 	ccb.ccb_h.path_id = mybus;
> 	ccb.ccb_h.target_id = mytarget;
> 	ccb.ccb_h.target_lun = mylun;
1301c1304
< 		    scan? "Re-scan" : "Reset", bus, target, lun);
---
> 		    scan? "Re-scan" : "Reset", mybus, mytarget, mylun);
1305c1308
< 		    scan? "Re-scan" : "Reset", bus, target, lun,
---
> 		    scan? "Re-scan" : "Reset", mybus, mytarget, mylun,
2045c2048
< 	int bus = -1, target = -1, lun = -1;
---
> 	int mybus = -1, mytarget = -1, mylun = -1;
2106,2107c2109,2110
< 			     CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE|
< 			     CAM_ARG_DEBUG_XPT);
---
> 			       CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE|
> 			       CAM_ARG_DEBUG_XPT);
2111c2114
< 			bus = strtol(tmpstr, NULL, 0);
---
> 			mybus = strtol(tmpstr, NULL, 0);
2115c2118
< 				target = strtol(tmpstr, NULL, 0);
---
> 				mytarget = strtol(tmpstr, NULL, 0);
2119c2122
< 					lun = strtol(tmpstr, NULL, 0);
---
> 					mylun = strtol(tmpstr, NULL, 0);
2133,2135c2136,2138
< 		ccb.ccb_h.path_id = bus;
< 		ccb.ccb_h.target_id = target;
< 		ccb.ccb_h.target_lun = lun;
---
> 		ccb.ccb_h.path_id = mybus;
> 		ccb.ccb_h.target_id = mytarget;
> 		ccb.ccb_h.target_lun = mylun;
2162c2165
< 						bus, target, lun);
---
> 						mybus, mytarget, mylun);
2391c2394
< 		char *str;
---
> 		const char *str;
2428c2431
< 		char *str;
---
> 		const char *str;
2457c2460
< 		char *str;
---
> 		const char *str;
3289,3290c3292,3293
< 	char *mainopt = "C:En:t:u:v";
< 	char *subopt = NULL;
---
> 	const char *mainopt = "C:En:t:u:v";
> 	const char *subopt = NULL;



Second option:  Rename global variables.


Index: camcontrol.c
===================================================================
RCS file: /home/dcvs/src/sbin/camcontrol/camcontrol.c,v
retrieving revision 1.2
diff -r1.2 camcontrol.c
108c108
< 	char 		*optname;	
---
> 	const char 	*optname;	
160,161c160,161
< cam_argmask arglist;
< int bus, target, lun;
---
> cam_argmask g_arglist;
> int g_bus, g_target, g_lun;
165c165
< 			    char **subopt);
---
> 			    const char **subopt);
206c206,207
< getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, char **subopt)
---
> getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum,
> 	  const char **subopt)
216c217
< 			*subopt = (char *)opts->subopt;
---
> 			*subopt = (const char *)opts->subopt;
354c355
< 				if ((arglist & CAM_ARG_VERBOSE) == 0)
---
> 				if ((g_arglist & CAM_ARG_VERBOSE) == 0)
382c383
< 				 && ((arglist & CAM_ARG_VERBOSE) == 0)) {
---
> 				 && ((g_arglist & CAM_ARG_VERBOSE) == 0)) {
473c474
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
480c481
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
501c502
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
545c546
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
551c552
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
587c588
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
612c613
< 			arglist |= CAM_ARG_GET_STDINQ;
---
> 			g_arglist |= CAM_ARG_GET_STDINQ;
615c616
< 			arglist |= CAM_ARG_GET_XFERRATE;
---
> 			g_arglist |= CAM_ARG_GET_XFERRATE;
618c619
< 			arglist |= CAM_ARG_GET_SERIAL;
---
> 			g_arglist |= CAM_ARG_GET_SERIAL;
629,630c630,631
< 	if ((arglist & CAM_ARG_INQ_MASK) == 0)
< 		arglist |= CAM_ARG_INQ_MASK;
---
> 	if ((g_arglist & CAM_ARG_INQ_MASK) == 0)
> 		g_arglist |= CAM_ARG_INQ_MASK;
632c633
< 	if (arglist & CAM_ARG_GET_STDINQ)
---
> 	if (g_arglist & CAM_ARG_GET_STDINQ)
638c639
< 	if (arglist & CAM_ARG_GET_SERIAL)
---
> 	if (g_arglist & CAM_ARG_GET_SERIAL)
644c645
< 	if (arglist & CAM_ARG_GET_XFERRATE)
---
> 	if (g_arglist & CAM_ARG_GET_XFERRATE)
725c726
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
731c732
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
747c748
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
815c816
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
821c822
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
838c839
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
858,859c859,860
< 	if ((arglist & CAM_ARG_GET_STDINQ)
< 	 || (arglist & CAM_ARG_GET_XFERRATE))
---
> 	if ((g_arglist & CAM_ARG_GET_STDINQ)
> 	 || (g_arglist & CAM_ARG_GET_XFERRATE))
905c906
< 		if (arglist & CAM_ARG_VERBOSE)
---
> 		if (g_arglist & CAM_ARG_VERBOSE)
1037c1038
< 		arglist |= CAM_ARG_BUS;
---
> 		g_arglist |= CAM_ARG_BUS;
1039c1040
< 		rv = parse_btl(argv[optind], &bus, &target, &lun, &arglist);
---
> 		rv = parse_btl(argv[optind], &bus, &target, &lun, &g_arglist);
1046,1048c1047,1049
< 	if ((arglist & CAM_ARG_BUS)
< 	    && (arglist & CAM_ARG_TARGET)
< 	    && (arglist & CAM_ARG_LUN))
---
> 	if ((g_arglist & CAM_ARG_BUS)
> 	    && (g_arglist & CAM_ARG_TARGET)
> 	    && (g_arglist & CAM_ARG_LUN))
1336c1337
< 				arglist |= CAM_ARG_FORMAT_BLOCK;
---
> 				g_arglist |= CAM_ARG_FORMAT_BLOCK;
1338c1339
< 				arglist |= CAM_ARG_FORMAT_BFI;
---
> 				g_arglist |= CAM_ARG_FORMAT_BFI;
1340c1341
< 				arglist |= CAM_ARG_FORMAT_PHYS;
---
> 				g_arglist |= CAM_ARG_FORMAT_PHYS;
1349c1350
< 			arglist |= CAM_ARG_GLIST;
---
> 			g_arglist |= CAM_ARG_GLIST;
1352c1353
< 			arglist |= CAM_ARG_PLIST;
---
> 			g_arglist |= CAM_ARG_PLIST;
1386c1387
< 		      /*flags*/ CAM_DIR_IN | ((arglist & CAM_ARG_ERR_RECOVER) ?
---
> 		      /*flags*/ CAM_DIR_IN | ((g_arglist & CAM_ARG_ERR_RECOVER) ?
1396c1397
< 	if (arglist & CAM_ARG_FORMAT_BLOCK)
---
> 	if (g_arglist & CAM_ARG_FORMAT_BLOCK)
1398c1399
< 	else if (arglist & CAM_ARG_FORMAT_BFI)
---
> 	else if (g_arglist & CAM_ARG_FORMAT_BFI)
1400c1401
< 	else if (arglist & CAM_ARG_FORMAT_PHYS)
---
> 	else if (g_arglist & CAM_ARG_FORMAT_PHYS)
1407c1408
< 	if (arglist & CAM_ARG_PLIST) {
---
> 	if (g_arglist & CAM_ARG_PLIST) {
1412c1413
< 	if (arglist & CAM_ARG_GLIST) {
---
> 	if (g_arglist & CAM_ARG_GLIST) {
1425c1426
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
1438c1439
< 	if (arglist & CAM_ARG_VERBOSE)
---
> 	if (g_arglist & CAM_ARG_VERBOSE)
1638c1639
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
1646c1647
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
1691c1692
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
1699c1700
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
1733c1734
< 			arglist |= CAM_ARG_DBD;
---
> 			g_arglist |= CAM_ARG_DBD;
1736c1737
< 			arglist |= CAM_ARG_MODE_EDIT;
---
> 			g_arglist |= CAM_ARG_MODE_EDIT;
1751c1752
< 			arglist |= CAM_ARG_PAGE_CNTL;
---
> 			g_arglist |= CAM_ARG_PAGE_CNTL;
1762c1763
< 		mode_list(device, page_control, arglist & CAM_ARG_DBD,
---
> 		mode_list(device, page_control, g_arglist & CAM_ARG_DBD,
1766c1767
< 		    arglist & CAM_ARG_DBD, arglist & CAM_ARG_MODE_EDIT, binary,
---
> 		    g_arglist & CAM_ARG_DBD, g_arglist & CAM_ARG_MODE_EDIT, binary,
1822c1823
< 			if (arglist & CAM_ARG_CMD_OUT) {
---
> 			if (g_arglist & CAM_ARG_CMD_OUT) {
1828c1829
< 			arglist |= CAM_ARG_CMD_IN;
---
> 			g_arglist |= CAM_ARG_CMD_IN;
1858c1859
< 			if (arglist & CAM_ARG_CMD_IN) {
---
> 			if (g_arglist & CAM_ARG_CMD_IN) {
1864c1865
< 			arglist |= CAM_ARG_CMD_OUT;
---
> 			g_arglist |= CAM_ARG_CMD_OUT;
1904c1905
< 	if ((fd_data == 1) && (arglist & CAM_ARG_CMD_OUT)) {
---
> 	if ((fd_data == 1) && (g_arglist & CAM_ARG_CMD_OUT)) {
1921c1922
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
1988c1989
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
2003c2004
< 	 && (arglist & CAM_ARG_CMD_IN)
---
> 	 && (g_arglist & CAM_ARG_CMD_IN)
2055c2056
< 			arglist |= CAM_ARG_DEBUG_INFO;
---
> 			g_arglist |= CAM_ARG_DEBUG_INFO;
2059c2060
< 			arglist |= CAM_ARG_DEBUG_PERIPH;
---
> 			g_arglist |= CAM_ARG_DEBUG_PERIPH;
2063c2064
< 			arglist |= CAM_ARG_DEBUG_SUBTRACE;
---
> 			g_arglist |= CAM_ARG_DEBUG_SUBTRACE;
2067c2068
< 			arglist |= CAM_ARG_DEBUG_TRACE;
---
> 			g_arglist |= CAM_ARG_DEBUG_TRACE;
2071c2072
< 			arglist |= CAM_ARG_DEBUG_XPT;
---
> 			g_arglist |= CAM_ARG_DEBUG_XPT;
2075c2076
< 			arglist |= CAM_ARG_DEBUG_CDB;
---
> 			g_arglist |= CAM_ARG_DEBUG_CDB;
2105,2107c2106,2108
< 		arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH|
< 			     CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE|
< 			     CAM_ARG_DEBUG_XPT);
---
> 		g_arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH|
> 			       CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE|
> 			       CAM_ARG_DEBUG_XPT);
2112c2113
< 			arglist |= CAM_ARG_BUS;
---
> 			g_arglist |= CAM_ARG_BUS;
2116c2117
< 				arglist |= CAM_ARG_TARGET;
---
> 				g_arglist |= CAM_ARG_TARGET;
2120c2121
< 					arglist |= CAM_ARG_LUN;
---
> 					g_arglist |= CAM_ARG_LUN;
2255c2256
< 	if (arglist & CAM_ARG_VERBOSE) {
---
> 	if (g_arglist & CAM_ARG_VERBOSE) {
2349c2350
< 		if (arglist & CAM_ARG_VERBOSE)
---
> 		if (g_arglist & CAM_ARG_VERBOSE)
2360c2361
< 		if (arglist & CAM_ARG_VERBOSE)
---
> 		if (g_arglist & CAM_ARG_VERBOSE)
2391c2392
< 		char *str;
---
> 		const char *str;
2428c2429
< 		char *str;
---
> 		const char *str;
2457c2458
< 		char *str;
---
> 		const char *str;
2693c2694
< 	if (arglist & CAM_ARG_VERBOSE)
---
> 	if (g_arglist & CAM_ARG_VERBOSE)
2831c2832
< 				       (arglist & CAM_ARG_VERBOSE) ? 0 : 1);
---
> 				       (g_arglist & CAM_ARG_VERBOSE) ? 0 : 1);
3008c3009
< 	if (arglist & CAM_ARG_ERR_RECOVER)
---
> 	if (g_arglist & CAM_ARG_ERR_RECOVER)
3021c3022
< 		if (arglist & CAM_ARG_VERBOSE) {
---
> 		if (g_arglist & CAM_ARG_VERBOSE) {
3075c3076
< 			if (arglist & CAM_ARG_VERBOSE) {
---
> 			if (g_arglist & CAM_ARG_VERBOSE) {
3289,3290c3290,3291
< 	char *mainopt = "C:En:t:u:v";
< 	char *subopt = NULL;
---
> 	const char *mainopt = "C:En:t:u:v";
> 	const char *subopt = NULL;
3296c3297
< 	arglist = CAM_ARG_NONE;
---
> 	g_arglist = CAM_ARG_NONE;
3306c3307
< 	optreturn = getoption(argv[1], &cmdlist, &arglist, &subopt);
---
> 	optreturn = getoption(argv[1], &cmdlist, &g_arglist, &subopt);
3397c3398
< 			rv = parse_btl(argv[2], &bus, &target, &lun, &arglist);
---
> 			rv = parse_btl(argv[2], &g_bus, &g_target, &g_lun, &g_arglist);
3408c3409
< 			arglist |= CAM_ARG_DEVICE | CAM_ARG_UNIT;
---
> 			g_arglist |= CAM_ARG_DEVICE | CAM_ARG_UNIT;
3432c3433
< 				arglist |= CAM_ARG_RETRIES;
---
> 				g_arglist |= CAM_ARG_RETRIES;
3435c3436
< 				arglist |= CAM_ARG_ERR_RECOVER;
---
> 				g_arglist |= CAM_ARG_ERR_RECOVER;
3438c3439
< 				arglist |= CAM_ARG_DEVICE;
---
> 				g_arglist |= CAM_ARG_DEVICE;
3450c3451
< 				arglist |= CAM_ARG_TIMEOUT;
---
> 				g_arglist |= CAM_ARG_TIMEOUT;
3453c3454
< 				arglist |= CAM_ARG_UNIT;
---
> 				g_arglist |= CAM_ARG_UNIT;
3457c3458
< 				arglist |= CAM_ARG_VERBOSE;
---
> 				g_arglist |= CAM_ARG_VERBOSE;
3472,3474c3473,3475
< 		if (((arglist & (CAM_ARG_BUS|CAM_ARG_TARGET)) == 0)
< 		 && (((arglist & CAM_ARG_DEVICE) == 0)
< 		  || ((arglist & CAM_ARG_UNIT) == 0))) {
---
> 		if (((g_arglist & (CAM_ARG_BUS|CAM_ARG_TARGET)) == 0)
> 		 && (((g_arglist & CAM_ARG_DEVICE) == 0)
> 		  || ((g_arglist & CAM_ARG_UNIT) == 0))) {
3479,3480c3480,3481
< 		if ((cam_dev = ((arglist & (CAM_ARG_BUS | CAM_ARG_TARGET))?
< 				cam_open_btl(bus, target, lun, O_RDWR, NULL) :
---
> 		if ((cam_dev = ((g_arglist & (CAM_ARG_BUS | CAM_ARG_TARGET))?
> 				cam_open_btl(g_bus, g_target, g_lun, O_RDWR, NULL) :
3512,3513c3513,3514
< 			error = scsistart(cam_dev, arglist & CAM_ARG_START_UNIT,
< 					  arglist & CAM_ARG_EJECT, retry_count,
---
> 			error = scsistart(cam_dev, g_arglist & CAM_ARG_START_UNIT,
> 					  g_arglist & CAM_ARG_EJECT, retry_count,






More information about the Submit mailing list