[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AA558DF.5024.3D1AC09D@pageexec.freemail.hu>
Date: Mon, 07 Sep 2009 21:02:55 +0200
From: pageexec@...email.hu
To: linux1394-devel@...ts.sourceforge.net,
Stefan Richter <stefanr@...6.in-berlin.de>
CC: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] firewire: core: reduce stack usage in bus reset tasklet
On 6 Sep 2009 at 18:48, Stefan Richter wrote:
> Index: linux-2.6.31-rc9/drivers/firewire/core-card.c
> ===================================================================
> --- linux-2.6.31-rc9.orig/drivers/firewire/core-card.c
> +++ linux-2.6.31-rc9/drivers/firewire/core-card.c
> @@ -38,16 +38,21 @@
>
> #include "core.h"
>
> -int fw_compute_block_crc(u32 *block)
> +int fw_compute_block_crc(u32 *block, gfp_t flags)
> {
> - __be32 be32_block[256];
> - int i, length;
> + static __be32 *be32_block;
^^^^^^
did you actually mean that to be static? if so, then you might as well allocate the
buffer statically and not worry about a runtime allocation failure.
> + int i, length = (*block >> 16) & 0xff;
> +
> + be32_block = kmalloc(length * 4, flags);
> + if (WARN_ON(!be32_block))
> + goto out;
>
> - length = (*block >> 16) & 0xff;
> for (i = 0; i < length; i++)
> be32_block[i] = cpu_to_be32(block[i + 1]);
> *block |= crc_itu_t(0, (u8 *) be32_block, length * 4);
>
> + kfree(be32_block);
> + out:
> return length;
> }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists