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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/23/2016 03:09 PM, Sergei Shtylyov wrote:

+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


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]