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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160825152647.ts6oq4sanxlbuneh@acer>
Date:   Thu, 25 Aug 2016 18:26:48 +0300
From:   Andrey Utkin <andrey_utkin@...tmail.com>
To:     Anson Jacob <ansonjacob.aj@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>, arve@...roid.com,
        riandrews@...roid.com, Staging List <devel@...verdev.osuosl.org>,
        Kernel List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: android: lowmemorykiller.c: Fix checkpatch
 warning

On Thu, Aug 25, 2016 at 11:10:25AM -0400, Anson Jacob wrote:
> Fix checkpatch.pl 'line over 80 characters' warning
> 
> Signed-off-by: Anson Jacob <ansonjacob.aj@...il.com>
> ---
>  drivers/staging/android/lowmemorykiller.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
> index 45a1b4e..80d7adf 100644
> --- a/drivers/staging/android/lowmemorykiller.c
> +++ b/drivers/staging/android/lowmemorykiller.c
> @@ -92,8 +92,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
>  	int array_size = ARRAY_SIZE(lowmem_adj);
>  	int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
>  	int other_file = global_node_page_state(NR_FILE_PAGES) -
> -						global_node_page_state(NR_SHMEM) -
> -						total_swapcache_pages();
> +				global_node_page_state(NR_SHMEM) -
> +				total_swapcache_pages();
>  
>  	if (lowmem_adj_size < array_size)
>  		array_size = lowmem_adj_size;

Indeed original alignment on opening brace here doesn't make sense.
I don't mind if your patch gets accepted, but out of curiosity I have opened
this file in vim with kernel coding style plugin loaded
(https://github.com/vivien/vim-linux-coding-style), selected the affected
lines, and reindented the selection by pressing 'gq'. It ended up with this,
being both shorter and simpler:

diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index 45a1b4e..3aef467 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -92,8 +92,7 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
 	int array_size = ARRAY_SIZE(lowmem_adj);
 	int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
 	int other_file = global_node_page_state(NR_FILE_PAGES) -
-						global_node_page_state(NR_SHMEM) -
-						total_swapcache_pages();
+		global_node_page_state(NR_SHMEM) - total_swapcache_pages();
 
 	if (lowmem_adj_size < array_size)
 		array_size = lowmem_adj_size;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ