FreeBSD Bugzilla – Attachment 101012 Details for
Bug 140384
[patch] chio(8) fix some harmless uninitialized argument warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.61 KB, created by
Ulrich Spoerlein
on 2009-11-08 11:00:07 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Ulrich Spoerlein
Created:
2009-11-08 11:00:07 UTC
Size:
2.61 KB
patch
obsolete
>diff -r 4e4d5ca6b8da -r fdda05e4e407 bin/chio/chio.c >--- a/bin/chio/chio.c Mon Nov 02 18:57:34 2009 +0100 >+++ b/bin/chio/chio.c Sun Nov 08 09:58:32 2009 +0100 >@@ -424,16 +424,13 @@ > > /* ARGSUSED */ > static int >-do_params(const char *cname, int argc, char **argv) >+do_params(const char *cname, int argc, char **argv __unused) > { > struct changer_params data; > int picker; > > /* No arguments to this command. */ >- >- ++argv; --argc; >- >- if (argc) { >+ if (argc > 1) { > warnx("%s: no arguments expected", cname); > goto usage; > } >@@ -467,15 +464,12 @@ > > /* ARGSUSED */ > static int >-do_getpicker(const char *cname, int argc, char **argv) >+do_getpicker(const char *cname, int argc, char **argv __unused) > { > int picker; > > /* No arguments to this command. */ >- >- ++argv; --argc; >- >- if (argc) { >+ if (argc > 1) { > warnx("%s: no arguments expected", cname); > goto usage; > } >@@ -966,7 +960,6 @@ > } else { > element = parse_element_unit(*argv); > } >- ++argv; --argc; > > /* Get the status */ > ces = get_element_status((unsigned int)type, (unsigned int)element, >@@ -1072,10 +1065,10 @@ > > /* Read in the changer slots */ > if (cp.cp_nslots > 0) { >+ (void) memset(&cesr, 0, sizeof(cesr)); > cesr.cesr_element_type = CHET_ST; >- cesr.cesr_element_base = 0; > cesr.cesr_element_count = cp.cp_nslots; >- cesr.cesr_flags |= CESR_VOLTAGS; >+ cesr.cesr_flags = CESR_VOLTAGS; > cesr.cesr_element_status = ces; > > if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { >@@ -1087,12 +1080,10 @@ > > /* Read in the drive information */ > if (cp.cp_ndrives > 0 ) { >- > (void) memset(&cesr, 0, sizeof(cesr)); > cesr.cesr_element_type = CHET_DT; >- cesr.cesr_element_base = 0; > cesr.cesr_element_count = cp.cp_ndrives; >- cesr.cesr_flags |= CESR_VOLTAGS; >+ cesr.cesr_flags = CESR_VOLTAGS; > cesr.cesr_element_status = ces; > > if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { >@@ -1106,9 +1097,8 @@ > if (cp.cp_nportals > 0 ) { > (void) memset(&cesr, 0, sizeof(cesr)); > cesr.cesr_element_type = CHET_IE; >- cesr.cesr_element_base = 0; > cesr.cesr_element_count = cp.cp_nportals; >- cesr.cesr_flags |= CESR_VOLTAGS; >+ cesr.cesr_flags = CESR_VOLTAGS; > cesr.cesr_element_status = ces; > > if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { >@@ -1122,9 +1112,8 @@ > if (cp.cp_npickers > 0) { > (void) memset(&cesr, 0, sizeof(cesr)); > cesr.cesr_element_type = CHET_MT; >- cesr.cesr_element_base = 0; > cesr.cesr_element_count = cp.cp_npickers; >- cesr.cesr_flags |= CESR_VOLTAGS; >+ cesr.cesr_flags = CESR_VOLTAGS; > cesr.cesr_element_status = ces; > > if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { >--- chio.diff ends here ---
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 140384
: 101012