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] [day] [month] [year] [list]
Date:	Mon, 07 Jul 2008 15:49:59 -0700
From:	Dan Williams <dan.j.williams@...el.com>
To:	saeed <saeed@...vell.com>
Cc:	"Sosnowski, Maciej" <maciej.sosnowski@...el.com>,
	Nicolas Pitre <nico@....org>,
	Lennert Buytenhek <buytenh@...tstofly.org>,
	Russell King <linux@....linux.org.uk>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH/RFC] DMA engine driver for Marvell XOR engine


On Sun, 2008-07-06 at 04:23 -0700, saeed wrote:
> 
> > The admittedly ugly do { } while () loop in iop-adma.c assumed that
> > num_descs_in_pool is always > 1, and guarantees that idx is equal to
> > the count of allocated descriptors.  Since you changed it to a simple
> > while() loop then you should also replace idx with ->slots_allocated
> > in the rest of the routine i.e.:
> >
> >      return mv_chan->slots_allocated ? : -ENOMEM;
> done.
> Here is the updated patch:

checkpatch said:
ERROR: code indent should use tabs where possible
#636: FILE: drivers/dma/mv_xor.c:602:
+ ^Iidx = mv_chan->slots_allocated;$

WARNING: line over 80 characters
#672: FILE: drivers/dma/mv_xor.c:638:
+       return (mv_chan->slots_allocated > 0) ? mv_chan->slots_allocated : -ENOMEM;


...so I made the following quick edits before applying:

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 82f5631..f0c123c 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -599,7 +599,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
 	int num_descs_in_pool = plat_data->pool_size/MV_XOR_SLOT_SIZE;
 
 	/* Allocate descriptor slots */
- 	idx = mv_chan->slots_allocated;
+	idx = mv_chan->slots_allocated;
 	while (idx < num_descs_in_pool) {
 		slot = kzalloc(sizeof(*slot), GFP_KERNEL);
 		if (!slot) {
@@ -635,7 +635,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
 		"allocated %d descriptor slots last_used: %p\n",
 		mv_chan->slots_allocated, mv_chan->last_used);
 
-	return (mv_chan->slots_allocated > 0) ? mv_chan->slots_allocated : -ENOMEM;
+	return mv_chan->slots_allocated ? : -ENOMEM;
 }
 
 static struct dma_async_tx_descriptor *

--
Dan

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ