From: Varsha Rao <rvarsha016@gmail.com>
To: mawilcox@microsoft.com
Cc: outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: [PATCH v2 2/3] kernel: pid: Change function return value to bool.
Date: Mon, 27 Mar 2017 08:14:08 +0530 [thread overview]
Message-ID: <58d87c7c.c240630a.d8622.c768@mx.google.com> (raw)
In-Reply-To: <cover.1490581288.git.rvarsha016@gmail.com>
Remove unsign cast 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 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 0b0aad4..c6f7b89 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -117,7 +117,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
@@ -125,7 +125,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 (a - base) < (b - base);
}
/*
--
2.9.3
next prev parent reply other threads:[~2017-03-27 2:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1490581288.git.rvarsha016@gmail.com>
2017-03-27 2:36 ` [PATCH v2 1/3] kernel: pid: Update documentation Varsha Rao
2017-03-27 5:42 ` [Outreachy kernel] " Julia Lawall
2017-03-27 5:51 ` Julia Lawall
2017-03-27 15:50 ` Matthew Wilcox
2017-03-27 2:44 ` Varsha Rao [this message]
2017-03-27 5:30 ` [Outreachy kernel] [PATCH v2 2/3] kernel: pid: Change function return value to bool Julia Lawall
2017-03-27 7:54 ` Varsha Rao
2017-03-27 8:04 ` Julia Lawall
2017-03-27 13:47 ` Varsha Rao
2017-03-27 13:56 ` Varsha Rao
2017-03-27 21:48 ` Julia Lawall
2017-03-27 21:35 ` Julia Lawall
2017-03-27 2:45 ` [PATCH v2 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=58d87c7c.c240630a.d8622.c768@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.