diff options
author | Dan McDonald <danmcd@joyent.com> | 2020-09-22 10:39:49 -0400 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2020-09-22 10:39:49 -0400 |
commit | 267e12a7d9bf6e5fcefb9cc00f46bfff0dc5226e (patch) | |
tree | 19a3941920d0039c35d53a5cbee189b5ca51995a /usr/src/lib/efcode/fcdriver | |
parent | 517abc5c668925e6092495bf332233c3599980d2 (diff) | |
parent | e9faba760cdf80d7dfa110fe0830917ab94668c2 (diff) | |
download | illumos-joyent-vpc.tar.gz |
Merge branch 'master' into vpcvpc
Diffstat (limited to 'usr/src/lib/efcode/fcdriver')
-rw-r--r-- | usr/src/lib/efcode/fcdriver/get_req.c | 8 | ||||
-rw-r--r-- | usr/src/lib/efcode/fcdriver/ioctl.c | 4 | ||||
-rw-r--r-- | usr/src/lib/efcode/fcdriver/load_node.c | 26 | ||||
-rw-r--r-- | usr/src/lib/efcode/fcdriver/misc.c | 8 | ||||
-rw-r--r-- | usr/src/lib/efcode/fcdriver/phandle.c | 19 | ||||
-rw-r--r-- | usr/src/lib/efcode/fcdriver/upload.c | 5 |
6 files changed, 29 insertions, 41 deletions
diff --git a/usr/src/lib/efcode/fcdriver/get_req.c b/usr/src/lib/efcode/fcdriver/get_req.c index 2fd07e4fec..dbe3dabb82 100644 --- a/usr/src/lib/efcode/fcdriver/get_req.c +++ b/usr/src/lib/efcode/fcdriver/get_req.c @@ -178,8 +178,8 @@ save_fcode_to_file(fcode_env_t *env) return; } log_message(MSG_INFO, "Fcode %p,%x to file '%s'\n", buf, len, fname); - fwrite(buf, len, sizeof (char), fd); - fclose(fd); + (void) fwrite(buf, len, sizeof (char), fd); + (void) fclose(fd); } void @@ -325,7 +325,7 @@ get_request(fcode_env_t *env) common_data_t *cdp = env->private; if (cdp->fcode_fd >= 0) - close(cdp->fcode_fd); + (void) close(cdp->fcode_fd); if (!open_fcode_dev(env)) exit(1); if (!fc_get_request(cdp)) { @@ -405,7 +405,7 @@ finish_request(fcode_env_t *env) { common_data_t *cdp = env->private; - close(cdp->fcode_fd); + (void) close(cdp->fcode_fd); } /* diff --git a/usr/src/lib/efcode/fcdriver/ioctl.c b/usr/src/lib/efcode/fcdriver/ioctl.c index 218ceb88db..7a40d98979 100644 --- a/usr/src/lib/efcode/fcdriver/ioctl.c +++ b/usr/src/lib/efcode/fcdriver/ioctl.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> @@ -85,7 +83,7 @@ fc_run_priv(common_data_t *cdp, char *service, int nin, int nout, ...) error_msg = "Error"; error = 1; } - if ((error & !no_err) || + if ((error && !no_err) || (get_interpreter_debug_level() & DEBUG_REG_ACCESS)) { if (error) log_message(MSG_ERROR, "%s: FC_RUN_PRIV: %s: ", diff --git a/usr/src/lib/efcode/fcdriver/load_node.c b/usr/src/lib/efcode/fcdriver/load_node.c index 613a1f94f6..efbd9caa5b 100644 --- a/usr/src/lib/efcode/fcdriver/load_node.c +++ b/usr/src/lib/efcode/fcdriver/load_node.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <unistd.h> #include <stdlib.h> #include <stdio.h> @@ -71,22 +69,22 @@ build_default_search_path(char *arch) struct utsname utsname; int len; - sysinfo(SI_PLATFORM, platform, sizeof (platform)); - uname(&utsname); + (void) sysinfo(SI_PLATFORM, platform, sizeof (platform)); + (void) uname(&utsname); len = strlen(search_proto) + strlen(platform) + strlen(utsname.machine); if (*arch != '\0') { len += len + (3 * strlen(arch)) + 1; } default_search_path = MALLOC(len); if (*arch != '\0') { - sprintf(default_search_path, search_proto, platform, arch, - utsname.machine, arch, arch); + (void) sprintf(default_search_path, search_proto, platform, + arch, utsname.machine, arch, arch); p = default_search_path + strlen(default_search_path); *p++ = ':'; } else p = default_search_path; - sprintf(p, search_proto, platform, "", utsname.machine, "", ""); + (void) sprintf(p, search_proto, platform, "", utsname.machine, "", ""); } static void @@ -121,7 +119,7 @@ search_path(char *name, char *search, int (*fn)(char *)) if ((next_p = strchr(p, ':')) != NULL) *next_p++ = '\0'; tpath = MALLOC(strlen(p) + strlen(name) + 2); - sprintf(tpath, "%s/%s", p, name); + (void) sprintf(tpath, "%s/%s", p, name); if ((*fn)(tpath)) { FREE(fpath); return (tpath); @@ -169,13 +167,13 @@ is_fcode_file(char *path) if (fstat(fd, &statb) != 0 || read(fd, header, sizeof (header)) < 0) { debug_msg(DEBUG_FIND_FCODE, "%s: '%s' can't fstat/read\n", func_name, path); - close(fd); + (void) close(fd); return (0); } status = check_fcode_header(path, header, statb.st_size); debug_msg(DEBUG_FIND_FCODE, "%s: '%s' format %s\n", func_name, path, status ? "OK" : "NOT OK"); - close(fd); + (void) close(fd); return (status); } @@ -194,7 +192,7 @@ find_lib_file(fcode_env_t *env, char *prefix, char *name, char *suffix, } lib_name = MALLOC(strlen(name) + strlen(prefix) + strlen(suffix) + 1); - sprintf(lib_name, "%s%s%s", prefix, name, suffix); + (void) sprintf(lib_name, "%s%s%s", prefix, name, suffix); fname = search_path(lib_name, search, fn); FREE(lib_name); return (fname); @@ -245,8 +243,8 @@ install_node_data(fcode_env_t *env, device_t *d) * build the property node returned, so we have to grab a copy * of the data. */ - strcpy(libname, (char *)p->data); - strcat(libname, "_"); + (void) strcpy(libname, (char *)p->data); + (void) strcat(libname, "_"); } else libname[0] = '\0'; @@ -261,7 +259,7 @@ install_node_data(fcode_env_t *env, device_t *d) * the property node returned, so we have to grab a copy of the * data. */ - strcat(libname, (char *)p->data); + (void) strcat(libname, (char *)p->data); debug_msg(DEBUG_FIND_FCODE, "%s: `%s` lname: '%s'\n", func_name, get_path(env, d), libname); diff --git a/usr/src/lib/efcode/fcdriver/misc.c b/usr/src/lib/efcode/fcdriver/misc.c index b2ea8a9e00..d0891aa9a6 100644 --- a/usr/src/lib/efcode/fcdriver/misc.c +++ b/usr/src/lib/efcode/fcdriver/misc.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <strings.h> @@ -463,11 +461,11 @@ get_eeprom_value(fcode_env_t *env, char *name) FILE *fd; char buf[80], *p; - sprintf(buf, "eeprom '%s'", name); + (void) sprintf(buf, "eeprom '%s'", name); if ((fd = popen(buf, "r")) == NULL) return (NULL); - fgets(buf, sizeof (buf), fd); - pclose(fd); + (void) fgets(buf, sizeof (buf), fd); + (void) pclose(fd); if ((p = strchr(buf, '\n')) != NULL) *p = '\0'; if ((p = strchr(buf, '=')) != NULL) diff --git a/usr/src/lib/efcode/fcdriver/phandle.c b/usr/src/lib/efcode/fcdriver/phandle.c index 79a202da4e..fddca08ef0 100644 --- a/usr/src/lib/efcode/fcdriver/phandle.c +++ b/usr/src/lib/efcode/fcdriver/phandle.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <strings.h> @@ -78,13 +76,13 @@ convert_phandle(fcode_env_t *env, fstack_t d) if (use_os_handle) { my_nodeid_t nh; - nh.my_handle = (fc_phandle_t) d; + nh.my_handle = (fc_phandle_t)d; t = find_resource(&cdp->nodeids, &nh, match_handle); if (t == NULL) { r = 0; } else { - my_nodeid_t *p = (my_nodeid_t *) t->data; - r = (device_t *) p->node; + my_nodeid_t *p = (my_nodeid_t *)t->data; + r = (device_t *)p->node; } } else r = (device_t *)d; @@ -108,11 +106,11 @@ revert_phandle(fcode_env_t *env, device_t *d) if (t == NULL) { r = 0; } else { - my_nodeid_t *p = (my_nodeid_t *) t->data; - r = (fstack_t) p->my_handle; + my_nodeid_t *p = (my_nodeid_t *)t->data; + r = (fstack_t)p->my_handle; } } else - r = (fstack_t) d; + r = (fstack_t)d; return (r); } @@ -135,7 +133,6 @@ allocate_phandle(fcode_env_t *env) { private_data_t *pd; common_data_t *cdp; - int error; char *service; device_t *current; fc_cell_t hcell; @@ -160,11 +157,11 @@ allocate_phandle(fcode_env_t *env) pd = MALLOC(sizeof (private_data_t)); pd->common = cdp; - pd->parent = (fc_phandle_t) revert_phandle(env, current->parent); + pd->parent = (fc_phandle_t)revert_phandle(env, current->parent); pd->upload = (cdp->init_done == 1); current->private = pd; - error = fc_run_priv(cdp, service, 0, 1, &hcell); + (void) fc_run_priv(cdp, service, 0, 1, &hcell); pd->node = fc_cell2phandle(hcell); diff --git a/usr/src/lib/efcode/fcdriver/upload.c b/usr/src/lib/efcode/fcdriver/upload.c index 14b8989295..18db29fe55 100644 --- a/usr/src/lib/efcode/fcdriver/upload.c +++ b/usr/src/lib/efcode/fcdriver/upload.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> @@ -157,10 +155,9 @@ upload_nodes(fcode_env_t *env) void validate_nodes(fcode_env_t *env) { - int error; common_data_t *cdp = env->private; - error = ioctl(cdp->fcode_fd, FC_VALIDATE); + (void) ioctl(cdp->fcode_fd, FC_VALIDATE); } #pragma init(_init) |