From: David Miller <davem@davemloft.net>
To: jiri@resnulli.us
Cc: tom@herbertland.com, netdev@vger.kernel.org
Subject: Re: [PATCH] flow_dissector: Use 'const' where possible.
Date: Wed, 02 Sep 2015 11:42:23 -0700 (PDT) [thread overview]
Message-ID: <20150902.114223.133749270197332524.davem@davemloft.net> (raw)
In-Reply-To: <20150902163934.GB2165@nanopsycho.orion>
From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 2 Sep 2015 18:39:34 +0200
> Wed, Sep 02, 2015 at 06:33:34AM CEST, tom@herbertland.com wrote:
>>> @@ -19,14 +19,14 @@
>>> #include <net/flow_dissector.h>
>>> #include <scsi/fc/fc_fcoe.h>
>>>
>>> -static bool skb_flow_dissector_uses_key(struct flow_dissector *flow_dissector,
>>> - enum flow_dissector_key_id key_id)
>>> +static bool dissector_uses_key(const struct flow_dissector *flow_dissector,
>>> + enum flow_dissector_key_id key_id)
>>> {
>>> return flow_dissector->used_keys & (1 << key_id);
>>> }
>>>
>>> -static void skb_flow_dissector_set_key(struct flow_dissector *flow_dissector,
>>> - enum flow_dissector_key_id key_id)
>>> +static void dissector_set_key(struct flow_dissector *flow_dissector,
>>> + enum flow_dissector_key_id key_id)
>>> {
>>> flow_dissector->used_keys |= (1 << key_id);
>>> }
>>> @@ -51,20 +51,20 @@ void skb_flow_dissector_init(struct flow_dissector *flow_dissector,
>>
>>I suppose we should drop skb_ from skb_flow_dissector_init and
>>skb_flow_dissector_target as well.
>
> I like to have "namespaces" by function prefixes. Code is easier to read
> then...
I completely disagree.
These are static, local functions, the can use whatever names they want
and the shorter the better.
Long function names drive me absolutely insane and make keeping the
argument lists under ~80 columns a royal pain in the ass.
So I will continue to trim function names down to something more
reasonable when they are static and local to a source file.
And I encourage you to do so as well.
next prev parent reply other threads:[~2015-09-02 18:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 4:19 [PATCH] flow_dissector: Use 'const' where possible David Miller
2015-09-02 4:33 ` Tom Herbert
2015-09-02 5:32 ` David Miller
2015-09-02 16:39 ` Jiri Pirko
2015-09-02 17:05 ` Tom Herbert
2015-09-02 18:42 ` David Miller [this message]
2015-09-02 4:47 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150902.114223.133749270197332524.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).