Thread (6 messages) flat view 6 messages, 3 authors, 2015-03-10

Re: [PATCH] can: use sock_efree instead of own destructor

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2015-03-10 13:36:21
Also in: linux-can

Yes - in connection with sock_rfree() for the read buffer destructur and
sock_wfree() for the write buffer it can make sense to name a function
sock_efree() as an unassigned destructor - which does not fiddle with rmem nor
wmen.

But both sock_efree() and sock_edemux() lack some comment - especially when it
makes sense to use them from non-INET contexts which Florian suggested.

Maybe Alexander can send a patch which adds a comment, as I don't know if I
would find the best words for it.

Regards,
Oliver

On 03/10/2015 01:22 PM, Eric Dumazet wrote:
On Tue, 2015-03-10 at 07:14 +0100, Oliver Hartkopp wrote:
quoted
the other callers use it in the same way so it's a good simplification.
Btw. the name of sock_efree() is a bit misleading - nothing is free'd here.

Won't it be better to rename sock_efree(skb) with sock_put_skb(skb) or 
something like that? sock_efree() has no comment why it's named like this.
I would prefer name stays as is. It eases searches in changelogs to not
change function names unless really needed, for backports and code
maintenance.


# git log | grep sock_efree
    net: merge cases where sock_efree and sock_edemux are the same function
    Since sock_efree and sock_demux are essentially the same code for non-TCP
    In addition I have added a destructor named sock_efree which is meant to

sock_efree was added in commit 62bccb8cdb69051b95a55ab0c489e3cab261c8ef

I guess Alexander chose the name close to sock_edemux() and sock_rfree() ones.

This makes sense to me at least.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help