netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: jengelh@medozas.de
Cc: netfilter-devel@vger.kernel.org, kaber@trash.net
Subject: Re: [PATCH 6/6] netfilter: xtables: add const qualifiers
Date: Thu, 11 Feb 2010 11:14:41 +0200	[thread overview]
Message-ID: <b6fcc0a1002110114n3961c1b7v4cb556e4827fc137@mail.gmail.com> (raw)

> -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.

             reply	other threads:[~2010-02-11  9:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11  9:14 Alexey Dobriyan [this message]
2010-02-11  9:27 ` [PATCH 6/6] netfilter: xtables: add const qualifiers 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

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=b6fcc0a1002110114n3961c1b7v4cb556e4827fc137@mail.gmail.com \
    --to=adobriyan@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /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).