Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1220354 > unrolled thread

[PATCH] fs: isofs: Fix a coding style issue and change conditional to make it consistence

Started byMaitesin <oscar.forner.martinez@gmail.com>
First post2015-09-07 20:10 +0200
Last post2015-09-07 20:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] fs: isofs: Fix a coding style issue and change conditional to make it consistence Maitesin <oscar.forner.martinez@gmail.com> - 2015-09-07 20:10 +0200
    Re: [PATCH] fs: isofs: Fix a coding style issue and change  conditional to make it consistence Joe Perches <joe@perches.com> - 2015-09-07 20:50 +0200

#1220354 — [PATCH] fs: isofs: Fix a coding style issue and change conditional to make it consistence

FromMaitesin <oscar.forner.martinez@gmail.com>
Date2015-09-07 20:10 +0200
Subject[PATCH] fs: isofs: Fix a coding style issue and change conditional to make it consistence
Message-ID<q691E-4Hc-1@gated-at.bofh.it>
The coding style issue is the white spaces after and before the brackets in the for. The change in the conditional is to make it consistence with the other ones in the file. All other conditionals are tested like that.

Signed-off-by: Oscar Forner Martinez <oscar.forner.martinez@gmail.com>
---
 fs/isofs/compress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
index f311bf0..5750830 100644
--- a/fs/isofs/compress.c
+++ b/fs/isofs/compress.c
@@ -66,8 +66,8 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start,
 		return 0;
 	}
 	/* Empty block? */
-	if (block_size == 0) {
-		for ( i = 0 ; i < pcount ; i++ ) {
+	if (!block_size) {
+		for (i = 0 ; i < pcount ; i++) {
 			if (!pages[i])
 				continue;
 			memset(page_address(pages[i]), 0, PAGE_CACHE_SIZE);
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1220358 — Re: [PATCH] fs: isofs: Fix a coding style issue and change conditional to make it consistence

FromJoe Perches <joe@perches.com>
Date2015-09-07 20:50 +0200
SubjectRe: [PATCH] fs: isofs: Fix a coding style issue and change conditional to make it consistence
Message-ID<q69Em-5qx-5@gated-at.bofh.it>
In reply to#1220354
On Mon, 2015-09-07 at 19:08 +0100, Maitesin wrote:
> The coding style issue is the white spaces after and before the
> brackets in the for. The change in the conditional is to make it
> consistence with the other ones in the file. All other conditionals are
> tested like that.
[]
> diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
[]
> @@ -66,8 +66,8 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start,
>  		return 0;
>  	}
>  	/* Empty block? */
> -	if (block_size == 0) {
> -		for ( i = 0 ; i < pcount ; i++ ) {
> +	if (!block_size) {
> +		for (i = 0 ; i < pcount ; i++) {

Is this really useful?

Better would be to remove the spaces before the semicolons.

Also, if you really want to fix trivial whitespace things,
please fix all the trivial whitespace defects in the file.

Something like:
---
 fs/isofs/compress.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
index f311bf0..2e52716 100644
--- a/fs/isofs/compress.c
+++ b/fs/isofs/compress.c
@@ -1,5 +1,5 @@
 /* -*- linux-c -*- ------------------------------------------------------- *
- *   
+ *
  *   Copyright 2001 H. Peter Anvin - All Rights Reserved
  *
  *   This program is free software; you can redistribute it and/or modify
@@ -67,7 +67,7 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start,
 	}
 	/* Empty block? */
 	if (block_size == 0) {
-		for ( i = 0 ; i < pcount ; i++ ) {
+		for (i = 0 ; i < pcount ; i++) {
 			if (!pages[i])
 				continue;
 			memset(page_address(pages[i]), 0, PAGE_CACHE_SIZE);
@@ -103,7 +103,7 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start,
 
 	stream.workspace = zisofs_zlib_workspace;
 	mutex_lock(&zisofs_zlib_lock);
-		
+
 	zerr = zlib_inflateInit(&stream);
 	if (zerr != Z_OK) {
 		if (zerr == Z_MEM_ERROR)
@@ -111,7 +111,7 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start,
 		else
 			*errp = -EIO;
 		printk(KERN_DEBUG "zisofs: zisofs_inflateInit returned %d\n",
-			       zerr);
+		       zerr);
 		goto z_eio;
 	}
 
@@ -323,7 +323,7 @@ static int zisofs_readpage(struct file *file, struct page *page)
 		   we must do. */
 		full_page = index & (zisofs_pages_per_cblock - 1);
 		pcount = min_t(int, zisofs_pages_per_cblock,
-			end_index - (index & ~(zisofs_pages_per_cblock - 1)));
+			       end_index - (index & ~(zisofs_pages_per_cblock - 1)));
 		index -= full_page;
 	} else {
 		full_page = 0;
@@ -353,7 +353,7 @@ static int zisofs_readpage(struct file *file, struct page *page)
 			if (i != full_page)
 				page_cache_release(pages[i]);
 		}
-	}			
+	}
 
 	/* At this point, err contains 0 or -EIO depending on the "critical" page */
 	return err;
@@ -368,7 +368,7 @@ const struct address_space_operations zisofs_aops = {
 int __init zisofs_init(void)
 {
 	zisofs_zlib_workspace = vmalloc(zlib_inflate_workspacesize());
-	if ( !zisofs_zlib_workspace )
+	if (!zisofs_zlib_workspace)
 		return -ENOMEM;
 
 	return 0;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web