Skip to contentSkip to conversation

mm:Change unlabeled block of code to a else block in the function dma_pool_free

PATCH In review Nicholas Krause 2 participants 3 messages Jul 6, 2015 – Jul 7, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm:Change unlabeled block of code to a else block in the function dma_pool_free

This fixes the unlabeled block of code after the if statement that executes if the passed dma variable of type dma_addr_t minus the structure pointer page's dma member is equal to the variable offset into a else block as this block should run when the if statement check

---
 mm/dmapool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/dmapool.c +1 -2
index fd5fe43..ce7ff4b 100644
@@ -434,8 +434,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
 			       "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
 			       pool->name, vaddr, (unsigned long long)dma);
 		return;
-	}
-	{
+	} else {
 		unsigned int chain = page->offset;
 		while (chain < pool->allocation) {
 			if (chain != offset) {
Signature · 7 lines
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#1 lore raw
Quoted 15 lines · On Mon, 6 Jul 2015 19:30:31 -0400 Nicholas Krause <[email protected]> wrote:

This fixes the unlabeled block of code after the if statement that executes if the passed dma variable of type dma_addr_t minus the structure pointer page's dma member is equal to the variable offset into a else block as this block should run when the if statement check

---
 mm/dmapool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/dmapool.c +0 -0
index fd5fe43..ce7ff4b 100644

mm/dmapool.c void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma) · line 440

Quoted 9 lines
mm/dmapool.c +1 -2
@@ -434,8 +434,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
 			       "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
 			       pool->name, vaddr, (unsigned long long)dma);
 		return;
-	}
-	{
+	} else {
 		unsigned int chain = page->offset;
 		while (chain < pool->allocation) {
 			if (chain != offset) {

This patch has no effect?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#2 lore raw
Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Mon, 6 Jul 2015 19:30:31 -0400 Nicholas Krause <[email protected]> wrote:

This fixes the unlabeled block of code after the if statement that executes if the passed dma variable of type dma_addr_t minus the structure pointer page's dma member is equal to the variable offset into a else block as this block should run when the if statement check

---
 mm/dmapool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 17 lines
Quoted 5 lines
mm/dmapool.c +0 -0
index fd5fe43..ce7ff4b 100644

mm/dmapool.c void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma) · line 440

Quoted 9 lines
mm/dmapool.c +1 -2
@@ -434,8 +434,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
 			       "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
 			       pool->name, vaddr, (unsigned long long)dma);
 		return;
-	}
-	{
+	} else {
 		unsigned int chain = page->offset;
 		while (chain < pool->allocation) {
 			if (chain != offset) {

This patch has no effect?

It's a cleanup as clearly people didn't make this into a if/else statement block as clearly this needs to run if the if statement fails and making into a else block makes this easier to understand them a unnamed block. If you prefer we can just remove the brackets creating this block otherwise that's my reasoning.
Nick

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>