lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 13 Aug 2009 23:57:33 -0400
From:	Davidlohr Bueso <dave@....org>
To:	David Miller <davem@...emloft.net>
Cc:	ram.vepa@...erion.com, santosh.rastapur@...erion.com,
	sivakumar.subramani@...erion.com, sreenivasa.honnur@...erion.com,
	anil.murthy@...erion.com, netdev@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] s2io: Remove unnecessary casts

On Thu, Aug 13, 2009 at 08:14:52PM -0700, David Miller wrote:
> From: Davidlohr Bueso <dave@....org>
> Date: Thu, 13 Aug 2009 22:03:28 -0400
> 
> > 
> > No need to cast kmalloc.
> > 
> > Signed-off-by: Davidlohr Bueso <dave@....org>
> 
> Yeah but:
> 
> >  
> > -                                       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.

Signed-off-by: Davidlohr Bueso <dave@....org>

---
 drivers/net/s2io.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 458daa0..2bc62d3 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ