All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@gnu.org>
To: David Miller <davem@davemloft.net>
Cc: ram.vepa@neterion.com, santosh.rastapur@neterion.com,
	sivakumar.subramani@neterion.com, sreenivasa.honnur@neterion.com,
	anil.murthy@neterion.com, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] s2io: Remove unnecessary casts
Date: Fri, 14 Aug 2009 03:57:33 +0000	[thread overview]
Message-ID: <20090814035733.GA29707@fencepost.gnu.org> (raw)
In-Reply-To: <20090813.201452.21119996.davem@davemloft.net>

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

WARNING: multiple messages have this Message-ID (diff)
From: Davidlohr Bueso <dave@gnu.org>
To: David Miller <davem@davemloft.net>
Cc: ram.vepa@neterion.com, santosh.rastapur@neterion.com,
	sivakumar.subramani@neterion.com, sreenivasa.honnur@neterion.com,
	anil.murthy@neterion.com, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] s2io: Remove unnecessary casts
Date: Thu, 13 Aug 2009 23:57:33 -0400	[thread overview]
Message-ID: <20090814035733.GA29707@fencepost.gnu.org> (raw)
In-Reply-To: <20090813.201452.21119996.davem@davemloft.net>

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

  reply	other threads:[~2009-08-14  3:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14  2:03 [PATCH] s2io: Remove unnecessary casts Davidlohr Bueso
2009-08-14  2:03 ` Davidlohr Bueso
2009-08-14  3:14 ` David Miller
2009-08-14  3:14   ` David Miller
2009-08-14  3:57   ` Davidlohr Bueso [this message]
2009-08-14  3:57     ` Davidlohr Bueso
2009-08-14 23:38     ` David Miller
2009-08-14 23:38       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090814035733.GA29707@fencepost.gnu.org \
    --to=dave@gnu.org \
    --cc=anil.murthy@neterion.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ram.vepa@neterion.com \
    --cc=santosh.rastapur@neterion.com \
    --cc=sivakumar.subramani@neterion.com \
    --cc=sreenivasa.honnur@neterion.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.