s2io: Remove unnecessary casts
Subsystems (3)
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
@@ -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_allocatedDavid Miller
maintainerFrom: Davidlohr Bueso <[email protected]>
Date: Thu, 13 Aug 2009 22:03:28 -0400
Quoted 4 lines
No need to cast kmalloc.
Signed-off-by Davidlohr Bueso <[email protected]>
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.
Quoted 8 lines · David Miller
From: Davidlohr Bueso <[email protected]>
Date: Thu, 13 Aug 2009 22:03:28 -0400Quoted 4 lines
No need to cast kmalloc.
Signed-off-by Davidlohr Bueso <[email protected]>
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
@@ -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_allocatedDavid Miller
maintainerFrom: Davidlohr Bueso <[email protected]>
Date: Thu, 13 Aug 2009 23:57:33 -0400
Quoted 5 lines
Ok, resubmitting and verified by checkpatch.pl
Thanks.
Signed-off-by Davidlohr Bueso <[email protected]>
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.