From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Dobriyan Subject: Re: [PATCH 6/6] netfilter: xtables: add const qualifiers Date: Thu, 11 Feb 2010 11:14:41 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: netfilter-devel@vger.kernel.org, kaber@trash.net To: jengelh@medozas.de Return-path: Received: from mail-iw0-f185.google.com ([209.85.223.185]:34772 "EHLO mail-iw0-f185.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043Ab0BKJOm (ORCPT ); Thu, 11 Feb 2010 04:14:42 -0500 Received: by iwn15 with SMTP id 15so1056121iwn.19 for ; Thu, 11 Feb 2010 01:14:41 -0800 (PST) Sender: netfilter-devel-owner@vger.kernel.org List-ID: > -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.