From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fengguang Wu Subject: Re: [can:master 239/293] net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:231: warning: passing argument 4 of 'NF_HOOK_THRESH' discards qualifiers from pointer target type Date: Thu, 20 Sep 2012 15:34:33 +0800 Message-ID: <20120920073433.GA1370@localhost> References: <20120906231958.GB7382@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mga01.intel.com ([192.55.52.88]:16795 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982Ab2ITHej (ORCPT ); Thu, 20 Sep 2012 03:34:39 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-can-owner@vger.kernel.org List-ID: To: Patrick McHardy Cc: kernel-janitors@vger.kernel.org, Pablo Neira Ayuso , linux-can@vger.kernel.org On Thu, Sep 20, 2012 at 09:14:02AM +0200, Patrick McHardy wrote: > On Tue, 11 Sep 2012, Patrick McHardy wrote: > > >On Fri, 7 Sep 2012, Fengguang Wu wrote: > > > >>Hi Patrick, > >> > >>FYI, there are new compile warnings show up in > >> > >>tree: git://gitorious.org/linux-can/linux-can-next master > >>head: bbe660a7ddf32dfe80753c6722e141bf7e4bf5d8 > >>commit: 4cdd34084d539c758d00c5dc7bf95db2e4f2bc70 [239/293] > >>netfilter: nf_conntrack_ipv6: improve fragmentation handling > >>config: avr32-atngw100_defconfig (attached as .config) > >> > >>All error/warnings: > >> > >>net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c: In function > >>'__ipv6_conntrack_in': > >>net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:231: warning: > >>passing argument 4 of 'NF_HOOK_THRESH' discards qualifiers from > >>pointer target type > >>net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:231: warning: > >>passing argument 5 of 'NF_HOOK_THRESH' discards qualifiers from > >>pointer target type > > > >Thanks, I'll look into this. > > It seems the cure for this is worse than the problem. The code > currently casts the const struct net_device pointer to non-const > for the NF_HOOK_THRES call. To avoid the cast we'd have to change > all netfilter hooks to take a non-const pointer. The alternative > would be to change the NF_HOOK functions to also take a const struct > net_device pointer, but that would require the same cast to non-const > for nf_queue, which uses dev_hold() and dev_put(), so this would > effectively just move the warning to a different place. > > nf_queue is a quite special case, normally netfilter hooks shouln't > be changing anything on the net_device, so I don't want to unconstify > the arguments. > > The compiler actually shouldn't warn about this since its an explicit > cast. I know some older versions of gcc did this, but there's no > warning with current versions of gcc and the same casts are already > present > in other parts of IPv6 conntrack. Yes, the avr32 builds are using an old gcc. Please ignore this warning. I'll teach the build system to ignore this class of warning on older gcc. Thanks, Fengguang