Re: [KJ][PATCH]Rocket port:use mutex instead of binary semaphore

From: Roland Dreier
Date: Mon Apr 16 2007 - 13:46:55 EST


> - 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/