diff mbox series

[6/6] drm/i915/params: document I915_PARAMS_FOR_EACH()

Message ID 6f012851a54433b23cb4752f9d4ef523165b1e58.1545920737.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: modparam rework prep work | expand

Commit Message

Jani Nikula Dec. 27, 2018, 2:33 p.m. UTC
Macros with this much magic in them deserve some explanatory text.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_params.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tvrtko Ursulin Dec. 31, 2018, 1:05 p.m. UTC | #1
On 27/12/2018 14:33, Jani Nikula wrote:
> Macros with this much magic in them deserve some explanatory text.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_params.h | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> index 85a9007c0ed6..98eba6728095 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -33,6 +33,15 @@ struct drm_printer;
>   #define ENABLE_GUC_SUBMISSION		BIT(0)
>   #define ENABLE_GUC_LOAD_HUC		BIT(1)
>   
> +/*
> + * Invoke param, a function-like macro, for each i915 param, with arguments:
> + *
> + * param(type, name, value)
> + *
> + * type: parameter type, one of {bool, int, unsigned int, char *}
> + * name: name of the parameter
> + * value: initial/default value of the parameter

Deliberately not in kerneldoc format, or kerneldoc doesn't work for 
macros, or I am missing something else?

Regards,

Tvrtko

> + */
>   #define I915_PARAMS_FOR_EACH(param) \
>   	param(char *, vbt_firmware, NULL) \
>   	param(int, modeset, -1) \
>
Jani Nikula Dec. 31, 2018, 1:24 p.m. UTC | #2
On Mon, 31 Dec 2018, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> On 27/12/2018 14:33, Jani Nikula wrote:
>> Macros with this much magic in them deserve some explanatory text.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_params.h | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
>> index 85a9007c0ed6..98eba6728095 100644
>> --- a/drivers/gpu/drm/i915/i915_params.h
>> +++ b/drivers/gpu/drm/i915/i915_params.h
>> @@ -33,6 +33,15 @@ struct drm_printer;
>>   #define ENABLE_GUC_SUBMISSION		BIT(0)
>>   #define ENABLE_GUC_LOAD_HUC		BIT(1)
>>   
>> +/*
>> + * Invoke param, a function-like macro, for each i915 param, with arguments:
>> + *
>> + * param(type, name, value)
>> + *
>> + * type: parameter type, one of {bool, int, unsigned int, char *}
>> + * name: name of the parameter
>> + * value: initial/default value of the parameter
>
> Deliberately not in kerneldoc format, or kerneldoc doesn't work for 
> macros, or I am missing something else?

The comment describes the parameters passed to the macro passed in as
param, so it's too many levels of abstraction for poor kernel-doc. ;)

BR,
Jani.

>
> Regards,
>
> Tvrtko
>
>> + */
>>   #define I915_PARAMS_FOR_EACH(param) \
>>   	param(char *, vbt_firmware, NULL) \
>>   	param(int, modeset, -1) \
>>
Tvrtko Ursulin Dec. 31, 2018, 3:07 p.m. UTC | #3
On 31/12/2018 13:24, Jani Nikula wrote:
> On Mon, 31 Dec 2018, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>> On 27/12/2018 14:33, Jani Nikula wrote:
>>> Macros with this much magic in them deserve some explanatory text.
>>>
>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>> ---
>>>    drivers/gpu/drm/i915/i915_params.h | 9 +++++++++
>>>    1 file changed, 9 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
>>> index 85a9007c0ed6..98eba6728095 100644
>>> --- a/drivers/gpu/drm/i915/i915_params.h
>>> +++ b/drivers/gpu/drm/i915/i915_params.h
>>> @@ -33,6 +33,15 @@ struct drm_printer;
>>>    #define ENABLE_GUC_SUBMISSION		BIT(0)
>>>    #define ENABLE_GUC_LOAD_HUC		BIT(1)
>>>    
>>> +/*
>>> + * Invoke param, a function-like macro, for each i915 param, with arguments:
>>> + *
>>> + * param(type, name, value)
>>> + *
>>> + * type: parameter type, one of {bool, int, unsigned int, char *}
>>> + * name: name of the parameter
>>> + * value: initial/default value of the parameter
>>
>> Deliberately not in kerneldoc format, or kerneldoc doesn't work for
>> macros, or I am missing something else?
> 
> The comment describes the parameters passed to the macro passed in as
> param, so it's too many levels of abstraction for poor kernel-doc. ;)

Ha! :)

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
Jani Nikula Dec. 31, 2018, 3:16 p.m. UTC | #4
On Mon, 31 Dec 2018, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> On 31/12/2018 13:24, Jani Nikula wrote:
>> On Mon, 31 Dec 2018, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>>> On 27/12/2018 14:33, Jani Nikula wrote:
>>>> Macros with this much magic in them deserve some explanatory text.
>>>>
>>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>>> ---
>>>>    drivers/gpu/drm/i915/i915_params.h | 9 +++++++++
>>>>    1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
>>>> index 85a9007c0ed6..98eba6728095 100644
>>>> --- a/drivers/gpu/drm/i915/i915_params.h
>>>> +++ b/drivers/gpu/drm/i915/i915_params.h
>>>> @@ -33,6 +33,15 @@ struct drm_printer;
>>>>    #define ENABLE_GUC_SUBMISSION		BIT(0)
>>>>    #define ENABLE_GUC_LOAD_HUC		BIT(1)
>>>>    
>>>> +/*
>>>> + * Invoke param, a function-like macro, for each i915 param, with arguments:
>>>> + *
>>>> + * param(type, name, value)
>>>> + *
>>>> + * type: parameter type, one of {bool, int, unsigned int, char *}
>>>> + * name: name of the parameter
>>>> + * value: initial/default value of the parameter
>>>
>>> Deliberately not in kerneldoc format, or kerneldoc doesn't work for
>>> macros, or I am missing something else?
>> 
>> The comment describes the parameters passed to the macro passed in as
>> param, so it's too many levels of abstraction for poor kernel-doc. ;)
>
> Ha! :)
>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Thanks, and pushed.

BR,
Jani.

>
> Regards,
>
> Tvrtko
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 85a9007c0ed6..98eba6728095 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -33,6 +33,15 @@  struct drm_printer;
 #define ENABLE_GUC_SUBMISSION		BIT(0)
 #define ENABLE_GUC_LOAD_HUC		BIT(1)
 
+/*
+ * Invoke param, a function-like macro, for each i915 param, with arguments:
+ *
+ * param(type, name, value)
+ *
+ * type: parameter type, one of {bool, int, unsigned int, char *}
+ * name: name of the parameter
+ * value: initial/default value of the parameter
+ */
 #define I915_PARAMS_FOR_EACH(param) \
 	param(char *, vbt_firmware, NULL) \
 	param(int, modeset, -1) \