public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Nilsson <jesper.nilsson@axis.com>
To: Joe Perches <joe@perches.com>
Cc: Jiri Kosina <trivial@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 01/12] arch/cris: Remove unnecessary kmalloc casts
Date: Mon, 14 Jun 2010 12:59:30 +0200	[thread overview]
Message-ID: <20100614105930.GH32506@axis.com> (raw)
In-Reply-To: <d3966486cc145e7eebdb8ee11d10ed928e2203b1.1275968594.git.joe@perches.com>

On Tue, Jun 08, 2010 at 05:50:33AM +0200, Joe Perches wrote:
> And separate declaration from allocation
> Still no error checking on failure, but it probably doesn't matter.

Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/cris/arch-v32/mm/intmem.c |   13 +++++--------
>  1 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/cris/arch-v32/mm/intmem.c b/arch/cris/arch-v32/mm/intmem.c
> index 9e8b69c..1b17d92 100644
> --- a/arch/cris/arch-v32/mm/intmem.c
> +++ b/arch/cris/arch-v32/mm/intmem.c
> @@ -33,8 +33,8 @@ static void crisv32_intmem_init(void)
>  {
>  	static int initiated = 0;
>  	if (!initiated) {
> -		struct intmem_allocation* alloc =
> -		  (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
> +		struct intmem_allocation* alloc;
> +		alloc = kmalloc(sizeof *alloc, GFP_KERNEL);
>  		INIT_LIST_HEAD(&intmem_allocations);
>  		intmem_virtual = ioremap(MEM_INTMEM_START + RESERVED_SIZE,
>  					 MEM_INTMEM_SIZE - RESERVED_SIZE);
> @@ -62,9 +62,8 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
>  		if (allocation->status == STATUS_FREE &&
>  		    allocation->size >= size + alignment) {
>  			if (allocation->size > size + alignment) {
> -				struct intmem_allocation* alloc =
> -					(struct intmem_allocation*)
> -					kmalloc(sizeof *alloc, GFP_ATOMIC);
> +				struct intmem_allocation* alloc;
> +				alloc = kmalloc(sizeof *alloc, GFP_ATOMIC);
>  				alloc->status = STATUS_FREE;
>  				alloc->size = allocation->size - size -
>  					alignment;
> @@ -74,9 +73,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
>  
>  				if (alignment) {
>  					struct intmem_allocation *tmp;
> -					tmp = (struct intmem_allocation *)
> -						kmalloc(sizeof *tmp,
> -							GFP_ATOMIC);
> +					tmp = kmalloc(sizeof *tmp, GFP_ATOMIC);
>  					tmp->offset = allocation->offset;
>  					tmp->size = alignment;
>  					tmp->status = STATUS_FREE;
> -- 
> 1.7.1.244.gbdc4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

  parent reply	other threads:[~2010-06-14 11:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08  3:50 [PATCH 00/12] treewide: Remove unnecessary kmalloc casts Joe Perches
2010-06-08  3:50 ` [PATCH 01/12] arch/cris: " Joe Perches
2010-06-08  4:44   ` David Rientjes
2010-06-08 15:21     ` Joe Perches
2010-06-14 10:59   ` Jesper Nilsson [this message]
2010-06-16 15:58     ` Jiri Kosina
2010-06-08  3:50 ` [PATCH 02/12] arch/powerpc: " Joe Perches
2010-06-08  3:50 ` [PATCH 03/12] arch/x86/kernel/tlb_uv.c: " Joe Perches
2010-06-08  3:50 ` [PATCH 04/12] drivers/gpu/drm: " Joe Perches
2010-06-08  3:50 ` [PATCH 05/12] drivers/isdn/capi/capidrv.c: " Joe Perches
2010-06-08  3:50 ` [PATCH 06/12] drivers/media: Remove unnecesary " Joe Perches
2010-06-08  3:50 ` [PATCH 07/12] drivers/message/i2o/i20_config.c: Remove unnecessary " Joe Perches
2010-06-08  3:50 ` [PATCH 08/12] drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast Joe Perches
2010-06-08  3:50 ` [PATCH 09/12] drivers/s390: Remove unnecessary kmalloc casts Joe Perches
2010-06-08  3:50 ` [PATCH 10/12] drivers/serial/icom.c: " Joe Perches
2010-06-08  3:50 ` [PATCH 11/12] drivers/usb/storage/isd200.c: " Joe Perches
2010-06-08  3:50 ` [PATCH 12/12] fs/ufs/util.c: " Joe Perches
2010-06-09  7:20 ` [PATCH 00/12] treewide: " Milton Miller
2010-06-09  7:46   ` Joe Perches
2010-06-09 10:06   ` Pekka Enberg

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=20100614105930.GH32506@axis.com \
    --to=jesper.nilsson@axis.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox