On Tue, Feb 09, 2010 at 05:50:40PM +0100, Oliver Hartkopp wrote:
> >>>> Index: drivers/net/can/esd_pci331.c
> >>>> ===================================================================
> >>>> --- drivers/net/can/esd_pci331.c        (revision 1123)
> >>>> +++ drivers/net/can/esd_pci331.c        (working copy)
> >>>> @@ -859,7 +859,7 @@
> >>>>         for (i = 0; i < board->net_count; ++i) {
> >>>>                 board->dev[i] = esd331_pci_add_chan(pdev, board, i);
> >>>>                 if (IS_ERR(board->dev[i])) {
> >>>> -                       err = (int)board->dev[i];
> >>>> +                       err = (long)board->dev[i];
> >>> Maybe PTR_ERR is even better here?
> >> Yep, but I wasn't sure if that would work on older kernels. I wouldn't
> >> want to break things :-)
> > 
> > according to lxr it's in 2.6.16
> > 
> > http://lxr.linux.no/#linux+v2.6.16/include/linux/err.h#L23
> > 
> > which should be IMHO an old enough kernel.
> > 
> 
> Btw. for older Kernels, PTR_ERR can be added to
> 
>    trunk/kernel/2.6/include/socketcan/can/dev.h
> 
> with some KERNEL_VERSION stuff around it.
> 
> Regards,
> Oliver
> 
In that case :-)

Kurt
---

This patch removes a warning when compiling in 64 bit systems.
Signed-off-by: Kurt Van Dijck <[email protected]>

---
Index: drivers/net/can/esd_pci331.c
===================================================================
--- drivers/net/can/esd_pci331.c        (revision 1123)
+++ drivers/net/can/esd_pci331.c        (working copy)
@@ -859,7 +859,7 @@
        for (i = 0; i < board->net_count; ++i) {
                board->dev[i] = esd331_pci_add_chan(pdev, board, i);
                if (IS_ERR(board->dev[i])) {
-                       err = (int)board->dev[i];
+                       err = PTR_ERR(board->dev[i]);
                        goto failure_iounmap_base2;
                }
                if (esd331_write_allid(i, board)) {
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to