Skip to contentSkip to conversation

CIFS: Remove 2 unneeded kzalloc casts

PATCH In review Ahmed S. Darwish 2 participants 2 messages Jan 6, 2007 – Jan 21, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CIFS: Remove 2 unneeded kzalloc casts

Hi,
A patch to remove two unnecessary kzalloc casts found

fs/cifs/misc.c +3 -6
index aedf683..90f95ed 100644
@@ -71,9 +71,7 @@ sesInfoAlloc(void)
 {
 	struct cifsSesInfo *ret_buf;
 
-	ret_buf =
-	    (struct cifsSesInfo *) kzalloc(sizeof (struct cifsSesInfo),
-					   GFP_KERNEL);
+	ret_buf = kzalloc(sizeof (struct cifsSesInfo), GFP_KERNEL);
 	if (ret_buf) {
 		write_lock(&GlobalSMBSeslock);
 		atomic_inc(&sesInfoAllocCount);
@@ -109,9 +107,8 @@ struct cifsTconInfo *
 tconInfoAlloc(void)
 {
 	struct cifsTconInfo *ret_buf;
-	ret_buf =
-	    (struct cifsTconInfo *) kzalloc(sizeof (struct cifsTconInfo),
-					    GFP_KERNEL);
+	ret_buf = kzalloc(sizeof (struct cifsTconInfo),
+			  GFP_KERNEL);
 	if (ret_buf) {
 		write_lock(&GlobalSMBSeslock);
 		atomic_inc(&tconInfoAllocCount);
Signature · 2 lines
Ahmed S. Darwish
http://darwish-07.blogspot.com
#1 lore raw

thx - I have added these to the cifs git tree.

Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com

"Ahmed S. Darwish" <[email protected]> wrote on 01/06/2007 07:17:44 AM:

Quoted 36 lines

Hi,
A patch to remove two unnecessary kzalloc casts found

fs/cifs/misc.c +3 -6
index aedf683..90f95ed 100644
@@ -71,9 +71,7 @@ sesInfoAlloc(void)
 {
    struct cifsSesInfo *ret_buf;
 
-   ret_buf =
-       (struct cifsSesInfo *) kzalloc(sizeof (struct cifsSesInfo),
-                  GFP_KERNEL);
+   ret_buf = kzalloc(sizeof (struct cifsSesInfo), GFP_KERNEL);
    if (ret_buf) {
       write_lock(&GlobalSMBSeslock);
       atomic_inc(&sesInfoAllocCount);
@@ -109,9 +107,8 @@ struct cifsTconInfo *
 tconInfoAlloc(void)
 {
    struct cifsTconInfo *ret_buf;
-   ret_buf =
-       (struct cifsTconInfo *) kzalloc(sizeof (struct cifsTconInfo),
-                   GFP_KERNEL);
+   ret_buf = kzalloc(sizeof (struct cifsTconInfo),
+           GFP_KERNEL);
    if (ret_buf) {
       write_lock(&GlobalSMBSeslock);
       atomic_inc(&tconInfoAllocCount);
Signature · 3 lines
-- 
Ahmed S. Darwish
http://darwish-07.blogspot.com