Re: [PATCH 2/7] CAN: Add PF_CAN core module

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Urs Thuermann
Date: Friday, September 21, 2007 - 3:35 am

Joe Perches <joe@perches.com> writes:


When I wrote these macros we had one platform where we still used
linux-2.4 and gcc-2.95.3 and with that old gcc your macro def would
mean you can't use DBG with only one argument, like DBG("some string\n");
since gcc-2.95 would leave the , after __func__ followed by the
closing ")".  I didn't find a way with gcc-2.95 to make the format
string a separate macro argument (which I also wanted).  OK, that's
history now and linux-2.6 needs gcc-3/4 anyway, so I will change this.


I use "do { ... } while(0)" only for statements, not for expressions.
But I could have used the && instead of ?: operator.  I don't think
the "do { ... } while(0)" looks nicer or has any other advantage.


You mean the order or `msg' and `cf'?  You want to switch them so that
the variable args follow immediately the format string?  Might make
sense, OTOH we wanted to have the message as the first argument.


Ah, I didn't know print_hex_dump().  That looks nicer.  But as Thomas
mentioned, we shouldn't convert these functions into macros.

urs
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/7] CAN: Add PF_CAN core module, Urs Thuermann, (Thu Sep 20, 11:43 am)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Joe Perches, (Thu Sep 20, 1:06 pm)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Thomas Gleixner, (Thu Sep 20, 1:27 pm)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Urs Thuermann, (Fri Sep 21, 3:35 am)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Patrick McHardy, (Fri Sep 21, 5:47 am)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Joe Perches, (Fri Sep 21, 9:58 am)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Urs Thuermann, (Fri Sep 21, 11:01 am)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Patrick McHardy, (Sat Sep 22, 3:53 am)
Re: [PATCH 2/7] CAN: Add PF_CAN core module, Urs Thuermann, (Mon Sep 24, 12:23 pm)