[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALx6S37-pH5GUU34EMvLGgm5V3T7jETrKu99A4CVVxKwM_-7RQ@mail.gmail.com>
Date: Wed, 2 Sep 2015 10:05:09 -0700
From: Tom Herbert <tom@...bertland.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: David Miller <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH] flow_dissector: Use 'const' where possible.
On Wed, Sep 2, 2015 at 9:39 AM, Jiri Pirko <jiri@...nulli.us> wrote:
> Wed, Sep 02, 2015 at 06:33:34AM CEST, tom@...bertland.com wrote:
>>On Tue, Sep 1, 2015 at 9:19 PM, David Miller <davem@...emloft.net> wrote:
>>>
>>> Signed-off-by: David S. Miller <davem@...emloft.net>
>>> ---
>>> include/linux/skbuff.h | 8 ++---
>>> include/net/flow.h | 8 ++---
>>> net/core/flow_dissector.c | 79 ++++++++++++++++++++++++-----------------------
>>> 3 files changed, 49 insertions(+), 46 deletions(-)
>>>
>
> <snip>
>
>
>>> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
>>> index 345a040..d79699c 100644
>>> --- a/net/core/flow_dissector.c
>>> +++ b/net/core/flow_dissector.c
>>> @@ -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...
Right, these functions now are independent of sk_buff. Conceptually
someone could use these for a non-skbuff application-- so it's good
design!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists