From: Paul Moore <paul.moore@hp.com>
To: Joe Perches <joe@perches.com>
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
"David S. Miller" <davem@davemloft.net>,
Sage Weil <sage@newdream.net>, Samuel Ortiz <samuel@sortiz.org>,
Vlad Yasevich <vladislav.yasevich@hp.com>,
Sridhar Samudrala <sri@us.ibm.com>,
linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-decnet-user@lists.sourceforge.net,
linux-sctp@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: Remove casts of void *
Date: Tue, 14 Jun 2011 11:48:13 -0400 [thread overview]
Message-ID: <201106141148.13867.paul.moore@hp.com> (raw)
In-Reply-To: <d010144f11f9165670ac0c9e3559bf5e3191ff28.1308017857.git.joe@perches.com>
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@perches.com>
I can't speak for everyone else, but I have no objections to the NetLabel
changes.
Acked-by: Paul Moore <paul.moore@hp.com>
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Paul Moore <paul.moore@hp.com>
To: Joe Perches <joe@perches.com>
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
"David S. Miller" <davem@davemloft.net>,
Sage Weil <sage@newdream.net>, Samuel Ortiz <samuel@sortiz.org>,
Vlad Yasevich <vladislav.yasevich@hp.com>,
Sridhar Samudrala <sri@us.ibm.com>,
linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-decnet-user@lists.sourceforge.net,
linux-sctp@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: Remove casts of void *
Date: Tue, 14 Jun 2011 15:48:13 +0000 [thread overview]
Message-ID: <201106141148.13867.paul.moore@hp.com> (raw)
In-Reply-To: <d010144f11f9165670ac0c9e3559bf5e3191ff28.1308017857.git.joe@perches.com>
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@perches.com>
I can't speak for everyone else, but I have no objections to the NetLabel
changes.
Acked-by: Paul Moore <paul.moore@hp.com>
> 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
next prev parent reply other threads:[~2011-06-14 15:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 2:21 [Bridge] [PATCH net-next 0/2] net: remove casts of void * Joe Perches
2011-06-14 2:21 ` Joe Perches
2011-06-14 2:21 ` Joe Perches
2011-06-14 2:21 ` [PATCH net-next 1/2] net: Remove " Joe Perches
2011-06-14 2:21 ` Joe Perches
2011-06-14 15:48 ` Paul Moore [this message]
2011-06-14 15:48 ` Paul Moore
2011-06-17 3:23 ` David Miller
2011-06-17 3:23 ` David Miller
2011-06-17 4:52 ` Joe Perches
2011-06-17 4:54 ` David Miller
2011-06-14 2:21 ` [Bridge] [PATCH net-next 2/2] net: netfilter: " Joe Perches
2011-06-14 2:21 ` Joe Perches
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=201106141148.13867.paul.moore@hp.com \
--to=paul.moore@hp.com \
--cc=ceph-devel@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=kaber@trash.net \
--cc=linux-decnet-user@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sage@newdream.net \
--cc=samuel@sortiz.org \
--cc=sri@us.ibm.com \
--cc=vladislav.yasevich@hp.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.