From: Vladimir Zapolskiy <vladimir.zapolskiy@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: Jan Kiszka <jan.kiszka@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] [PATCH] ksrc: respect struct proc_dir_entry changes in 2.6.30
Date: Thu, 11 Jun 2009 15:51:26 +0400 [thread overview]
Message-ID: <4A30EFBE.10508@domain.hid> (raw)
In-Reply-To: <1244716635.7890.134.camel@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 914 bytes --]
Thank you very much for the detailed explanation.
The updated patch is attached.
With best wishes,
Vladimir
Philippe Gerum wrote:
> On Thu, 2009-06-11 at 12:16 +0200, Jan Kiszka wrote:
>> Vladimir Zapolskiy wrote:
>>> Hi Jan,
>>> I observed that LINUX_VERSION_CODE comparisons are common enough in
>>> Xenomai code. Do you propose to make a separate header, which is
>>> included from nucleus, drivers and arch files?
>> Yes, it's common, but we also keep a lot of wrapping in asm-*/wrappers.h.
>>
>
> No, it's not that common actually. Most of them are used in the HAL,
> half of those in assembly files because we don't have assembly-level
> wrappers, and the remaining spots are located in a few RT drivers
> (namely serial, CAN and irqbench).
>
> So the canonical way to fix this is indeed to add the proper wrapper to
> include/asm-generic/wrappers.h. TIA,
>
>> Jan
>>
>> PS: Please avoid top-posts.
>>
[-- Attachment #2: 0001-Made-conditional-inclusion-of-owner-field-in-struct.patch --]
[-- Type: text/x-patch, Size: 3899 bytes --]
>From aa0d1003333982f5840879d0b435b9673986ea2f Mon Sep 17 00:00:00 2001
From: Vladimir Zapolskiy <vladimir.zapolskiy@domain.hid>
Date: Thu, 11 Jun 2009 15:26:19 +0400
Subject: [PATCH] Made conditional inclusion of owner field in struct proc_dir_entry due to changes in 2.6.30.
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@domain.hid>
---
include/asm-generic/wrappers.h | 13 +++++++++++++
ksrc/arch/generic/hal.c | 6 +++---
ksrc/drivers/comedi/device.c | 2 +-
ksrc/drivers/comedi/rtdm_interface.c | 4 ++--
ksrc/nucleus/registry.c | 2 +-
5 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index 12e4070..cbb8c43 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -523,4 +523,17 @@ static inline int wrap_raise_cap(int cap)
}
#endif /* LINUX_VERSION_CODE >= 2.6.29 */
+#ifdef CONFIG_PROC_FS
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+static inline void wrap_proc_dir_entry_owner(struct proc_dir_entry *entry)
+{
+ entry->owner = THIS_MODULE;
+}
+#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */
+#define wrap_proc_dir_entry_owner(entry)
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */
+#endif /* CONFIG_PROC_FS */
+
#endif /* _XENO_ASM_GENERIC_WRAPPERS_H */
diff --git a/ksrc/arch/generic/hal.c b/ksrc/arch/generic/hal.c
index e4f0f31..762e544 100644
--- a/ksrc/arch/generic/hal.c
+++ b/ksrc/arch/generic/hal.c
@@ -738,7 +738,7 @@ struct proc_dir_entry *rthal_add_proc_leaf(const char *name,
entry->data = data;
entry->read_proc = rdproc;
entry->write_proc = wrproc;
- entry->owner = THIS_MODULE;
+ wrap_proc_dir_entry_owner(entry);
return entry;
}
@@ -756,7 +756,7 @@ struct proc_dir_entry *rthal_add_proc_seq(const char *name,
return NULL;
entry->proc_fops = fops;
- entry->owner = THIS_MODULE;
+ wrap_proc_dir_entry_owner(entry);
if (size)
entry->size = size;
@@ -773,7 +773,7 @@ static int rthal_proc_register(void)
return -1;
}
- rthal_proc_root->owner = THIS_MODULE;
+ wrap_proc_dir_entry_owner(rthal_proc_root);
rthal_add_proc_leaf("hal", &hal_read_proc, NULL, NULL, rthal_proc_root);
rthal_add_proc_leaf("faults",
diff --git a/ksrc/drivers/comedi/device.c b/ksrc/drivers/comedi/device.c
index 51f1125..f60dfcd 100644
--- a/ksrc/drivers/comedi/device.c
+++ b/ksrc/drivers/comedi/device.c
@@ -144,7 +144,7 @@ int comedi_proc_attach(comedi_cxt_t * cxt)
entry->data = dev->transfer;
entry->write_proc = NULL;
entry->read_proc = comedi_rdproc_transfer;
- entry->owner = THIS_MODULE;
+ wrap_proc_dir_entry_owner(entry);
out_setup_proc_transfer:
/* Frees the file name buffer */
diff --git a/ksrc/drivers/comedi/rtdm_interface.c b/ksrc/drivers/comedi/rtdm_interface.c
index 7d78a45..d4ea5ac 100644
--- a/ksrc/drivers/comedi/rtdm_interface.c
+++ b/ksrc/drivers/comedi/rtdm_interface.c
@@ -78,7 +78,7 @@ int comedi_init_proc(void)
entry->data = NULL;
entry->write_proc = NULL;
entry->read_proc = comedi_rdproc_devs;
- entry->owner = THIS_MODULE;
+ wrap_proc_dir_entry_owner(enrty);
/* Creates the drivers related file */
entry = create_proc_entry("drivers", 0444, comedi_proc_root);
@@ -93,7 +93,7 @@ int comedi_init_proc(void)
entry->data = NULL;
entry->write_proc = NULL;
entry->read_proc = comedi_rdproc_drvs;
- entry->owner = THIS_MODULE;
+ wrap_proc_dir_entry_owner(enrty);
return 0;
diff --git a/ksrc/nucleus/registry.c b/ksrc/nucleus/registry.c
index 6c7ec20..6d67dfd 100644
--- a/ksrc/nucleus/registry.c
+++ b/ksrc/nucleus/registry.c
@@ -280,7 +280,7 @@ static struct proc_dir_entry *add_proc_link(const char *name,
if (!entry)
return NULL;
- entry->owner = THIS_MODULE;
+ wrap_proc_dir_entry_owner(entry);
return entry;
}
--
1.6.2.4
prev parent reply other threads:[~2009-06-11 11:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 9:16 [Xenomai-core] [PATCH] ksrc: respect struct proc_dir_entry changes in 2.6.30 Vladimir Zapolskiy
2009-06-11 9:32 ` Jan Kiszka
2009-06-11 9:52 ` Vladimir Zapolskiy
2009-06-11 10:16 ` Jan Kiszka
2009-06-11 10:37 ` Philippe Gerum
2009-06-11 11:51 ` Vladimir Zapolskiy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A30EFBE.10508@domain.hid \
--to=vladimir.zapolskiy@domain.hid \
--cc=jan.kiszka@domain.hid \
--cc=rpm@xenomai.org \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.