mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Small change to pnp_bios.c
@ 2001-09-25  4:03 Thomas Hood
  2001-09-25  4:10 ` Ignacio Vazquez-Abrams
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Hood @ 2001-09-25  4:03 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

I have been trying to find out why the PnP BIOS driver
causes the disabling of all the PnP-configurable devices
on my ThinkPad 600.  (One other user has reported the same
problem.)  I've been checking the pnp_bios.c driver against
the spec and I found one little nit.

The spec says that after this call to the BIOS:
   Q2_SET_SEL(PNP_TS1, nodenum, sizeof(char));
   Q2_SET_SEL(PNP_TS2, data, 64 * 1024);
   status = call_pnp_bios(PNP_GET_SYS_DEV_NODE, 0, PNP_TS1, 0, PNP_TS2, boot ? 2 : 1, PNP_DS, 0);
nodenum will be set to the next node number, or to 0xFF
if there are no more nodes.  I added a check so that
the build-devlist loop will terminate if nodenum is 0xff.
This didn't solve my problem but it does seem like the
kosher thing to do.  The patch also initializes the
variable "num" to zero.  I know that static variables
in the kernel are automatically initialized to zero, but
I assume that the same is not true of stack variables.
Am I wrong?

The attached patch is against -ac13.  Sorry, but the
-ac15 differential patch hasn't come out yet.  :(

Thomas

[-- Attachment #2: pnpbios-patch-20010924-1 --]
[-- Type: text/plain, Size: 546 bytes --]

--- linux-2.4.9-ac13-mwave/drivers/pnp/pnp_bios.c_1	Fri Sep 21 16:15:44 2001
+++ linux-2.4.9-ac13-mwave/drivers/pnp/pnp_bios.c	Mon Sep 24 18:32:26 2001
@@ -839,13 +839,13 @@
                 return;
 
         node = kmalloc(node_info.max_node_size, GFP_KERNEL);
         if (!node)
                 return;
 
-	for(i=0;i<0xff;i++) {
+	for(i=0,num=0;i<0xff,num!=0xff;i++) {
 		dev =  kmalloc(sizeof (struct pci_dev), GFP_KERNEL);
 		if (!dev)
 			break;
 			
                 if (pnp_bios_get_dev_node((u8 *)&num, (char )0 , node))
 			continue;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Small change to pnp_bios.c
  2001-09-25  4:03 [PATCH] Small change to pnp_bios.c Thomas Hood
@ 2001-09-25  4:10 ` Ignacio Vazquez-Abrams
  0 siblings, 0 replies; 2+ messages in thread
From: Ignacio Vazquez-Abrams @ 2001-09-25  4:10 UTC (permalink / raw)
  To: linux-kernel

On Tue, 25 Sep 2001, Thomas Hood wrote:

> -       for(i=0;i<0xff;i++) {
> +       for(i=0,num=0;i<0xff,num!=0xff;i++) {

That middle comma should be || or &&, right?

-- 
Ignacio Vazquez-Abrams  <ignacio@openservices.net>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-25  4:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-25  4:03 [PATCH] Small change to pnp_bios.c Thomas Hood
2001-09-25  4:10 ` Ignacio Vazquez-Abrams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®