2.5.34 : drivers/net/irda/irtty.c __FUNCTION__ fix

2.5.34 : drivers/net/irda/irtty.c __FUNCTION__ fix

Post by Frank Davi » Wed, 11 Sep 2002 08:20:07



Hello all,
     The following patch fixes several __FUNCTION__ related errors. Please
review for inclusion.

Regards,
Frank

--- linux/drivers/net/irda/irtty.c.old  Thu Jun 20 19:57:59 2002

        /* Unregister tty line-discipline */
        if ((ret = tty_register_ldisc(N_IRDA, NULL))) {
-               ERROR(__FUNCTION__
-                     "(), can't unregister line discipline (err = %d)\n",
-                     ret);
+                  ERROR("%s (), can't unregister line discipline (err = %d)\n", __FUNCTION, ret);
        }


        self->rx_buff.data = self->rx_buff.head;

        if (!(dev = dev_alloc("irda%d", &err))) {
-               ERROR(__FUNCTION__ "(), dev_alloc() failed!\n");
+               ERROR(" %s (), dev_alloc() failed!\n", __FUNCTION__);
                return -ENOMEM;
        }

        err = register_netdevice(dev);
        rtnl_unlock();
        if (err) {
-               ERROR(__FUNCTION__ "(), register_netdev() failed!\n");
+               ERROR(" %s (), register_netdev() failed!\n", __FUNCTION__);
                return -1;
        }

                        irda_task_next_state(task, IRDA_TASK_CHILD_DONE);
                break;
        case IRDA_TASK_CHILD_WAIT:
-               WARNING(__FUNCTION__
-                       "(), changing speed of dongle timed out!\n");
+               WARNING(" %s (), changing speed of dongle timed out!\n", __FUNCTION__);
                ret = -1;              
                break;

                self->task = NULL;
                break;
        default:
-               ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
+               ERROR(" %s (), unknown state %d\n", __FUNCTION__, task->state);
                irda_task_next_state(task, IRDA_TASK_DONE);
                self->task = NULL;
                ret = -1;

-
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.5.34 : drivers/net/irda/irtty.c __FUNCTION__ fix

Post by Jean Tourrilhe » Wed, 11 Sep 2002 09:00:07



> Hello all,
>      The following patch fixes several __FUNCTION__ related errors. Please
> review for inclusion.

> Regards,
> Frank

        I can only promise you to put it in my patch queue (which is
already backlogged). I've already added it on my web page (so I won't
forget it). It would have been nicer to not add a space around the
function name, but who cares.
        Please also note that currently irtty is broken, so use at
your own risks...
        Thanks...

        Jean
-
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.5.34 : drivers/net/irda/irtty.c __FUNCTION__ fix

Post by Jean Tourrilhe » Thu, 12 Sep 2002 01:10:05




> > I've already added it on my web page (so I won't
> > forget it).

> What's the URL, for those of us who haven't been paying attention?

        Google is your friend :
http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/IrDA.html

        Jean
-
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. 2.5.34: IR __FUNCTION__ breakage

I've been painstakingly going through all the IR code and fixing up
the __FUNCTION__ breakage.  One of the not obvious patches is for
linux/net/irda/irnet/irnet.h, where string concatenation was fully
taken advantage of :-).

The problem lies in statements such as

#define DERROR(dbg, args...) \
        {if(DEBUG_##dbg) \
                printk(KERN_INFO "irnet: " __FUNCTION__ "(): " args);}

where you really want to avoid having any format strings because
"args" could legally have one (and probably will).  Under the
circumstances, one option might be something like

define DERROR(dbg, args...) \
        {if(DEBUG_##dbg){\
                printk(KERN_INFO "irnet: %s(): ", __FUNCTION__);\
                printk(KERN_INFO args);}}

which strikes me as not quite what the author intended, although it
should work.  Better ideas are welcome, and if a consensus is reached,
I'll be happy to submit the full IR __FUNCTION__ patch set against
2.5.34 for inclusion in a later kernel version.

--
-----------------------------------------------------------------------
Bob Tracy                   WTO + WIPO = DMCA? http://www.anti-dmca.org

-----------------------------------------------------------------------
-
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. Solaris 2.6 x86 install questions

3. FW: 2.5.34: IR __FUNCTION__ breakage

4. gcc 2.3.3 fails in Solaris2.1 with AFS translator

5. 2.5.34 s390 fixes (7/10): 3215 driver.

6. SWIM2.0

7. 2.5.34 s390 fixes (5/10): dasd driver.

8. Macally 2-button mouse and Xpmac

9. 2.5.34 s390 fixes (10/10): iucv driver.

10. 2.5.34 s390 fixes (9/10): ctc driver.

11. 2.5.34 s390 fixes (6/10): xpram driver.

12. 2.5.34 floppy driver init/exit fixes

13. 2.5.34 s390 fixes (8/10): signal quiesce.