All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/6] selinux: Remove unneeded k[cm]alloc() return value casts
@ 2005-12-11 19:35 Jesper Juhl
  2005-12-11 20:07   ` Jesper Juhl
  0 siblings, 1 reply; 3+ messages in thread
From: Jesper Juhl @ 2005-12-11 19:35 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Stephen.Smalley, sds, James Morris, selinux, Andrew Morton, Jesper Juhl


Remove redundant casts of k*alloc() return values in 
security/selinux/ss/services.c

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 security/selinux/ss/services.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.15-rc5-git1-orig/security/selinux/ss/services.c	2005-12-04 18:49:02.000000000 +0100
+++ linux-2.6.15-rc5-git1/security/selinux/ss/services.c	2005-12-11 19:46:39.000000000 +0100
@@ -1712,11 +1712,11 @@ int security_get_bools(int *len, char **
 		goto out;
 	}
 
-	*names = (char**)kcalloc(*len, sizeof(char*), GFP_ATOMIC);
+	*names = kcalloc(*len, sizeof(char*), GFP_ATOMIC);
 	if (!*names)
 		goto err;
 
-	*values = (int*)kcalloc(*len, sizeof(int), GFP_ATOMIC);
+	*values = kcalloc(*len, sizeof(int), GFP_ATOMIC);
 	if (!*values)
 		goto err;
 
@@ -1724,7 +1724,7 @@ int security_get_bools(int *len, char **
 		size_t name_len;
 		(*values)[i] = policydb.bool_val_to_struct[i]->state;
 		name_len = strlen(policydb.p_bool_val_to_name[i]) + 1;
-		(*names)[i] = (char*)kmalloc(sizeof(char) * name_len, GFP_ATOMIC);
+		(*names)[i] = kmalloc(sizeof(char) * name_len, GFP_ATOMIC);
 		if (!(*names)[i])
 			goto err;
 		strncpy((*names)[i], policydb.p_bool_val_to_name[i], name_len);



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 5/6] selinux: Remove unneeded k[cm]alloc() return value casts
  2005-12-11 19:35 [PATCH 5/6] selinux: Remove unneeded k[cm]alloc() return value casts Jesper Juhl
@ 2005-12-11 20:07   ` Jesper Juhl
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Juhl @ 2005-12-11 20:07 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Stephen Smalley, James Morris, selinux, Andrew Morton, Jesper Juhl

[resending this as it didn't seem to reach LKML on the first try -
sorry if you recieve it twice]


Remove redundant casts of k*alloc() return values in
security/selinux/ss/services.c

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 security/selinux/ss/services.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.15-rc5-git1-orig/security/selinux/ss/services.c  
2005-12-04 18:49:02.000000000 +0100
+++ linux-2.6.15-rc5-git1/security/selinux/ss/services.c       
2005-12-11 19:46:39.000000000 +0100
@@ -1712,11 +1712,11 @@ int security_get_bools(int *len, char **
                goto out;
        }

-       *names = (char**)kcalloc(*len, sizeof(char*), GFP_ATOMIC);
+       *names = kcalloc(*len, sizeof(char*), GFP_ATOMIC);
        if (!*names)
                goto err;

-       *values = (int*)kcalloc(*len, sizeof(int), GFP_ATOMIC);
+       *values = kcalloc(*len, sizeof(int), GFP_ATOMIC);
        if (!*values)
                goto err;

@@ -1724,7 +1724,7 @@ int security_get_bools(int *len, char **
                size_t name_len;
                (*values)[i] = policydb.bool_val_to_struct[i]->state;
                name_len = strlen(policydb.p_bool_val_to_name[i]) + 1;
-               (*names)[i] = (char*)kmalloc(sizeof(char) * name_len,
GFP_ATOMIC);
+               (*names)[i] = kmalloc(sizeof(char) * name_len, GFP_ATOMIC);
                if (!(*names)[i])
                        goto err;
                strncpy((*names)[i], policydb.p_bool_val_to_name[i], name_len);





--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 5/6] selinux: Remove unneeded k[cm]alloc() return value casts
@ 2005-12-11 20:07   ` Jesper Juhl
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Juhl @ 2005-12-11 20:07 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Stephen Smalley, James Morris, selinux, Andrew Morton, Jesper Juhl

[resending this as it didn't seem to reach LKML on the first try -
sorry if you recieve it twice]


Remove redundant casts of k*alloc() return values in
security/selinux/ss/services.c

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 security/selinux/ss/services.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.15-rc5-git1-orig/security/selinux/ss/services.c  
2005-12-04 18:49:02.000000000 +0100
+++ linux-2.6.15-rc5-git1/security/selinux/ss/services.c       
2005-12-11 19:46:39.000000000 +0100
@@ -1712,11 +1712,11 @@ int security_get_bools(int *len, char **
                goto out;
        }

-       *names = (char**)kcalloc(*len, sizeof(char*), GFP_ATOMIC);
+       *names = kcalloc(*len, sizeof(char*), GFP_ATOMIC);
        if (!*names)
                goto err;

-       *values = (int*)kcalloc(*len, sizeof(int), GFP_ATOMIC);
+       *values = kcalloc(*len, sizeof(int), GFP_ATOMIC);
        if (!*values)
                goto err;

@@ -1724,7 +1724,7 @@ int security_get_bools(int *len, char **
                size_t name_len;
                (*values)[i] = policydb.bool_val_to_struct[i]->state;
                name_len = strlen(policydb.p_bool_val_to_name[i]) + 1;
-               (*names)[i] = (char*)kmalloc(sizeof(char) * name_len,
GFP_ATOMIC);
+               (*names)[i] = kmalloc(sizeof(char) * name_len, GFP_ATOMIC);
                if (!(*names)[i])
                        goto err;
                strncpy((*names)[i], policydb.p_bool_val_to_name[i], name_len);





--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-12-13 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-11 19:35 [PATCH 5/6] selinux: Remove unneeded k[cm]alloc() return value casts Jesper Juhl
2005-12-11 20:07 ` Jesper Juhl
2005-12-11 20:07   ` Jesper Juhl

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.