Thread (11 messages) 11 messages, 5 authors, 2016-06-28

Re: [PATCH 2/3] can: fix oops caused by wrong rtnl dellink usage

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2016-06-23 16:46:24
Also in: linux-can, stable

On 06/23/2016 03:09 PM, Sergei Shtylyov wrote:
quoted
quoted
quoted
+static void can_dellink(struct net_device *dev, struct list_head
*head)
+{
+    return;
   Why?
http://marc.info/?l=linux-can&m=146651600421205&w=2

The same reason as for commit 993e6f2fd.
   I was asking just about the useless *return* statement...
Ah!

I did some investigation before whether using 'return' in empty void 
functions or not.

static void can_dellink(struct net_device *dev, struct list_head *head);

and

static void can_dellink(struct net_device *dev, struct list_head *head)
{
	return;
}

do the same job, right?

But the first one looks like a forward declaration and you would try to 
find the 'implementing' function then.

Of course you can write less code and both implementations are correct - 
but this representation makes it pretty clear that here's nothing to do :-)

Regards,
Oliver
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help