Re: [PATCH 5/7] CAN: Add virtual CAN netdevice driver
From: Urs Thuermann <hidden>
Date: 2007-10-04 11:55:53
Arnaldo Carvalho de Melo [off-list ref] writes:
quoted
+#ifdef CONFIG_CAN_DEBUG_DEVICES +static int debug; +module_param(debug, int, S_IRUGO); +#endifCan debug be a boolean? Like its counterpart on DCCP:
debug used to a bit mask, like it still is in core.h. You can see
this in the test
debug & 1 ? ... : ...
below. Only the test for bit 0 is left, so we could change it to bool.
net/dccp/proto.c: module_param(dccp_debug, bool, 0444); Where we also use a namespace prefix, for those of us who use ctags or cscope.
I think ctags should be able to handle multiple identical static
symbols. Isn't it? I find it somewhat clumsy to write
modprobe vcan vcan_debug=1
I think it would be nice to change the module_param() macro so that
you can name the module argument and the corresponding variable
independently, like
module_param(can_debug, "debug", bool, 0444);
OK, forget that last paragraph. I've looked at the definition of
module_param() and have seen that we have module_param_named(). I
think we should use that.
quoted
+ +/* To be moved to linux/can/dev.h */Is this comment still valid? If so can this move happen now? If not I think it would be better to stick a "FIXME: " just before it, no?
OK.
quoted
+static int echo; /* echo testing. Default: 0 (Off) */ +module_param(echo, int, S_IRUGO); +MODULE_PARM_DESC(echo, "Echo sent frames (for testing). Default: 0 (Off)");echo also seems to be a boolean
ACK.
quoted
+static int vcan_open(struct net_device *dev) +{ + DBG("%s: interface up\n", dev->name); + + netif_start_queue(dev); + return 0; +} + +static int vcan_stop(struct net_device *dev) +{ + DBG("%s: interface down\n", dev->name); + + netif_stop_queue(dev); + return 0; +}Thinking out loud: I guess these days we can try to reduce the clutter on the source code for things like "hey, I entered function foo" using simple systemtap scripts, that could even be shipped with the kernel sources. Not something pressing right now, just a suggestion.
I've never heard of systemtap before. I've ust looked at its overview web page which sounds promising. I think I'll check it out when time permits... urs