Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 0/7] Fat checkstyle patch set (1)

Hi (and to the mailing list, again).

This is a patch series that fixes checkpatch issues in fs/fat.

I didn't get to do all of the files, but I'll be sure to come back for
them later :)

Please let me know if I did something wrong - I'll be sure to take it on
for my next patches.

Thanks in advance
~Cruz

Cruz Julian Bishop (7):
  fs/fat: Fix a checkpatch issue in namei_msdos.c
  fs/fat: Fix some checkpatch issues in fat.h
  fs/fat: Changed indentation of some comments in fat.h
  fs/fat: Fix two checkstyle issues in cache.c
  fs/fat: Fixes some small checkpatch issues is dir.c
  fs/fat: Fix all other checkstyle issues in dir.c
  fs/fat: Fix checkpatch issues in fatent.c

 fs/fat/cache.c       |   10 ++++---
 fs/fat/dir.c         |   31 ++++++++++----------
 fs/fat/fat.h         |   78 +++++++++++++++++++++++++-------------------------
 fs/fat/fatent.c      |   10 ++++---
 fs/fat/namei_msdos.c |    2 +-
 5 files changed, 67 insertions(+), 64 deletions(-)

--

-- 
(Continue reading)

Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 2/7] fs/fat: Fix some checkpatch issues in fat.h

Mainly fixed spacing issues such as "foo * bar" and "foo= bar"

Signed-off-by: Cruz Julian Bishop <cruzjbishop <at> gmail.com>
---
 fs/fat/fat.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 88b6c29..2ef82cf 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
 <at>  <at>  -61,7 +61,7  <at>  <at>  struct msdos_sb_info {
 	unsigned short sec_per_clus; /* sectors/cluster */
 	unsigned short cluster_bits; /* log2(cluster_size) */
 	unsigned int cluster_size;   /* cluster size */
-	unsigned char fats,fat_bits; /* number of FATs, FAT bits (12 or 16) */
+	unsigned char fats, fat_bits; /* number of FATs, FAT bits (12 or 16) */
 	unsigned short fat_start;
 	unsigned long fat_length;    /* FAT start & length (sec.) */
 	unsigned long dir_start;
 <at>  <at>  -328,7 +328,7  <at>  <at>  extern long fat_generic_ioctl(struct file *filp, unsigned int cmd,
 			      unsigned long arg);
 extern const struct file_operations fat_file_operations;
 extern const struct inode_operations fat_file_inode_operations;
-extern int fat_setattr(struct dentry * dentry, struct iattr * attr);
+extern int fat_setattr(struct dentry *dentry, struct iattr *attr);
 extern void fat_truncate_blocks(struct inode *inode, loff_t offset);
 extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry,
 		       struct kstat *stat);
 <at>  <at>  -346,7 +346,7  <at>  <at>  extern int fat_fill_super(struct super_block *sb, void *data, int silent,
(Continue reading)

Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 1/7] fs/fat: Fix a checkpatch issue in namei_msdos.c

Added a space before an equals sign/operator in line 410.

Yeah, I know. It's a lame commit, but at least it works!

Signed-off-by: Cruz Julian Bishop <cruzjbishop <at> gmail.com>
---
 fs/fat/namei_msdos.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index c27c630..c1055e7 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
 <at>  <at>  -407,7 +407,7  <at>  <at>  out:
 static int msdos_unlink(struct inode *dir, struct dentry *dentry)
 {
 	struct inode *inode = dentry->d_inode;
-	struct super_block *sb= inode->i_sb;
+	struct super_block *sb = inode->i_sb;
 	struct fat_slot_info sinfo;
 	int err;

--

-- 
1.7.9.5

Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 3/7] fs/fat: Changed indentation of some comments in fat.h

The comments were not lined up properly, so I just
re-indented them.

This also fixes a stupid checkpatch issue unknowingly

Signed-off-by: Cruz Julian Bishop <cruzjbishop <at> gmail.com>
---
 fs/fat/fat.h |   72 +++++++++++++++++++++++++++++-----------------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 2ef82cf..76f036f 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
 <at>  <at>  -28,27 +28,27  <at>  <at>  struct fat_mount_options {
 	gid_t fs_gid;
 	unsigned short fs_fmask;
 	unsigned short fs_dmask;
-	unsigned short codepage;  /* Codepage for shortname conversions */
-	char *iocharset;          /* Charset used for filename input/display */
-	unsigned short shortname; /* flags for shortname display/create rule */
-	unsigned char name_check; /* r = relaxed, n = normal, s = strict */
-	unsigned char errors;	  /* On error: continue, panic, remount-ro */
+	unsigned short codepage;   /* Codepage for shortname conversions */
+	char *iocharset;           /* Charset used for filename input/display */
+	unsigned short shortname;  /* flags for shortname display/create rule */
+	unsigned char name_check;  /* r = relaxed, n = normal, s = strict */
+	unsigned char errors;	   /* On error: continue, panic, remount-ro */
 	unsigned short allow_utime;/* permission for setting the [am]time */
-	unsigned quiet:1,         /* set = fake successful chmods and chowns */
(Continue reading)

Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 4/7] fs/fat: Fix two checkpatch issues in cache.c

This does the following:
	1: Splits the arguments of a function call to stop it
		from exceeding 80 characters
	2: Re-indents the arguments of another function call
		to prevent the splitting of a quoted string.

Signed-off-by: Cruz Julian Bishop <cruzjbishop <at> gmail.com>
---
 fs/fat/cache.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 1cc7038..91ad9e1 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
 <at>  <at>  -190,7 +190,8  <at>  <at>  static void __fat_cache_inval_inode(struct inode *inode)
 	struct fat_cache *cache;

 	while (!list_empty(&i->cache_lru)) {
-		cache = list_entry(i->cache_lru.next, struct fat_cache, cache_list);
+		cache = list_entry(i->cache_lru.next,
+				   struct fat_cache, cache_list);
 		list_del_init(&cache->cache_list);
 		i->nr_caches--;
 		fat_cache_free(cache);
 <at>  <at>  -261,9 +262,10  <at>  <at>  int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus)
 		if (nr < 0)
 			goto out;
 		else if (nr == FAT_ENT_FREE) {
-			fat_fs_error_ratelimit(sb, "%s: invalid cluster chain"
(Continue reading)

Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 5/7] fs/fat: Fixes some small checkpatch issues in dir.c

This commit simply removes the spacing between function
definitions and EXPORT_SYMBOL_GPL calls, which were
previously generating warnings.

Signed-off-by: Cruz Julian Bishop <cruzjbishop <at> gmail.com>
---
 fs/fat/dir.c |    7 -------
 1 file changed, 7 deletions(-)

diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 7b1b9c1..4b04d5e 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
 <at>  <at>  -537,7 +537,6  <at>  <at>  end_of_dir:

 	return err;
 }
-
 EXPORT_SYMBOL_GPL(fat_search_long);

 struct fat_ioctl_filldir_callback {
 <at>  <at>  -892,7 +891,6  <at>  <at>  int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh,
 	}
 	return -ENOENT;
 }
-
 EXPORT_SYMBOL_GPL(fat_get_dotdot_entry);

 /* See if directory is empty */
 <at>  <at>  -915,7 +913,6  <at>  <at>  int fat_dir_empty(struct inode *dir)
(Continue reading)

Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 6/7] fs/fat: Fix all other checkpatch issues in dir.c

This does the following:

	1: Import linux/uaccess.h instead of asm.uaccess.h
	2: Stop any lines going over 80 characters
	3: Stopped setting any variables in if statements
	4: Stopped splitting quoted strings
	5: Removed unneeded parentheses

Signed-off-by: Cruz Julian Bishop <cruzjbishop <at> gmail.com>
---
 fs/fat/dir.c |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 4b04d5e..79fdec6 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
 <at>  <at>  -18,7 +18,7  <at>  <at> 
 #include <linux/time.h>
 #include <linux/buffer_head.h>
 #include <linux/compat.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <linux/kernel.h>
 #include "fat.h"

 <at>  <at>  -123,7 +123,8  <at>  <at>  static inline int fat_get_entry(struct inode *dir, loff_t *pos,
 {
 	/* Fast stuff first */
 	if (*bh && *de &&
(Continue reading)

OGAWA Hirofumi | 12 Aug 2012 12:14
Picon

Re: [PATCH 6/7] fs/fat: Fix all other checkpatch issues in dir.c

Cruz Julian Bishop <cruzjbishop <at> gmail.com> writes:

> +		charlen = t->char2uni(&nc, 1, uni);
> +

Here is strange new line.

> +		if (charlen < 0) {
>  			*uni = 0x003f;	/* a question mark */
>  			charlen = 1;

--

-- 
OGAWA Hirofumi <hirofumi <at> mail.parknet.co.jp>
Cruz Julian Bishop | 12 Aug 2012 11:44
Picon
Gravatar

[PATCH 7/7] fs/fat: Fix checkpatch issues in fatent.c

This patch does the following:

	1: Stops any lines going over 80 characters
	2: Removes a blank line before EXPORT_SYMBOL_GPL

Signed-off-by: Cruz Julian Bishop <cruzjbishop <at> gmail.com>
---
 fs/fat/fatent.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
index 31f08ab..67fd237 100644
--- a/fs/fat/fatent.c
+++ b/fs/fat/fatent.c
 <at>  <at>  -203,15 +203,18  <at>  <at>  static int fat12_ent_next(struct fat_entry *fatent)

 	fatent->entry++;
 	if (fatent->nr_bhs == 1) {
-		WARN_ON(ent12_p[0] > (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 2)));
-		WARN_ON(ent12_p[1] > (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1)));
+		WARN_ON(ent12_p[0] > (u8 *)(bhs[0]->b_data +
+							(bhs[0]->b_size - 2)));
+		WARN_ON(ent12_p[1] > (u8 *)(bhs[0]->b_data +
+							(bhs[0]->b_size - 1)));
 		if (nextp < (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1))) {
 			ent12_p[0] = nextp - 1;
 			ent12_p[1] = nextp;
 			return 1;
 		}
 	} else {
(Continue reading)

OGAWA Hirofumi | 12 Aug 2012 12:18
Picon

Re: [PATCH 0/7] Fat checkstyle patch set (1)

Cruz Julian Bishop <cruzjbishop <at> gmail.com> writes:

> Hi (and to the mailing list, again).
>
> This is a patch series that fixes checkpatch issues in fs/fat.
>
> I didn't get to do all of the files, but I'll be sure to come back for
> them later :)
>
> Please let me know if I did something wrong - I'll be sure to take it on
> for my next patches.

Is this for -mm tree? Please make sure there is no conflict.

Yeah, small patch is preferred, but it should be the logical separation,
and one patch would be better in this case, IMHO.

Personally, I'm not against this type cleanup only if there is no
conflict though (i.e. doesn't increase maintain cost). So, if akpm is
fine to take this, then I'm ok.

> Cruz Julian Bishop (7):
>   fs/fat: Fix a checkpatch issue in namei_msdos.c
>   fs/fat: Fix some checkpatch issues in fat.h
>   fs/fat: Changed indentation of some comments in fat.h
>   fs/fat: Fix two checkstyle issues in cache.c
>   fs/fat: Fixes some small checkpatch issues is dir.c
>   fs/fat: Fix all other checkstyle issues in dir.c
>   fs/fat: Fix checkpatch issues in fatent.c

(Continue reading)

Cruz Julian Bishop | 12 Aug 2012 13:01
Picon
Gravatar

Re: [PATCH 0/7] Fat checkstyle patch set (1)

On 12/08/12 20:18, OGAWA Hirofumi wrote:
> Cruz Julian Bishop <cruzjbishop <at> gmail.com> writes:
>
>> Hi (and to the mailing list, again).
>>
>> This is a patch series that fixes checkpatch issues in fs/fat.
>>
>> I didn't get to do all of the files, but I'll be sure to come back for
>> them later :)
>>
>> Please let me know if I did something wrong - I'll be sure to take it on
>> for my next patches.
> Is this for -mm tree? Please make sure there is no conflict. 
It's actually based on -next, but I think that's taken over what -mm
was doing in the past, anyway.
>
> Yeah, small patch is preferred, but it should be the logical separation,
> and one patch would be better in this case, IMHO.
>
> Personally, I'm not against this type cleanup only if there is no
> conflict though (i.e. doesn't increase maintain cost). So, if akpm is
> fine to take this, then I'm ok.
Thank you - I'll remember that in the future
>
>> Cruz Julian Bishop (7):
>>   fs/fat: Fix a checkpatch issue in namei_msdos.c
>>   fs/fat: Fix some checkpatch issues in fat.h
>>   fs/fat: Changed indentation of some comments in fat.h
>>   fs/fat: Fix two checkstyle issues in cache.c
>>   fs/fat: Fixes some small checkpatch issues is dir.c
(Continue reading)


Gmane