fix warning in tdfxfb.c

fix warning in tdfxfb.c

Post by Steven Walte » Mon, 18 Jun 2001 03:30:06



This patch is obviously correct.  It doesn't appear that tdfxfb has a
maintainer, so I'm sending this patch to the list.  Nothing
earth-shattering, it just removes a warning during build.
--
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
                        -- George Orwell

--- tdfxfb.c~   Sat Jun 16 13:09:08 2001

        ((pdev->device == PCI_DEVICE_ID_3DFX_BANSHEE) ||
        (pdev->device == PCI_DEVICE_ID_3DFX_VOODOO3) ||
        (pdev->device == PCI_DEVICE_ID_3DFX_VOODOO5))) {
-      char *name;
+      char *name = NULL;

       fb_info.dev   = pdev->device;
       switch (pdev->device) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

fix warning in tdfxfb.c

Post by Steven Walte » Mon, 18 Jun 2001 04:30:08


I'm using 2.95.2; perhaps its fixed in 2.96/CVS?


> > This patch is obviously correct.  It doesn't appear that tdfxfb has a
> > maintainer, so I'm sending this patch to the list.  Nothing

> > earth-shattering, it just removes a warning during build.

> Yep.. Im actually suprised gcc couldnt work that one out itself.

--
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
                        -- George Orwell
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

fix warning in tdfxfb.c

Post by Steven Walte » Mon, 18 Jun 2001 05:20:07



> It might be better to add a default case to the switch statement below, so
> this symbol doesn't just eat up another 4(8 on some platforms, and i'm
> sure others) bytes of memory unneccesarily.

I'm not quite sure I follow you.  The default case should never be
reached, because only the three cases currently present are allowed by
the encapsulating 'if' statement.  Even so, how would adding a default
case get rid of the variable or save space some other way?

Quote:> anyway, it doesn't really matter. i'd test my hypothesis, but i've got
> people coming over this afternoon =) the driver looks like it might use
> some scrubbing anyway (s!//(.*)$!/\* $1 \*/!...)

Good point.  Perhaps I'll prepare a larger patch with this and other
cleanups.
--
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
                        -- George Orwell
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

1. [TRIVIAL] tdfxfb - compiler warning

When tdfxfb is compiled into the kernel proper, tdfxfb_remove is not
needed.  Don't compile it if we don't need it.  There is one other
reference to tdfxfb_remove in tdfxfb.c but, __devexit_p() takes care of
it.

Patch is against 2.4.19-pre10.

Rob.

diff -aur linux-clean/drivers/video/tdfxfb.c linux-dirty/drivers/video/tdfxfb.c
--- linux-clean/drivers/video/tdfxfb.c  Mon Feb 25 14:38:07 2002

  * PCI driver prototypes
  */
 static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id);
+#ifdef MODULE
 static void tdfxfb_remove(struct pci_dev *pdev);
+#endif

 static int currcon = 0;

        return 0;
 }

+#ifdef MODULE
 /**
  *     tdfxfb_remove - Device removal

        iounmap(fb_info.regbase_virt);
        iounmap(fb_info.bufbase_virt);
 }
+#endif

 int __init tdfxfb_init(void)
 {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Bill Gates interview doesn't mention OS or Linux once, even in passing

3. fix .text.exit error in tdfxfb.c

4. returning to SunOS after long linux hiatus

5. patch - tdfxfb fixes for 2.4.x

6. SSH & SSH2 installed on same machine

7. fix timer_pit.c warning

8. Shared Objects/Libraries

9. Fix BUG() decl warning in smp.h for UP

10. e2fsck problem fixed (warning: mounting unchecked filesystem)

11. Linux 2.4.21-pre7 acpi warning fix

12. arch/i386/kernel/srat.c cast warning fix

13. [8/8] fix unused function warning in drivers/block/floppy.c