aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorKris Katterjohn <kjak@users.sourceforge.net>2006-01-11 18:56:43 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-11 19:32:14 -0500
commit8b3a70058bfe711b2d05ba2134178bae623183ce (patch)
tree6f9e55729938f0a935aa885d29d5a38537fa3a97 /net/ipv4
parentae0f7d5f83236a43c572a744e4bbb30e8702d821 (diff)
[NET]: Remove more unneeded typecasts on *malloc()
This removes more unneeded casts on the return value for kmalloc(), sock_kmalloc(), and vmalloc(). Signed-off-by: Kris Katterjohn <kjak@users.sourceforge.net> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/igmp.c15
-rw-r--r--net/ipv4/ip_sockglue.c6
2 files changed, 10 insertions, 11 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 34758118c10c..192092b89e53 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -975,7 +975,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im)
975 * for deleted items allows change reports to use common code with 975 * for deleted items allows change reports to use common code with
976 * non-deleted or query-response MCA's. 976 * non-deleted or query-response MCA's.
977 */ 977 */
978 pmc = (struct ip_mc_list *)kmalloc(sizeof(*pmc), GFP_KERNEL); 978 pmc = kmalloc(sizeof(*pmc), GFP_KERNEL);
979 if (!pmc) 979 if (!pmc)
980 return; 980 return;
981 memset(pmc, 0, sizeof(*pmc)); 981 memset(pmc, 0, sizeof(*pmc));
@@ -1155,7 +1155,7 @@ void ip_mc_inc_group(struct in_device *in_dev, u32 addr)
1155 } 1155 }
1156 } 1156 }
1157 1157
1158 im = (struct ip_mc_list *)kmalloc(sizeof(*im), GFP_KERNEL); 1158 im = kmalloc(sizeof(*im), GFP_KERNEL);
1159 if (!im) 1159 if (!im)
1160 goto out; 1160 goto out;
1161 1161
@@ -1476,7 +1476,7 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode,
1476 psf_prev = psf; 1476 psf_prev = psf;
1477 } 1477 }
1478 if (!psf) { 1478 if (!psf) {
1479 psf = (struct ip_sf_list *)kmalloc(sizeof(*psf), GFP_ATOMIC); 1479 psf = kmalloc(sizeof(*psf), GFP_ATOMIC);
1480 if (!psf) 1480 if (!psf)
1481 return -ENOBUFS; 1481 return -ENOBUFS;
1482 memset(psf, 0, sizeof(*psf)); 1482 memset(psf, 0, sizeof(*psf));
@@ -1659,7 +1659,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr)
1659 err = -ENOBUFS; 1659 err = -ENOBUFS;
1660 if (count >= sysctl_igmp_max_memberships) 1660 if (count >= sysctl_igmp_max_memberships)
1661 goto done; 1661 goto done;
1662 iml = (struct ip_mc_socklist *)sock_kmalloc(sk,sizeof(*iml),GFP_KERNEL); 1662 iml = sock_kmalloc(sk,sizeof(*iml),GFP_KERNEL);
1663 if (iml == NULL) 1663 if (iml == NULL)
1664 goto done; 1664 goto done;
1665 1665
@@ -1823,8 +1823,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
1823 1823
1824 if (psl) 1824 if (psl)
1825 count += psl->sl_max; 1825 count += psl->sl_max;
1826 newpsl = (struct ip_sf_socklist *)sock_kmalloc(sk, 1826 newpsl = sock_kmalloc(sk, IP_SFLSIZE(count), GFP_KERNEL);
1827 IP_SFLSIZE(count), GFP_KERNEL);
1828 if (!newpsl) { 1827 if (!newpsl) {
1829 err = -ENOBUFS; 1828 err = -ENOBUFS;
1830 goto done; 1829 goto done;
@@ -1907,8 +1906,8 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
1907 goto done; 1906 goto done;
1908 } 1907 }
1909 if (msf->imsf_numsrc) { 1908 if (msf->imsf_numsrc) {
1910 newpsl = (struct ip_sf_socklist *)sock_kmalloc(sk, 1909 newpsl = sock_kmalloc(sk, IP_SFLSIZE(msf->imsf_numsrc),
1911 IP_SFLSIZE(msf->imsf_numsrc), GFP_KERNEL); 1910 GFP_KERNEL);
1912 if (!newpsl) { 1911 if (!newpsl) {
1913 err = -ENOBUFS; 1912 err = -ENOBUFS;
1914 goto done; 1913 goto done;
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 6986e11d65cc..2bf8d782f678 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -621,7 +621,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
621 err = -ENOBUFS; 621 err = -ENOBUFS;
622 break; 622 break;
623 } 623 }
624 msf = (struct ip_msfilter *)kmalloc(optlen, GFP_KERNEL); 624 msf = kmalloc(optlen, GFP_KERNEL);
625 if (msf == 0) { 625 if (msf == 0) {
626 err = -ENOBUFS; 626 err = -ENOBUFS;
627 break; 627 break;
@@ -778,7 +778,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
778 err = -ENOBUFS; 778 err = -ENOBUFS;
779 break; 779 break;
780 } 780 }
781 gsf = (struct group_filter *)kmalloc(optlen,GFP_KERNEL); 781 gsf = kmalloc(optlen,GFP_KERNEL);
782 if (gsf == 0) { 782 if (gsf == 0) {
783 err = -ENOBUFS; 783 err = -ENOBUFS;
784 break; 784 break;
@@ -798,7 +798,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
798 goto mc_msf_out; 798 goto mc_msf_out;
799 } 799 }
800 msize = IP_MSFILTER_SIZE(gsf->gf_numsrc); 800 msize = IP_MSFILTER_SIZE(gsf->gf_numsrc);
801 msf = (struct ip_msfilter *)kmalloc(msize,GFP_KERNEL); 801 msf = kmalloc(msize,GFP_KERNEL);
802 if (msf == 0) { 802 if (msf == 0) {
803 err = -ENOBUFS; 803 err = -ENOBUFS;
804 goto mc_msf_out; 804 goto mc_msf_out;