All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: MTD list <linux-mtd@lists.infradead.org>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Subject: [PATCH 19/27] fs-tests: integck: do not use space after cast
Date: Wed, 13 Apr 2011 18:18:59 +0300	[thread overview]
Message-ID: <1302707947-6143-20-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1302707947-6143-1-git-send-email-dedekind1@gmail.com>

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

Since we are kernel people lets use the style we are accustomed
to - no space between the cast and the variable: (type)a, not (type) a.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 tests/fs-tests/integrity/integck.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 4806acd..284a5fc 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -604,7 +604,7 @@ static void file_info_display(struct file_info *file)
 		normsg("      Directory: %s", entry->parent->name);
 		entry = entry->next_link;
 	}
-	normsg("    Length: %u", (unsigned) file->length);
+	normsg("    Length: %u", (unsigned)file->length);
 	normsg("    File was open: %s",
 	       (file->fds == NULL) ? "false" : "true");
 	normsg("    File was deleted: %s",
@@ -616,8 +616,8 @@ static void file_info_display(struct file_info *file)
 	w = file->writes;
 	while (w) {
 		normsg("        Offset: %u  Size: %u  Seed: %u  R.Off: %u",
-		       (unsigned) w->offset, (unsigned) w->size,
-		       (unsigned) w->random_seed, (unsigned) w->random_offset);
+		       (unsigned)w->offset, (unsigned)w->size,
+		       (unsigned)w->random_seed, (unsigned)w->random_offset);
 		wcnt += 1;
 		w = w->next;
 	}
@@ -629,11 +629,11 @@ static void file_info_display(struct file_info *file)
 	while (w) {
 		if (is_truncation(w))
 			normsg("        Trunc from %u to %u",
-			       (unsigned) w->offset, (unsigned) w->new_length);
+			       (unsigned)w->offset, (unsigned)w->new_length);
 		else
 			normsg("        Offset: %u  Size: %u  Seed: %u  R.Off: %u",
-			       (unsigned) w->offset, (unsigned) w->size,
-			       (unsigned) w->random_seed, (unsigned) w->random_offset);
+			       (unsigned)w->offset, (unsigned)w->size,
+			       (unsigned)w->random_seed, (unsigned)w->random_offset);
 		wcnt += 1;
 		w = w->next;
 	}
@@ -668,7 +668,7 @@ static size_t file_write_data(	struct file_info *file,
 	char buf[BUFFER_SIZE];
 
 	srand(seed);
-	CHECK(lseek(fd, offset, SEEK_SET) != (off_t) -1);
+	CHECK(lseek(fd, offset, SEEK_SET) != (off_t)-1);
 	remains = size;
 	actual = 0;
 	written = BUFFER_SIZE;
@@ -1057,7 +1057,7 @@ static void file_rewrite_data(int fd, struct write_info *w, char *buf)
 	srand(w->random_seed);
 	for (r = 0; r < w->random_offset; ++r)
 		rand();
-	CHECK(lseek(fd, w->offset, SEEK_SET) != (off_t) -1);
+	CHECK(lseek(fd, w->offset, SEEK_SET) != (off_t)-1);
 	remains = w->size;
 	written = BUFFER_SIZE;
 	while (remains) {
@@ -1095,7 +1095,7 @@ static void save_file(int fd, struct file_info *file)
 	CHECK(w_fd != -1);
 
 	/* Start at the beginning */
-	CHECK(lseek(fd, 0, SEEK_SET) != (off_t) -1);
+	CHECK(lseek(fd, 0, SEEK_SET) != (off_t)-1);
 
 	for (;;) {
 		ssize_t r = read(fd, buf, BUFFER_SIZE);
@@ -1127,7 +1127,7 @@ static void file_check_hole(	struct file_info *file,
 	size_t remains, block, i;
 	char buf[BUFFER_SIZE];
 
-	CHECK(lseek(fd, offset, SEEK_SET) != (off_t) -1);
+	CHECK(lseek(fd, offset, SEEK_SET) != (off_t)-1);
 	remains = size;
 	while (remains) {
 		if (remains > BUFFER_SIZE)
@@ -1139,8 +1139,8 @@ static void file_check_hole(	struct file_info *file,
 			if (buf[i] != 0) {
 				errmsg("file_check_hole failed at %u checking "
 				       "hole at %u size %u",
-				       (unsigned) (size - remains + i),
-				       (unsigned) offset, (unsigned) size);
+				       (unsigned)(size - remains + i),
+				       (unsigned)offset, (unsigned)size);
 				file_info_display(file);
 				save_file(fd, file);
 			}
@@ -1161,7 +1161,7 @@ static void file_check_data(	struct file_info *file,
 	srand(w->random_seed);
 	for (r = 0; r < w->random_offset; ++r)
 		rand();
-	CHECK(lseek(fd, w->offset, SEEK_SET) != (off_t) -1);
+	CHECK(lseek(fd, w->offset, SEEK_SET) != (off_t)-1);
 	remains = w->size;
 	while (remains) {
 		if (remains > BUFFER_SIZE)
@@ -1170,12 +1170,12 @@ static void file_check_data(	struct file_info *file,
 			block = remains;
 		CHECK(read(fd, buf, block) == block);
 		for (i = 0; i < block; ++i) {
-			char c = (char) rand();
+			char c = (char)rand();
 			if (buf[i] != c) {
 				errmsg("file_check_data failed at %u checking "
 				       "data at %u size %u",
-					(unsigned) (w->size - remains + i),
-					(unsigned) w->offset, (unsigned) w->size);
+					(unsigned)(w->size - remains + i),
+					(unsigned)w->offset, (unsigned)w->size);
 				file_info_display(file);
 				save_file(fd, file);
 			}
@@ -1213,7 +1213,7 @@ static void file_check(struct file_info *file, int fd)
 	pos = lseek(fd, 0, SEEK_END);
 	if (pos != file->length) {
 		errmsg("file_check failed checking length expected %u actual %u\n",
-		       (unsigned) file->length, (unsigned) pos);
+		       (unsigned)file->length, (unsigned)pos);
 		file_info_display(file);
 		save_file(fd, file);
 	}
@@ -1426,7 +1426,7 @@ static char *make_name(struct dir_info *dir)
 				name[i] = 'a' + tests_random_no(26);
 			name[i] = '\0';
 		} else
-			sprintf(name, "%u", (unsigned) tests_random_no(1000000));
+			sprintf(name, "%u", (unsigned)tests_random_no(1000000));
 		for (entry = dir->first; entry; entry = entry->next) {
 			if (strcmp(entry->name, name) == 0) {
 				found = 1;
-- 
1.7.2.3

  parent reply	other threads:[~2011-04-13 15:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13 15:18 [PATCH 00/27] mtd-utils: make integck test independent Artem Bityutskiy
2011-04-13 15:16 ` Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 01/27] fs-tests: integck: shrink dir_entry_info structure size Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 02/27] fs-tests: integck: shrink file_info " Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 03/27] fs-tests: integck: srink file_info structure even more Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 04/27] fs-tests: integck: abuse random_offset field nicer Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 05/27] fs-tests: integck: shrink write_info even more Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 06/27] fs-tests: integck: change tests defaults Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 07/27] fs-tests: integck: implement own parameters parsing Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 08/27] fs-tests: integck: clean-up copy_string Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 09/27] fs-tests: integck: get rid of tests_check_test_file_system Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 10/27] fs-tests: integck: make integck function return error Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 11/27] fs-tests: integck: move mem_page_size to fsinfo Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 12/27] fs-tests: integck: move more variables " Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 13/27] fs-tests: integck: add own get_free_space function Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 14/27] fs-tests: integck: move log10_initial_free to fsinfo Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 15/27] fs-tests: integck: remove trailing backslashes from mount point Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 16/27] fs-tests: integck: do not use tests_cat_pid Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 17/27] fs-tests: integck: clean up test directory creation Artem Bityutskiy
2011-04-13 15:18 ` [PATCH 18/27] fs-tests: integck: do not use tests_clear_dir Artem Bityutskiy
2011-04-13 15:18 ` Artem Bityutskiy [this message]
2011-04-13 15:19 ` [PATCH 20/27] fs-tests: integck: prefer to check for success Artem Bityutskiy
2011-04-13 15:19 ` [PATCH 21/27] fs-tests: integck: do not use tests_fs_is_rootfs Artem Bityutskiy
2011-04-13 15:19 ` [PATCH 22/27] fs-tests: integck: do not use tests_remount Artem Bityutskiy
2011-04-13 15:19 ` [PATCH 23/27] fs-tests: integck: do not use tests_get_total_space Artem Bityutskiy
2011-04-13 15:19 ` [PATCH 24/27] fs-tests: integck: do not use global common variables Artem Bityutskiy
2011-04-13 15:19 ` [PATCH 25/27] fs-tests: integck: do not use tests_random_no Artem Bityutskiy
2011-04-13 15:19 ` [PATCH 26/27] fs-tests: integck: implement own version of CHECK Artem Bityutskiy
2011-04-13 15:19 ` [PATCH 27/27] fs-tests: integck: do not expect max name length to be 256 Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302707947-6143-20-git-send-email-dedekind1@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=adrian.hunter@nokia.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.