From: Varsha Rao <rvarsha016@gmail.com>
To: mawilcox@microsoft.com
Cc: outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: [PATCH v3 2/3] kernel: pid: Change function return value to bool.
Date: Tue, 28 Mar 2017 10:28:32 +0530 [thread overview]
Message-ID: <58d9ed7d.03c1620a.37b95.cdfd@mx.google.com> (raw)
In-Reply-To: <cover.1490676249.git.rvarsha016@gmail.com>
Replace unsigned with unsigned int and add bool as return type for
pid_before() function. As the function is called only once in condition
for do while loop. This patch fixes the checkpatch issue.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
Changes in v3:
- Modified commit message.
- Replaced unsigned with unsigned int.
Changes in v2:
- Modified commit message.
- Changed return type of pid_before() function.
kernel/pid.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/pid.c b/kernel/pid.c
index 01fb660..bb0a1c0 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -118,7 +118,7 @@ static void free_pidmap(struct upid *upid)
/*
* If we started walking pids at 'base', is 'a' seen before 'b'?
*/
-static int pid_before(int base, int a, int b)
+static bool pid_before(int base, int a, int b)
{
/*
* This is the same as saying
@@ -126,7 +126,7 @@ static int pid_before(int base, int a, int b)
* (a - base + MAXUINT) % MAXUINT < (b - base + MAXUINT) % MAXUINT
* and that mapping orders 'a' and 'b' with respect to 'base'.
*/
- return (unsigned)(a - base) < (unsigned)(b - base);
+ return (unsigned int)(a - base) < (unsigned int)(b - base);
}
/*
--
2.9.3
next prev parent reply other threads:[~2017-03-28 4:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1490676249.git.rvarsha016@gmail.com>
2017-03-28 4:54 ` [PATCH v3 1/3] kernel: pid: Update documentation Varsha Rao
2017-03-28 4:58 ` Varsha Rao [this message]
2017-03-28 4:59 ` [PATCH v3 3/3] kernel: pid: Add blank line after declarations Varsha Rao
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=58d9ed7d.03c1620a.37b95.cdfd@mx.google.com \
--to=rvarsha016@gmail.com \
--cc=mawilcox@microsoft.com \
--cc=outreachy-kernel@googlegroups.com \
/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.