From: Bob Breuer <breuerr@mc.net>
To: sparclinux@vger.kernel.org
Subject: Re: fix cg14 with serial console
Date: Sat, 05 Feb 2005 04:04:38 +0000 [thread overview]
Message-ID: <420445D6.7020700@mc.net> (raw)
In-Reply-To: <41FF079C.7070007@mc.net>
David S. Miller wrote:
> Please don't do that so I can test the build of the
> driver even under sparc64. I made all the sparc FB
> SBUS drivers available on sparc64 for this reason.
My bad, I didn't realize that was the case. Some of these sparc
bits need as much help as they can get. :) My intention was to
remove those ifdefs from the code. I suppose the idea of creating
stubs for the missing prom functions on sparc64 has already been
considered and rejected.
Anyway, for this bug with the cg14, the return value of
prom_getproperty() was not checked. A quick check of 2.6.10 shows
that the return value of prom_getproperty() is not used in 25 out
of 111 cases for sparc32. Would it make sense to mark this
function with __must_check? I suppose the cleanups would be too
much effort for too little gain.
And for good measure, I have appended a revised patch.
Bob
Fix crashing of the cg14 driver when booting with serial console
and a vsimm installed.
diff -X dontdiff -urp linux-2.6.10-clean/drivers/video/cg14.c linux-2.6.10/drivers/video/cg14.c
--- linux-2.6.10-clean/drivers/video/cg14.c 2005-01-12 00:11:02.000000000 -0600
+++ linux-2.6.10/drivers/video/cg14.c 2005-01-31 22:31:36.000000000 -0600
@@ -469,9 +469,9 @@ static void cg14_init_one(struct sbus_de
int is_8mb, linebytes, i;
if (!sdev) {
- prom_getproperty(node, "address",
- (char *) &bases[0], sizeof(bases));
- if (!bases[0]) {
+ if (prom_getproperty(node, "address",
+ (char *) &bases[0], sizeof(bases)) <= 0
+ || !bases[0]) {
printk(KERN_ERR "cg14: Device is not mapped.\n");
return;
}
next prev parent reply other threads:[~2005-02-05 4:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-01 4:37 fix cg14 with serial console Bob Breuer
2005-02-01 4:44 ` David S. Miller
2005-02-05 4:04 ` Bob Breuer [this message]
2005-02-05 5:41 ` David S. Miller
2005-02-06 22:23 ` Art Haas
2005-02-15 18:06 ` David S. Miller
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=420445D6.7020700@mc.net \
--to=breuerr@mc.net \
--cc=sparclinux@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.