All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Wolfgang Grandegger <wg@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] rtcan_mscan compilation.
Date: Sat, 07 Oct 2006 19:31:03 +0200	[thread overview]
Message-ID: <4527E457.705@domain.hid> (raw)
In-Reply-To: <4527B59B.1030109@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 3174 bytes --]

Wolfgang Grandegger wrote:
> Jan Kiszka wrote:
>> Wolfgang Grandegger wrote:
>>> ...
>>> Index: ksrc/drivers/can/rtcan_internal.h
>>> ===================================================================
>>> --- ksrc/drivers/can/rtcan_internal.h    (revision 1695)
>>> +++ ksrc/drivers/can/rtcan_internal.h    (working copy)
>>> @@ -111,6 +111,10 @@
>>>  
>>>  #ifndef compat_module_int_param_array
>>>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
>>> +# define compat_module_int_param(name) \
>>> +    MODULE_PARM(name, "i")
>>> +# define compat_module_charp_param(name) \
>>> +    MODULE_PARM(name, "s")
>>>  # define compat_module_byte_param_array(name, count) \
>>>      MODULE_PARM(name, "1-" __MODULE_STRING(count) "b")
>>>  # define compat_module_short_param_array(name, count) \
>>> @@ -118,6 +122,10 @@
>>>  # define compat_module_int_param_array(name, count) \
>>>      MODULE_PARM(name, "1-" __MODULE_STRING(count) "i")
>>>  #else
>>> +# define compat_module_int_param(name) \
>>> +    module_param(name, int, 0444)
>>> +# define compat_module_charp_param(name) \
>>> +    module_param(name, charp, 0444)
>>>  # define compat_module_byte_param_array(name, count) \
>>>      module_param_array(name, byte, NULL, 0444)
>>>  # define compat_module_short_param_array(name, count) \
>>
>> No need, module_param comes even with 2.4. We only need wrapping for
>> parameter arrays (due to different semantics of the macro arguments).
> 
> But with limitations, unfortunately:
> 
>   /* type is byte, short, ushort, int, uint, long, ulong, bool. (2.6
>      has more, but they are not supported).  perm is permissions when
>      it appears in sysfs: 0 means doens't appear, 0444 means read-only
>      by everyone, 0644 means changable dynamically by root, etc.  name
>      must be in scope (unlike MODULE_PARM).
>   */
>   #define module_param(name, type, perm) \
>         static inline void *__check_existence_##name(void) { return
>              &name; } \
>         MODULE_PARM(name, _MODULE_PARM_STRING_ ## type)
> 
>   #define _MODULE_PARM_STRING_byte "b"
>   #define _MODULE_PARM_STRING_short "h"
>   #define _MODULE_PARM_STRING_ushort "h"
>   #define _MODULE_PARM_STRING_int "i"
>   #define _MODULE_PARM_STRING_uint "i"
>   #define _MODULE_PARM_STRING_long "l"
>   #define _MODULE_PARM_STRING_ulong "l"
>   #define _MODULE_PARM_STRING_bool "i"
> 
> Especially "s" is missing. But it could be wrapped with:
> 
>   #define _MODULE_PARM_STRING_charp "s"
> 
> Any idea why this is not already done?

Likely because you mostly don't need it? I think mscan is an exception
here, at least from my experience.

When _MODULE_PARM_STRING_charp helps to enhance module_param on 2.4,
lets put it in Xenomai's wrapping header. I think we should also move
the parameter array over (directing it officially through the RTDM layer
can still be done later, at the latest when providing user-space
support). I would support a patch doing this as well.

> 
> I also want to replace the compat_module_*_param_array functions with
> the attached code snippet.

Ok, I'm awaiting a revised patch.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

  reply	other threads:[~2006-10-07 17:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-06 11:37 [Xenomai-help] rtcan_mscan compilation Syed Amer Gilani
2006-10-06 11:52 ` Wolfgang Grandegger
2006-10-06 19:54 ` Wolfgang Grandegger
2006-10-07  8:40   ` Jan Kiszka
2006-10-07 14:11     ` Wolfgang Grandegger
2006-10-07 17:31       ` Jan Kiszka [this message]
2006-10-08  8:35         ` Wolfgang Grandegger
2006-10-08 12:10           ` Jan Kiszka
2006-10-08 12:48             ` Wolfgang Grandegger

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=4527E457.705@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=wg@domain.hid \
    --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.