From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [ANNOUNCE] superiotool -- Detect Super I/Os,
Date: Tue, 09 Oct 2007 18:22:54 +0000 [thread overview]
Message-ID: <20071009202254.50960c35@hyperion.delvare> (raw)
In-Reply-To: <20071008013540.GB12533@greenwood>
On Tue, 9 Oct 2007 19:54:24 +0200, Uwe Hermann wrote:
> On Tue, Oct 09, 2007 at 07:14:29PM +0200, Jean Delvare wrote:
> > We tell users to use isadump for that. As isadump is part of the
> > lm-sensors package, we can be reasonably certain that it is available
> > to the users. And more often than not, we need the dump of the
> > LDN-specific I/O space, which superio doesn't support as far as I can see.
>
> It dumps the per-LDN register contents, not sure if that's the same as
> the I/O space you're referring to? If no, then it's not supported, correct.
No, that's not the same I/O space. What I'm talking about is the I/O
space those address is typically stored in registers 0x60 and 0x61 for
a given logical device.
> > * The human-readable dump of my F71805FG chip includes:
> > 27
> > 29\0
> > 2aÿ
> > 2bÿ
> > That's not exactly human-readable by my definition ;)
>
> Yeah, that was the initial format in the very early days, the plain
> register dump feature came later and we redeclared the old format
> to be the "human-readable" format for now (but it really needs lots of
> improvements, and isn't available for all chips anyway).
>
> This is likely a _very_ chip-specific feature, so we need one extra
> function with tons of custom printf's per chip. I'm not too sure if
> this is really _that_ useful to warrant such an amount of work, but
> we'll see...
I don't know if it's worth the effort, but if not, then you should
probably not print these values at all. They're available in the other
dump format anyway.
> > I've also hit a strange bug with -v (no kidding), I'll send a patch
> > when I'm done fixing it.
>
> Yeah, known issue (if we're talking about the same one). See the thread
> starting here http://linuxbios.org/pipermail/linuxbios/2007-October/025461.html
> for a discussion and possible solutions. We haven't yet found the best
> way to do it, but will have to choose one soonish.
No, I didn't go that far. My concern was simply that strncpy is
misused. strncpy doesn't null-terminate the string it copies, so you
end up passing an invalid string to printf.
I have a simple fix using atoi instead of the ugly strncpy/strlen mix
you have:
superiotool.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
--- superiotool.orig/superiotool.c 2007-10-09 19:48:15.000000000 +0200
+++ superiotool/superiotool.c 2007-10-09 19:53:43.000000000 +0200
@@ -170,12 +170,7 @@ void probing_for(const char *vendor, con
static void print_version(void)
{
- char tmp[80];
-
- strncpy((char *)&tmp,
- (const char *)&SUPERIOTOOL_VERSION[6],
- strlen(SUPERIOTOOL_VERSION) - 8);
- printf("superiotool r%s\n", (char *)&tmp);
+ printf("superiotool r%d\n", atoi(&SUPERIOTOOL_VERSION[6]));
}
int main(int argc, char *argv[])
But of course it will conflict with the patch you posted.
I don't like your patch at all, BTW. At this point of complexity you
have to admit that you're doing something wrong and give up ;) Why
don't you use arbitrary version numbers as every other projects do?
This is much more valuable than SVN revision numbers, and much easier
to maintain than what you're trying to do.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2007-10-09 18:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 1:35 [lm-sensors] [ANNOUNCE] superiotool -- Detect Super I/Os, Uwe Hermann
2007-10-09 17:14 ` Jean Delvare
2007-10-09 17:54 ` Uwe Hermann
2007-10-09 18:22 ` Jean Delvare [this message]
2007-10-09 19:16 ` Uwe Hermann
2007-10-09 20:24 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071009202254.50960c35@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.