All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 6/6] netfilter: xtables: add const qualifiers
@ 2010-02-11  9:14 Alexey Dobriyan
  2010-02-11  9:27 ` Patrick McHardy
  0 siblings, 1 reply; 13+ messages in thread
From: Alexey Dobriyan @ 2010-02-11  9:14 UTC (permalink / raw)
  To: jengelh; +Cc: netfilter-devel, kaber

> -static inline int ebt_basic_match(struct ebt_entry *e, struct ethhdr *h,
> -   const struct net_device *in, const struct net_device *out)
> +static inline int
> +ebt_basic_match(const struct ebt_entry *e, const struct ethhdr *h,
> +                const struct net_device *in, const struct net_device *out)

These const modifiers are pointless because compilers are smart enough
to notice non-modifiability and generate the very same code in both cases.

Nowadays, half of functions declarations in generic
xtables/iptables/ip6tables/arptables
code are littered with const which makes them pretty unpleasant to read.

> -	struct ebt_entry *e = (struct ebt_entry *)chain->data;
> +	const struct ebt_entry *e = (struct ebt_entry *)chain->data;

And such things are wrong (not second const).

Please, at least, keep "struct net *" out of this.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Code cleanups
@ 2010-02-10 17:39 Jan Engelhardt
  2010-02-10 17:39 ` [PATCH 6/6] netfilter: xtables: add const qualifiers Jan Engelhardt
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Engelhardt @ 2010-02-10 17:39 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel


Hi,


the next patch pack is mostly about cleanups, and there is one
commit for improving debug a little.
Pull URL will be posted once the previous request has been
merged, but I am already posting them now for review.



The following changes since commit e3eaa9910b380530cfd2c0670fcd3f627674da8a:
  Jan Engelhardt (1):
        netfilter: xtables: generate initial table on-demand

are available in the git repository at:

  . master2

Jan Engelhardt (6):
      netfilter: iptables: remove unused function arguments
      netfilter: reduce NF_HOOK by one argument
      netfilter: get rid of the grossness in netfilter.h
      netfilter: xtables: print details on size mismatch
      netfilter: xtables: constify args in compat copying functions
      netfilter: xtables: add const qualifiers

 include/linux/netfilter.h            |   55 +++++++++++---------
 include/linux/netfilter/x_tables.h   |   12 ++--
 net/bridge/netfilter/ebtables.c      |   59 ++++++++++++----------
 net/ipv4/netfilter/arp_tables.c      |   73 +++++++++++++++------------
 net/ipv4/netfilter/ip_tables.c       |   92 +++++++++++++++++++---------------
 net/ipv4/netfilter/ipt_ULOG.c        |    4 +-
 net/ipv4/netfilter/iptable_mangle.c  |   10 +---
 net/ipv6/netfilter/ip6_tables.c      |   92 ++++++++++++++++++---------------
 net/ipv6/netfilter/ip6table_mangle.c |   10 +---
 net/netfilter/x_tables.c             |   16 ++++--
 net/netfilter/xt_hashlimit.c         |    4 +-
 net/netfilter/xt_limit.c             |    4 +-
 12 files changed, 233 insertions(+), 198 deletions(-)

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Xtables cleanup patches
@ 2009-11-03 18:04 Jan Engelhardt
  2009-11-03 18:04 ` [PATCH 6/6] netfilter: xtables: add const qualifiers Jan Engelhardt
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Engelhardt @ 2009-11-03 18:04 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel



I am posting here already the next round of pullable patches
(that I originally wanted to get in _much_ faster) for review.

This block is mostly cleanups, simplifications. It might be worth
testing these together with the previous set if there are concerns
about speed.

-----
The following changes since commit 7891b6c280d01d52be5ecefe0db79d4b1f671a1e:
  Jan Engelhardt (1):
        netfilter: xtables: generate initial table on-demand

are available in the git repository at:

  git://dev.medozas.de/linux next

Jan Engelhardt (6):
      netfilter: iptables: remove unused function arguments
      netfilter: reduce NF_HOOK by one argument
      netfilter: get rid of the grossness in netfilter.h
      netfilter: xtables: print details on size mismatch
      netfilter: xtables: constify args in compat copying functions
      netfilter: xtables: add const qualifiers

 include/linux/netfilter.h            |   55 +++++++++++---------
 include/linux/netfilter/x_tables.h   |   12 ++--
 net/bridge/netfilter/ebtables.c      |   56 +++++++++++---------
 net/ipv4/netfilter/arp_tables.c      |   73 +++++++++++++++------------
 net/ipv4/netfilter/ip_tables.c       |   92 +++++++++++++++++++---------------
 net/ipv4/netfilter/ipt_ULOG.c        |    4 +-
 net/ipv4/netfilter/iptable_mangle.c  |   10 +---
 net/ipv6/netfilter/ip6_tables.c      |   92 ++++++++++++++++++---------------
 net/ipv6/netfilter/ip6table_mangle.c |   10 +---
 net/netfilter/x_tables.c             |   16 ++++--
 net/netfilter/xt_hashlimit.c         |    4 +-
 net/netfilter/xt_limit.c             |    4 +-
 12 files changed, 232 insertions(+), 196 deletions(-)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-02-11 17:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-11  9:14 [PATCH 6/6] netfilter: xtables: add const qualifiers Alexey Dobriyan
2010-02-11  9:27 ` Patrick McHardy
2010-02-11  9:42   ` Alexey Dobriyan
2010-02-11  9:56     ` Patrick McHardy
2010-02-11 13:12       ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2010-02-10 17:39 Code cleanups Jan Engelhardt
2010-02-10 17:39 ` [PATCH 6/6] netfilter: xtables: add const qualifiers Jan Engelhardt
2010-02-11  9:00   ` Patrick McHardy
2010-02-11 13:27     ` Jan Engelhardt
2010-02-11 16:06       ` Patrick McHardy
2010-02-11 16:22         ` Jan Engelhardt
2010-02-11 16:27           ` Patrick McHardy
2010-02-11 17:04             ` Jan Engelhardt
2009-11-03 18:04 Xtables cleanup patches Jan Engelhardt
2009-11-03 18:04 ` [PATCH 6/6] netfilter: xtables: add const qualifiers Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.