From: Roland Dreier <rdreier@cisco.com>
To: Milind Arun Choudhary <milindchoudhary@gmail.com>
Cc: Kernel Janitors <kernel-janitors@lists.osdl.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrw Morton <akpm@linux-foundation.org>
Subject: Re: [KJ] [PATCH]Rocket port:use mutex instead of binary semaphore
Date: Mon, 16 Apr 2007 17:46:26 +0000 [thread overview]
Message-ID: <adabqho8b65.fsf@cisco.com> (raw)
In-Reply-To: <20070416174155.GA9314@arun.site> (Milind Arun Choudhary's message of "Mon, 16 Apr 2007 23:11:55 +0530")
> - down_interruptible(&info->write_sem);
> + if(mutex_lock_interruptible(&info->write_lock)){
> + return -ERESTARTSYS;
> + }
1) This is a semantic change. Of course using down_interruptible()
without checking the return value is almost certainly a bug, but have
you thought about whether returning ERESTARTSYS is correct here? If
you have, then please include the reasoning in your patch description.
(Another possibility would be to just use an uninterruptible mutex_lock())
2) The coding style for the if statement is not quite right. The
correct way is to do
if (condition)
one_liner;
(note the space between the 'if' and the '(', and no braces used)
- R.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
WARNING: multiple messages have this Message-ID (diff)
From: Roland Dreier <rdreier@cisco.com>
To: Milind Arun Choudhary <milindchoudhary@gmail.com>
Cc: Kernel Janitors <kernel-janitors@lists.osdl.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrw Morton <akpm@linux-foundation.org>
Subject: Re: [KJ][PATCH]Rocket port:use mutex instead of binary semaphore
Date: Mon, 16 Apr 2007 10:46:26 -0700 [thread overview]
Message-ID: <adabqho8b65.fsf@cisco.com> (raw)
In-Reply-To: <20070416174155.GA9314@arun.site> (Milind Arun Choudhary's message of "Mon, 16 Apr 2007 23:11:55 +0530")
> - down_interruptible(&info->write_sem);
> + if(mutex_lock_interruptible(&info->write_lock)){
> + return -ERESTARTSYS;
> + }
1) This is a semantic change. Of course using down_interruptible()
without checking the return value is almost certainly a bug, but have
you thought about whether returning ERESTARTSYS is correct here? If
you have, then please include the reasoning in your patch description.
(Another possibility would be to just use an uninterruptible mutex_lock())
2) The coding style for the if statement is not quite right. The
correct way is to do
if (condition)
one_liner;
(note the space between the 'if' and the '(', and no braces used)
- R.
next prev parent reply other threads:[~2007-04-16 17:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-16 17:41 [KJ][PATCH]Rocket port:use mutex instead of binary semaphore Milind Arun Choudhary
2007-04-16 17:53 ` [KJ] [PATCH]Rocket " Milind Arun Choudhary
2007-04-16 17:46 ` Roland Dreier [this message]
2007-04-16 17:46 ` [KJ][PATCH]Rocket " Roland Dreier
2007-04-16 18:41 ` Milind Arun Choudhary
2007-04-16 18:53 ` [KJ] [PATCH]Rocket " Milind Arun Choudhary
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=adabqho8b65.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=akpm@linux-foundation.org \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=milindchoudhary@gmail.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.