* [patch 1/1] Audit return code of create_proc_*
@ 2005-07-14 22:19 domen
2005-07-16 11:56 ` Ingo Oeser
0 siblings, 1 reply; 2+ messages in thread
From: domen @ 2005-07-14 22:19 UTC (permalink / raw)
To: spyro; +Cc: linux-kernel, Christophe Lucas, domen
[-- Attachment #1: return_code-arch_arm26_kernel_ecard --]
[-- Type: text/plain, Size: 1077 bytes --]
From: Christophe Lucas <clucas@rotomalug.org>
Audit return of create_proc_* functions.
Signed-off-by: Christophe Lucas <clucas@rotomalug.org>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
ecard.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
Index: quilt/arch/arm26/kernel/ecard.c
===================================================================
--- quilt.orig/arch/arm26/kernel/ecard.c
+++ quilt/arch/arm26/kernel/ecard.c
@@ -522,9 +522,16 @@ static struct proc_dir_entry *proc_bus_e
static void ecard_proc_init(void)
{
+ struct proc_dir_entry *proc_entry;
proc_bus_ecard_dir = proc_mkdir("ecard", proc_bus);
- create_proc_info_entry("devices", 0, proc_bus_ecard_dir,
- get_ecard_dev_info);
+ if (!proc_bus_ecard_dir)
+ printk(KERN_WARNING "Unable to create proc dir entry.\n");
+ else {
+ proc_entry = create_proc_info_entry("devices", 0,
+ proc_bus_ecard_dir, get_ecard_dev_info);
+ if (!proc_entry)
+ printk(KERN_WARNING "ecard: Unable to create proc entry\n");
+ }
}
#define ec_set_resource(ec,nr,st,sz,flg) \
--
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 1/1] Audit return code of create_proc_*
2005-07-14 22:19 [patch 1/1] Audit return code of create_proc_* domen
@ 2005-07-16 11:56 ` Ingo Oeser
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Oeser @ 2005-07-16 11:56 UTC (permalink / raw)
To: domen; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 858 bytes --]
Hi Domen,
On Friday 15 July 2005 00:19, you wrote:
> Audit return of create_proc_* functions.
This (and related changes) spam the log, if
kernel is compiled without /proc-support.
Kernels without /proc-support are quite common in the embedded world.
Just provide a function in a suitable header
(include/linux/proc_fs.h looks promising)
file, which contains the following:
#ifdef CONFIG_PROC_FS
#define procfs_failure(msg) do { printk(msg); } while(0)
#else
#define procfs_failure(msg) do {} while(0)
#endif
and use it instead of the direct printk call.
That way you get both: Your GCC or checking tool warning is silenced
and the log is not spammed for the embedded people.
For code, which is broken without procfs, the code
should be fixed or it should select PROC_FS in its Kconfig file.
Regards
Ingo Oeser
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-07-16 11:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-14 22:19 [patch 1/1] Audit return code of create_proc_* domen
2005-07-16 11:56 ` Ingo Oeser
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®