All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: android: ion: remove unnecessary intermediate variable 'objs'
@ 2020-08-27 11:24 Valery Ivanov
  2020-08-28 10:15 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Valery Ivanov @ 2020-08-27 11:24 UTC (permalink / raw)
  To: greg; +Cc: arve, riandrews, ivalery111, linux-kernel

It is not necesssary to use 'objs' as an intermediate variable for assignment operation.

Signed-off-by: Valery Ivanov <ivalery111@gmail.com>
---
 drivers/staging/android/ion/ion.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 3c9f09506ffa..137bef25dcbc 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -523,15 +523,12 @@ static int debug_shrink_set(void *data, u64 val)
 {
 	struct ion_heap *heap = data;
 	struct shrink_control sc;
-	int objs;
 
 	sc.gfp_mask = GFP_HIGHUSER;
 	sc.nr_to_scan = val;
 
-	if (!val) {
-		objs = heap->shrinker.count_objects(&heap->shrinker, &sc);
-		sc.nr_to_scan = objs;
-	}
+	if (!val)
+		sc.nr_to_scan = heap->shrinker.count_objects(&heap->shrinker, &sc);
 
 	heap->shrinker.scan_objects(&heap->shrinker, &sc);
 	return 0;
-- 
2.25.1


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

* Re: [PATCH] staging: android: ion: remove unnecessary intermediate variable 'objs'
  2020-08-27 11:24 [PATCH] staging: android: ion: remove unnecessary intermediate variable 'objs' Valery Ivanov
@ 2020-08-28 10:15 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-08-28 10:15 UTC (permalink / raw)
  To: Valery Ivanov; +Cc: arve, riandrews, linux-kernel

On Thu, Aug 27, 2020 at 02:24:48PM +0300, Valery Ivanov wrote:
> It is not necesssary to use 'objs' as an intermediate variable for assignment operation.
> 
> Signed-off-by: Valery Ivanov <ivalery111@gmail.com>
> ---
>  drivers/staging/android/ion/ion.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index 3c9f09506ffa..137bef25dcbc 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -523,15 +523,12 @@ static int debug_shrink_set(void *data, u64 val)
>  {
>  	struct ion_heap *heap = data;
>  	struct shrink_control sc;
> -	int objs;
>  
>  	sc.gfp_mask = GFP_HIGHUSER;
>  	sc.nr_to_scan = val;
>  
> -	if (!val) {
> -		objs = heap->shrinker.count_objects(&heap->shrinker, &sc);
> -		sc.nr_to_scan = objs;
> -	}
> +	if (!val)
> +		sc.nr_to_scan = heap->shrinker.count_objects(&heap->shrinker, &sc);
>  
>  	heap->shrinker.scan_objects(&heap->shrinker, &sc);
>  	return 0;
> -- 
> 2.25.1
> 

Please use scripts/get_maintainer.pl to determine who and what mailing
list to send patches to.  You missed the actual maintainers of this
code.

thanks,

greg k-h

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

end of thread, other threads:[~2020-08-28 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 11:24 [PATCH] staging: android: ion: remove unnecessary intermediate variable 'objs' Valery Ivanov
2020-08-28 10:15 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.