* [PATCH] net: ipv6: Fix incompatible pointer type warning
@ 2013-06-03 12:21 Emil Goode
2013-06-04 9:34 ` Lorenzo Colitti
2013-06-05 0:14 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Emil Goode @ 2013-06-03 12:21 UTC (permalink / raw)
To: davem, kuznet, jmorris, yoshfuji, kaber
Cc: lorenzo, netdev, linux-kernel, kernel-janitors, Emil Goode
This fixes the sparse warning below about assignment from
incompatible pointer type.
In the following commit the third argument in function ipv6_chk_addr
was changed to const and struct nf_ipv6_ops was introduced with
the third argument of .chk_addr beeing const.
2a7851bffb008ff4882eee673da74718997b4265
("netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6")
The below commit introduced the warning as the third argument of
dummy_ipv6_chk_addr and .ipv6_chk_addr in struct pingv6_ops is
missing a const.
6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67
("net: ipv6: Add IPv6 support to the ping socket.")
Sparse output:
net/ipv6/ping.c: In function ‘pingv6_init’:
net/ipv6/ping.c:87:27: warning:
assignment from incompatible pointer type [enabled by default]
Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
include/net/ping.h | 2 +-
net/ipv6/ping.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/ping.h b/include/net/ping.h
index 9242fa0..2db4860 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -38,7 +38,7 @@ struct pingv6_ops {
void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
__be16 port, u32 info, u8 *payload);
int (*ipv6_chk_addr)(struct net *net, const struct in6_addr *addr,
- struct net_device *dev, int strict);
+ const struct net_device *dev, int strict);
};
struct ping_table {
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index a6462d6..c2e9669 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -73,7 +73,7 @@ int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
__be16 port, u32 info, u8 *payload) {}
int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
- struct net_device *dev, int strict)
+ const struct net_device *dev, int strict)
{
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] net: ipv6: Fix incompatible pointer type warning
2013-06-03 12:21 [PATCH] net: ipv6: Fix incompatible pointer type warning Emil Goode
@ 2013-06-04 9:34 ` Lorenzo Colitti
2013-06-05 0:14 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: Lorenzo Colitti @ 2013-06-04 9:34 UTC (permalink / raw)
To: Emil Goode
Cc: David Miller, kuznet, jmorris, YOSHIFUJI Hideaki, kaber,
netdev@vger.kernel.org, linux-kernel, kernel-janitors
On Mon, Jun 3, 2013 at 9:21 PM, Emil Goode <emilgoode@gmail.com> wrote:
> This fixes the sparse warning below about assignment from
> incompatible pointer type.
>
> In the following commit the third argument in function ipv6_chk_addr
> was changed to const and struct nf_ipv6_ops was introduced with
> the third argument of .chk_addr beeing const.
>
> 2a7851bffb008ff4882eee673da74718997b4265
> ("netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6")
>
> The below commit introduced the warning as the third argument of
> dummy_ipv6_chk_addr and .ipv6_chk_addr in struct pingv6_ops is
> missing a const.
>
> 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67
> ("net: ipv6: Add IPv6 support to the ping socket.")
>
> Sparse output:
>
> net/ipv6/ping.c: In function ‘pingv6_init’:
> net/ipv6/ping.c:87:27: warning:
> assignment from incompatible pointer type [enabled by default]
>
> Signed-off-by: Emil Goode <emilgoode@gmail.com>
> ---
> include/net/ping.h | 2 +-
> net/ipv6/ping.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/ping.h b/include/net/ping.h
> index 9242fa0..2db4860 100644
> --- a/include/net/ping.h
> +++ b/include/net/ping.h
> @@ -38,7 +38,7 @@ struct pingv6_ops {
> void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
> __be16 port, u32 info, u8 *payload);
> int (*ipv6_chk_addr)(struct net *net, const struct in6_addr *addr,
> - struct net_device *dev, int strict);
> + const struct net_device *dev, int strict);
> };
>
> struct ping_table {
> diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
> index a6462d6..c2e9669 100644
> --- a/net/ipv6/ping.c
> +++ b/net/ipv6/ping.c
> @@ -73,7 +73,7 @@ int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
> void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
> __be16 port, u32 info, u8 *payload) {}
> int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
> - struct net_device *dev, int strict)
> + const struct net_device *dev, int strict)
> {
> return 0;
> }
> --
> 1.7.10.4
>
Acked-by: Lorenzo Colitti <lorenzo@google.com>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] net: ipv6: Fix incompatible pointer type warning
2013-06-03 12:21 [PATCH] net: ipv6: Fix incompatible pointer type warning Emil Goode
2013-06-04 9:34 ` Lorenzo Colitti
@ 2013-06-05 0:14 ` David Miller
2013-06-05 10:23 ` Emil Goode
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2013-06-05 0:14 UTC (permalink / raw)
To: emilgoode
Cc: kuznet, jmorris, yoshfuji, kaber, lorenzo, netdev, linux-kernel,
kernel-janitors
RnJvbTogRW1pbCBHb29kZSA8ZW1pbGdvb2RlQGdtYWlsLmNvbT4NCkRhdGU6IE1vbiwgIDMgSnVu
IDIwMTMgMTQ6MjE6MDggKzAyMDANCg0KPiBUaGlzIGZpeGVzIHRoZSBzcGFyc2Ugd2FybmluZyBi
ZWxvdyBhYm91dCBhc3NpZ25tZW50IGZyb20NCj4gaW5jb21wYXRpYmxlIHBvaW50ZXIgdH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EVtaWwgR29vZGUgPGVtaWxnb29kZUBnbWFpbC5jb20+
DQoNClRoaXMgb25seSBoYXBwZW5zIHdoZW4geW91IGNvbWJpbmUgbmV0IHdpdGggbmV0LW5leHQs
IHRoZXJlZm9yZSB5b3VyDQpwYXRjaCBpc24ndCBhY3R1YWxseSByZWxldmVudCB0byBhbnkgcmVh
bCBHSVQgdHJlZS4NCg0KUGxlYXNlIG1ha2UgdGhpcyB2ZXJ5IGNsZWFyIGluIHRoZSBmdXR1cmUu
DQo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: ipv6: Fix incompatible pointer type warning
2013-06-05 0:14 ` David Miller
@ 2013-06-05 10:23 ` Emil Goode
0 siblings, 0 replies; 4+ messages in thread
From: Emil Goode @ 2013-06-05 10:23 UTC (permalink / raw)
To: David Miller
Cc: kuznet, jmorris, yoshfuji, kaber, lorenzo, netdev, linux-kernel,
kernel-janitors
Hello David,
I'm sorry, the patch applies to the linux-next tree.
In the future I will be very careful about sending patches that fix
problems related to the merging of different trees.
Best regards,
Emil Goode
On Tue, Jun 04, 2013 at 05:14:56PM -0700, David Miller wrote:
> From: Emil Goode <emilgoode@gmail.com>
> Date: Mon, 3 Jun 2013 14:21:08 +0200
>
> > This fixes the sparse warning below about assignment from
> > incompatible pointer type.
> >
> > In the following commit the third argument in function ipv6_chk_addr
> > was changed to const and struct nf_ipv6_ops was introduced with
> > the third argument of .chk_addr beeing const.
> >
> > 2a7851bffb008ff4882eee673da74718997b4265
> > ("netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6")
> >
> > The below commit introduced the warning as the third argument of
> > dummy_ipv6_chk_addr and .ipv6_chk_addr in struct pingv6_ops is
> > missing a const.
> >
> > 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67
> > ("net: ipv6: Add IPv6 support to the ping socket.")
> >
> > Sparse output:
> >
> > net/ipv6/ping.c: In function ‘pingv6_init’:
> > net/ipv6/ping.c:87:27: warning:
> > assignment from incompatible pointer type [enabled by default]
> >
> > Signed-off-by: Emil Goode <emilgoode@gmail.com>
>
> This only happens when you combine net with net-next, therefore your
> patch isn't actually relevent to any real GIT tree.
>
> Please make this very clear in the future.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-06-05 10:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 12:21 [PATCH] net: ipv6: Fix incompatible pointer type warning Emil Goode
2013-06-04 9:34 ` Lorenzo Colitti
2013-06-05 0:14 ` David Miller
2013-06-05 10:23 ` Emil Goode
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox