- Subject: Re: [PATCH net-next 1/2] net: Remove casts of void *
- From: Paul Moore <paul.moore@xxxxxx>
- Date: Tue, 14 Jun 2011 11:48:13 -0400
- Cc: netdev@xxxxxxxxxxxxxxx, Patrick McHardy <kaber@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Sage Weil <sage@xxxxxxxxxxxx>, Samuel Ortiz <samuel@xxxxxxxxxx>, Vlad Yasevich <vladislav.yasevich@xxxxxx>, Sridhar Samudrala <sri@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, linux-decnet-user@xxxxxxxxxxxxxxxxxxxxx, linux-sctp@xxxxxxxxxxxxxxx
- In-reply-to: <d010144f11f9165670ac0c9e3559bf5e3191ff28.1308017857.git.joe@xxxxxxxxxxx>
- Organization: Hewlett-Packard
- References: <cover.1308017857.git.joe@xxxxxxxxxxx> <d010144f11f9165670ac0c9e3559bf5e3191ff28.1308017857.git.joe@xxxxxxxxxxx>
- User-agent: KMail/1.13.7 (Linux/2.6.38-gentoo-r5; KDE/4.6.4; x86_64; ; )
On Monday, June 13, 2011 10:21:26 PM Joe Perches wrote:
> Unnecessary casts of void * clutter the code.
>
> These are the remainder casts after several specific
> patches to remove netdev_priv and dev_priv.
>
> Done via coccinelle script:
>
> $ cat cast_void_pointer.cocci
> @@
> type T;
> T *pt;
> void *pv;
> @@
>
> - pt = (T *)pv;
> + pt = pv;
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
I can't speak for everyone else, but I have no objections to the NetLabel
changes.
Acked-by: Paul Moore <paul.moore@xxxxxx>
> diff --git a/net/netlabel/netlabel_unlabeled.c
> b/net/netlabel/netlabel_unlabeled.c index 9c38658..8efd061 100644
> --- a/net/netlabel/netlabel_unlabeled.c
> +++ b/net/netlabel/netlabel_unlabeled.c
> @@ -426,10 +426,9 @@ int netlbl_unlhsh_add(struct net *net,
> audit_info);
> switch (addr_len) {
> case sizeof(struct in_addr): {
> - struct in_addr *addr4, *mask4;
> + const struct in_addr *addr4 = addr;
> + const struct in_addr *mask4 = mask;
>
> - addr4 = (struct in_addr *)addr;
> - mask4 = (struct in_addr *)mask;
> ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid);
> if (audit_buf != NULL)
> netlbl_af4list_audit_addr(audit_buf, 1,
> @@ -440,10 +439,9 @@ int netlbl_unlhsh_add(struct net *net,
> }
> #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> case sizeof(struct in6_addr): {
> - struct in6_addr *addr6, *mask6;
> + const struct in6_addr *addr6 = addr;
> + const struct in6_addr *mask6 = mask;
>
> - addr6 = (struct in6_addr *)addr;
> - mask6 = (struct in6_addr *)mask;
> ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid);
> if (audit_buf != NULL)
> netlbl_af6list_audit_addr(audit_buf, 1,
--
paul moore
linux @ hp
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux OMAP]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]