mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Clean up mutex_trylock noise
@ 2007-04-15 10:54 Jean Delvare
  2007-04-15 13:05 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2007-04-15 10:54 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, Ingo Molnar

Ingo Molnar's semaphore to mutex conversions left some noise on a few
trylock calls. Clean it up.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ingo Molnar <mingo@elte.hu>
---
 drivers/media/video/zoran_driver.c |    2 +-
 drivers/mtd/mtd_blkdevs.c          |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.21-rc6.orig/drivers/media/video/zoran_driver.c	2007-04-14 16:00:12.000000000 +0200
+++ linux-2.6.21-rc6/drivers/media/video/zoran_driver.c	2007-04-15 12:47:37.000000000 +0200
@@ -2034,7 +2034,7 @@ zoran_do_ioctl (struct inode *inode,
 	 * but moving the free code outside the munmap() handler fixes
 	 * all this... If someone knows why, please explain me (Ronald)
 	 */
-	if (!!mutex_trylock(&zr->resource_lock)) {
+	if (mutex_trylock(&zr->resource_lock)) {
 		/* we obtained it! Let's try to free some things */
 		if (fh->jpg_buffers.ready_to_be_freed)
 			jpg_fbuffer_free(file);
--- linux-2.6.21-rc6.orig/drivers/mtd/mtd_blkdevs.c	2007-02-04 19:44:54.000000000 +0100
+++ linux-2.6.21-rc6/drivers/mtd/mtd_blkdevs.c	2007-04-15 12:47:26.000000000 +0200
@@ -236,7 +236,7 @@ int add_mtd_blktrans_dev(struct mtd_blkt
 	int last_devnum = -1;
 	struct gendisk *gd;
 
-	if (!!mutex_trylock(&mtd_table_mutex)) {
+	if (mutex_trylock(&mtd_table_mutex)) {
 		mutex_unlock(&mtd_table_mutex);
 		BUG();
 	}
@@ -314,7 +314,7 @@ int add_mtd_blktrans_dev(struct mtd_blkt
 
 int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
 {
-	if (!!mutex_trylock(&mtd_table_mutex)) {
+	if (mutex_trylock(&mtd_table_mutex)) {
 		mutex_unlock(&mtd_table_mutex);
 		BUG();
 	}


-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Clean up mutex_trylock noise
  2007-04-15 10:54 [PATCH] Clean up mutex_trylock noise Jean Delvare
@ 2007-04-15 13:05 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2007-04-15 13:05 UTC (permalink / raw)
  To: Jean Delvare; +Cc: LKML, Andrew Morton


* Jean Delvare <khali@linux-fr.org> wrote:

> Ingo Molnar's semaphore to mutex conversions left some noise on a few 
> trylock calls. Clean it up.
> 
> Signed-off-by: Jean Delvare <khali@linux-fr.org>

> -	if (!!mutex_trylock(&zr->resource_lock)) {
> +	if (mutex_trylock(&zr->resource_lock)) {

> -	if (!!mutex_trylock(&mtd_table_mutex)) {
> +	if (mutex_trylock(&mtd_table_mutex)) {

> -	if (!!mutex_trylock(&mtd_table_mutex)) {
> +	if (mutex_trylock(&mtd_table_mutex)) {

thanks! That's one of the side-effects of scripted conversions :-/

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-15 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-15 10:54 [PATCH] Clean up mutex_trylock noise Jean Delvare
2007-04-15 13:05 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®