[PATCH] sh64 (mm/fault.c): procfs_failure && create_proc*

From: Christophe Lucas
Date: Fri Aug 05 2005 - 10:49:07 EST


description:
audit return code of create_proc_* function is a entry in janitors
TODO list. Audit this return and printk() when it fails, can spam a lot
system without compiled proc support. So this patch can audit return
code by means of procfs_failure().

Signed-off-by: Christophe Lucas <clucas@xxxxxxxxxxxxx>

diff -urpNX dontdiff linux-2.6.13-rc4-mm1.orig/arch/sh64/mm/fault.c linux-2.6.13-rc4-mm1/arch/sh64/mm/fault.c
--- linux-2.6.13-rc4-mm1.orig/arch/sh64/mm/fault.c 2005-07-29 00:44:44.000000000 +0200
+++ linux-2.6.13-rc4-mm1/arch/sh64/mm/fault.c 2005-08-03 12:35:19.000000000 +0200
@@ -592,8 +592,11 @@ tlb_proc_info(char *buf, char **start, o

static int __init register_proc_tlb(void)
{
- create_proc_read_entry("tlb", 0, NULL, tlb_proc_info, NULL);
- return 0;
+ struct proc_dir_entry* ent;
+ ent = create_proc_read_entry("tlb", 0, NULL, tlb_proc_info, NULL);
+ if (!ent)
+ procfs_failure("fault.c: Unable to create tlb /proc entry.\n");
+ return 0;
}

__initcall(register_proc_tlb);
-
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/