Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1349850
| From | Sinan Kaya <okaya@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver |
| Date | 2016-03-04 06:30 +0100 |
| Message-ID | <r8Qtk-1NX-13@gated-at.bofh.it> (permalink) |
| References | <qYGlz-3LM-1@gated-at.bofh.it> <qYGlB-3LM-23@gated-at.bofh.it> <r6udz-6zs-17@gated-at.bofh.it> <r8jQK-3th-7@gated-at.bofh.it> <r8KHg-66N-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 3/3/2016 6:14 PM, Eric Auger wrote:
> Hi Sinan,
> On 03/02/2016 07:34 PM, Sinan Kaya wrote:
>> On 2/26/2016 12:15 PM, Eric Auger wrote:
>>>> -module_init(reset ## _module_init); \
>>>>> +#define module_vfio_reset_handler(compat, acpihid, reset) \
>>>>> +MODULE_ALIAS("vfio-reset:" compat); \
>>> Here you need to handle alias for hid case I think
>>
>> I'm wondering what happens when Compat or ACPI string is NULL.
>>
>> MODULE_ALIAS("vfio-reset:" NULL)
>>
>> Would the kernel like it?
>
>>
>> I'd rather create an alias only when the string is not NULL. Given
>> this is a macro, I believe it won't work.
>
> Indeed I think we should create an alias only for the supported case or
> 2 aliases if both are supported.
>>
>> Can you think of any other way in the code to create the alias?
>>
> To be honest I did not find any elegant solution either. Personally I
> would move the MODULE_ALIAS for compat/acpihid outside of
> module_vfio_reset_handler macro, directly in the reset module. But maybe
> someone will propose a better solution?
>
I briefly looked at this.
#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
and it eventually becomes this
#define __MODULE_INFO(tag, name, info) \
static const char __UNIQUE_ID(name)[] \
__used __attribute__((section(".modinfo"), unused, aligned(1))) \
= __stringify(tag) "=" info
Since the info is on the right side of the equation, I'm allowed to add some
conditionals.
#define module_vfio_reset_handler(compat, acpihid, reset) \
MODULE_ALIAS("vfio-reset:" acpihid? acpihid: compat); \
This way, we'll create an alias with one of the provided strings.
--
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Eric Auger <eric.auger@linaro.org> - 2016-02-26 18:20 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Sinan Kaya <okaya@codeaurora.org> - 2016-02-26 20:30 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Sinan Kaya <okaya@codeaurora.org> - 2016-03-02 19:40 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Eric Auger <eric.auger@linaro.org> - 2016-03-04 00:20 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Sinan Kaya <okaya@codeaurora.org> - 2016-03-04 06:30 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Eric Auger <eric.auger@linaro.org> - 2016-03-07 05:20 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Sinan Kaya <okaya@codeaurora.org> - 2016-03-07 16:40 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Eric Auger <eric.auger@linaro.org> - 2016-03-08 05:50 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Sinan Kaya <okaya@codeaurora.org> - 2016-03-08 06:10 +0100
Re: [PATCH V14 8/9] vfio, platform: add support for ACPI while detecting the reset driver Sinan Kaya <okaya@codeaurora.org> - 2016-03-08 16:50 +0100
csiph-web