Skip to contentSkip to conversation

s2io: Remove unnecessary casts

PATCH Superseded Davidlohr Bueso 2 participants 4 messages Aug 14, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s2io: Remove unnecessary casts

No need to cast kmalloc.

---
 drivers/net/s2io.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/s2io.c +1 -2
index 458daa0..43a5abf 100644
@@ -870,8 +870,7 @@ static int init_shared_mem(struct s2io_nic *nic)
                                while (k != rxd_count[nic->rxd_mode]) {
                                        ba = &mac_control->rings[i].ba[j][k];
 
-                                       ba->ba_0_org = (void *) kmalloc
-                                           (BUF0_LEN + ALIGN_SIZE, GFP_KERNEL);
+                                       ba->ba_0_org = kmalloc(BUF0_LEN + ALIGN_SIZE, GFP_KERNEL);
                                        if (!ba->ba_0_org)
                                                return -ENOMEM;
                                        mem_allocated +@@ -881,8 +880,7 @@ static int init_shared_mem(struct s2io_nic *nic)
                                        tmp &= ~((unsigned long) ALIGN_SIZE);
                                        ba->ba_0 = (void *) tmp;

- ba->ba_1_org = (void *) kmalloc
- (BUF1_LEN + ALIGN_SIZE, GFP_KERNEL);

+                                       ba->ba_1_org = kmalloc(BUF1_LEN + ALIGN_SIZE, GFP_KERNEL);
                                        if (!ba->ba_1_org)
                                                return -ENOMEM;
                                        mem_allocated
maintainer
#1 lore raw

From: Davidlohr Bueso <[email protected]>
Date: Thu, 13 Aug 2009 22:03:28 -0400

Quoted 4 lines

No need to cast kmalloc.

Yeah but:

drivers/net/s2io.c static int init_shared_mem(struct s2io_nic *nic) · line 873

Quoted 4 lines
drivers/net/s2io.c +1 -2
-                                       ba->ba_0_org = (void *) kmalloc
-                                           (BUF0_LEN + ALIGN_SIZE, GFP_KERNEL);
+                                       ba->ba_0_org = kmalloc(BUF0_LEN + ALIGN_SIZE, GFP_KERNEL);

Now the code line extends way over 80 columns.

Please fix this up and resubmit.

#2 lore raw
Quoted 8 lines · David Miller

From: Davidlohr Bueso <[email protected]>
Date: Thu, 13 Aug 2009 22:03:28 -0400

Quoted 4 lines

No need to cast kmalloc.

Quoted 8 lines

Yeah but:

Review

Quoted 4 lines
(quoted diff) +1 -2
-                                       ba->ba_0_org = (void *) kmalloc
-                                           (BUF0_LEN + ALIGN_SIZE, GFP_KERNEL);
+                                       ba->ba_0_org = kmalloc(BUF0_LEN + ALIGN_SIZE, GFP_KERNEL);

Now the code line extends way over 80 columns.

Ok, resubmitting and verified by checkpatch.pl

Thanks.

---
 drivers/net/s2io.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/s2io.c +4 -2
index 458daa0..2bc62d3 100644
@@ -870,8 +870,10 @@ static int init_shared_mem(struct s2io_nic *nic)
                                while (k != rxd_count[nic->rxd_mode]) {
                                        ba = &mac_control->rings[i].ba[j][k];
 
-                                       ba->ba_0_org = (void *) kmalloc
-                                           (BUF0_LEN + ALIGN_SIZE, GFP_KERNEL);
+                                       ba->ba_0_org = kmalloc
+                                               (BUF0_LEN + ALIGN_SIZE,
+                                                GFP_KERNEL);
+
                                        if (!ba->ba_0_org)
                                                return -ENOMEM;
                                        mem_allocated +@@ -881,8 +883,10 @@ static int init_shared_mem(struct s2io_nic *nic)
                                        tmp &= ~((unsigned long) ALIGN_SIZE);
                                        ba->ba_0 = (void *) tmp;

- ba->ba_1_org = (void *) kmalloc
- (BUF1_LEN + ALIGN_SIZE, GFP_KERNEL);
+ ba->ba_1_org = kmalloc
+ (BUF1_LEN + ALIGN_SIZE,
+ GFP_KERNEL);
+

                                        if (!ba->ba_1_org)
                                                return -ENOMEM;
                                        mem_allocated
maintainer
#3 lore raw

From: Davidlohr Bueso <[email protected]>
Date: Thu, 13 Aug 2009 23:57:33 -0400

Quoted 5 lines

Ok, resubmitting and verified by checkpatch.pl

Thanks.

Your email client has corrupted the patch, turning tab characters into spaces and whatnot.

Please correct this and make a fresh, formal, resubmission (fresh subject, commit message, and all).

Thank you.