linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm:Change unlabeled block of code to a else block in the function dma_pool_free
@ 2015-07-06 23:30 Nicholas Krause
  2015-07-07 22:41 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Krause @ 2015-07-06 23:30 UTC (permalink / raw)
  To: akpm; +Cc: khalasa, bigeasy, paulmcquad, linux-mm, linux-kernel

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

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 mm/dmapool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/dmapool.c b/mm/dmapool.c
index fd5fe43..ce7ff4b 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -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) {
-- 
2.1.4

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm:Change unlabeled block of code to a else block in the function dma_pool_free
  2015-07-06 23:30 [PATCH] mm:Change unlabeled block of code to a else block in the function dma_pool_free Nicholas Krause
@ 2015-07-07 22:41 ` Andrew Morton
  2015-07-07 22:51   ` nick
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2015-07-07 22:41 UTC (permalink / raw)
  To: Nicholas Krause; +Cc: khalasa, bigeasy, paulmcquad, linux-mm, linux-kernel

On Mon,  6 Jul 2015 19:30:31 -0400 Nicholas Krause <xerofoify@gmail.com> 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
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  mm/dmapool.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/dmapool.c b/mm/dmapool.c
> index fd5fe43..ce7ff4b 100644
> --- a/mm/dmapool.c
> +++ b/mm/dmapool.c
> @@ -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 majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm:Change unlabeled block of code to a else block in the function dma_pool_free
  2015-07-07 22:41 ` Andrew Morton
@ 2015-07-07 22:51   ` nick
  0 siblings, 0 replies; 3+ messages in thread
From: nick @ 2015-07-07 22:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: khalasa, bigeasy, paulmcquad, linux-mm, linux-kernel



On 2015-07-07 06:41 PM, Andrew Morton wrote:
> On Mon,  6 Jul 2015 19:30:31 -0400 Nicholas Krause <xerofoify@gmail.com> 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
>>
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> ---
>>  mm/dmapool.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/mm/dmapool.c b/mm/dmapool.c
>> index fd5fe43..ce7ff4b 100644
>> --- a/mm/dmapool.c
>> +++ b/mm/dmapool.c
>> @@ -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 majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-07 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-06 23:30 [PATCH] mm:Change unlabeled block of code to a else block in the function dma_pool_free Nicholas Krause
2015-07-07 22:41 ` Andrew Morton
2015-07-07 22:51   ` nick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox