FreeBSD Bugzilla – Attachment 250908 Details for
Bug 279261
i2c -sv reports stack garbage in message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Initialize i2c_opt.addr to 0
i2c-verbose.diff (text/plain), 1.26 KB, created by
John F. Carr
on 2024-05-23 20:10:51 UTC
(
hide
)
Description:
Initialize i2c_opt.addr to 0
Filename:
MIME Type:
Creator:
John F. Carr
Created:
2024-05-23 20:10:51 UTC
Size:
1.26 KB
patch
obsolete
>commit 887d0ec4c4f406e011634f9939aa97f4aa55515a >Author: John F. Carr <jfc@mit.edu> >Date: Thu May 23 15:50:14 2024 -0400 > > Don't print uninitialized data when verbose > >diff --git a/usr.sbin/i2c/i2c.c b/usr.sbin/i2c/i2c.c >index 12155f1a0663..e4a780ba828f 100644 >--- a/usr.sbin/i2c/i2c.c >+++ b/usr.sbin/i2c/i2c.c >@@ -751,6 +751,7 @@ main(int argc, char** argv) > > /* Default values */ > i2c_opt.off = 0; >+ i2c_opt.addr = 0; > i2c_opt.verbose = 0; > i2c_opt.dir = 'r'; /* direction = read */ > i2c_opt.width = "8"; >@@ -875,12 +876,6 @@ main(int argc, char** argv) > return(EX_USAGE); > } > >- if (i2c_opt.verbose) >- fprintf(stderr, "dev: %s, addr: 0x%x, r/w: %c, " >- "offset: 0x%02x, width: %s, count: %u\n", dev, >- i2c_opt.addr >> 1, i2c_opt.dir, i2c_opt.off, >- i2c_opt.width, i2c_opt.count); >- > fd = open(dev, O_RDWR); > if (fd == -1) { > fprintf(stderr, "Error opening I2C controller (%s): %s\n", >@@ -890,6 +885,11 @@ main(int argc, char** argv) > > switch (do_what) { > case 'a': >+ if (i2c_opt.verbose) >+ fprintf(stderr, "dev: %s, addr: 0x%x, r/w: %c, " >+ "offset: 0x%02x, width: %s, count: %u\n", dev, >+ i2c_opt.addr >> 1, i2c_opt.dir, i2c_opt.off, >+ i2c_opt.width, i2c_opt.count); > error = access_bus(fd, i2c_opt); > break; > case 's':
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 279261
: 250908