[PATCH 1/4] void unregister_blkdev - do WARN_ON failure

2007-06-29 Thread Akinobu Mita
When unregister_blkdev() has failed, something wrong happened.
This patch adds WARN_ON to notify such badness.

Cc: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>

---
 block/genhd.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: 2.6-mm/block/genhd.c
===
--- 2.6-mm.orig/block/genhd.c
+++ 2.6-mm/block/genhd.c
@@ -120,9 +120,10 @@ int unregister_blkdev(unsigned int major
for (n = _names[index]; *n; n = &(*n)->next)
if ((*n)->major == major)
break;
-   if (!*n || strcmp((*n)->name, name))
+   if (!*n || strcmp((*n)->name, name)) {
+   WARN_ON(1);
ret = -EINVAL;
-   else {
+   } else {
p = *n;
*n = p->next;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] void unregister_blkdev - do WARN_ON failure

2007-06-29 Thread Akinobu Mita
When unregister_blkdev() has failed, something wrong happened.
This patch adds WARN_ON to notify such badness.

Cc: Jens Axboe [EMAIL PROTECTED]
Signed-off-by: Akinobu Mita [EMAIL PROTECTED]

---
 block/genhd.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: 2.6-mm/block/genhd.c
===
--- 2.6-mm.orig/block/genhd.c
+++ 2.6-mm/block/genhd.c
@@ -120,9 +120,10 @@ int unregister_blkdev(unsigned int major
for (n = major_names[index]; *n; n = (*n)-next)
if ((*n)-major == major)
break;
-   if (!*n || strcmp((*n)-name, name))
+   if (!*n || strcmp((*n)-name, name)) {
+   WARN_ON(1);
ret = -EINVAL;
-   else {
+   } else {
p = *n;
*n = p-next;
}
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/