aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2011-07-07 15:05:55 +0200
committermaximilian attems <max@stro.at>2011-07-07 15:05:55 +0200
commitf506a82a16fa45ad34500daa70bc2ef08509d49b (patch)
tree5abb8bd1feb7323197763006b2c7eb921d7d84e9
parente1a79ac7d6fccad9b8881cdaafdc023647221033 (diff)
downloadklibc-f506a82a16fa45ad34500daa70bc2ef08509d49b.tar.gz
[klibc] tests: checkpatch fixlets
fix: WARNING: braces {} are not necessary for single statement blocks ERROR: do not use assignment in if condition WARNING: braces {} are not necessary for any arm of this statement WARNING: static char array declaration should probably be static const char Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/klibc/tests/environ.c3
-rw-r--r--usr/klibc/tests/fcntl.c3
-rw-r--r--usr/klibc/tests/setjmptest.c5
-rw-r--r--usr/klibc/tests/sigint.c2
4 files changed, 6 insertions, 7 deletions
diff --git a/usr/klibc/tests/environ.c b/usr/klibc/tests/environ.c
index b5b082de18bde..5253d515b1912 100644
--- a/usr/klibc/tests/environ.c
+++ b/usr/klibc/tests/environ.c
@@ -12,9 +12,8 @@ int main(int argc, char *argv[], char *envp[])
/* Test argc/argv */
printf("argc = %d, argv = %p\n", argc, argv);
- for (i = 0; i < argc; i++) {
+ for (i = 0; i < argc; i++)
printf("argv[%2d] = %s\n", i, argv[i]);
- }
/* Test environ */
for (i = 0; envp[i]; i++)
diff --git a/usr/klibc/tests/fcntl.c b/usr/klibc/tests/fcntl.c
index 219423e973a95..30cc900c0a296 100644
--- a/usr/klibc/tests/fcntl.c
+++ b/usr/klibc/tests/fcntl.c
@@ -23,7 +23,8 @@ int main(int argc, char *argv[])
/* Get the flags on this FD */
- if ((flags = fcntl(fd, F_GETFL)) == -1) {
+ flags = fcntl(fd, F_GETFL);
+ if (flags == -1) {
perror("F_GETFL");
exit(1);
}
diff --git a/usr/klibc/tests/setjmptest.c b/usr/klibc/tests/setjmptest.c
index 30c4e16607161..fd9cb1c58c376 100644
--- a/usr/klibc/tests/setjmptest.c
+++ b/usr/klibc/tests/setjmptest.c
@@ -15,11 +15,10 @@ void do_stuff(int v)
void recurse(int ctr, int v)
{
- if (ctr--) {
+ if (ctr--)
recurse(ctr, v);
- } else {
+ else
do_stuff(v);
- }
printf("ERROR!\n"); /* We should never get here... */
}
diff --git a/usr/klibc/tests/sigint.c b/usr/klibc/tests/sigint.c
index f11ae1f21b340..ec62e335b3074 100644
--- a/usr/klibc/tests/sigint.c
+++ b/usr/klibc/tests/sigint.c
@@ -7,7 +7,7 @@ static sig_atomic_t counter = 0;
static void sig_handler(int signum)
{
- static char msg[] = "Signal handler\n";
+ static const char msg[] = "Signal handler\n";
(void)signum;