* [PATCH] drm/modes: tag unused variables to avoid warnings
@ 2019-12-10 10:24 Benjamin Gaignard
2020-01-07 13:13 ` Benjamin Gaignard
2020-01-07 13:24 ` Thomas Zimmermann
0 siblings, 2 replies; 4+ messages in thread
From: Benjamin Gaignard @ 2019-12-10 10:24 UTC (permalink / raw)
To: jani.nikula, tzimmermann, maarten.lankhorst, mripard, sean,
airlied, daniel, yakui.zhao, benjamin.gaignard
Cc: linux-kernel, dri-devel
Some variables are set but never used. To avoid warning when compiling
with W=1 and keep the algorithm like it is tag theses variables
with _maybe_unused macro.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
---
changes in this version:
- do not modify the code to remove the unused variables
just prefix them with __maybe_unused macro.
drivers/gpu/drm/drm_modes.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 88232698d7a0..70aed4e2990d 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -233,7 +233,7 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
/* 3) Nominal HSync width (% of line period) - default 8 */
#define CVT_HSYNC_PERCENTAGE 8
unsigned int hblank_percentage;
- int vsyncandback_porch, vback_porch, hblank;
+ int vsyncandback_porch, __maybe_unused vback_porch, hblank;
/* estimated the horizontal period */
tmp1 = HV_FACTOR * 1000000 -
@@ -386,9 +386,10 @@ drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay,
int top_margin, bottom_margin;
int interlace;
unsigned int hfreq_est;
- int vsync_plus_bp, vback_porch;
- unsigned int vtotal_lines, vfieldrate_est, hperiod;
- unsigned int vfield_rate, vframe_rate;
+ int vsync_plus_bp, __maybe_unused vback_porch;
+ unsigned int vtotal_lines, __maybe_unused vfieldrate_est;
+ unsigned int __maybe_unused hperiod;
+ unsigned int vfield_rate, __maybe_unused vframe_rate;
int left_margin, right_margin;
unsigned int total_active_pixels, ideal_duty_cycle;
unsigned int hblank, total_pixels, pixel_freq;
--
2.15.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/modes: tag unused variables to avoid warnings
2019-12-10 10:24 [PATCH] drm/modes: tag unused variables to avoid warnings Benjamin Gaignard
@ 2020-01-07 13:13 ` Benjamin Gaignard
2020-01-07 13:24 ` Thomas Zimmermann
1 sibling, 0 replies; 4+ messages in thread
From: Benjamin Gaignard @ 2020-01-07 13:13 UTC (permalink / raw)
To: Benjamin Gaignard
Cc: David Airlie, ML dri-devel, Linux Kernel Mailing List,
Thomas Zimmermann, Sean Paul
Le mer. 11 déc. 2019 à 10:20, Benjamin Gaignard
<benjamin.gaignard@st.com> a écrit :
>
> Some variables are set but never used. To avoid warning when compiling
> with W=1 and keep the algorithm like it is tag theses variables
> with _maybe_unused macro.
Gentle ping.
Thanks,
Benjamin
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
> changes in this version:
> - do not modify the code to remove the unused variables
> just prefix them with __maybe_unused macro.
>
> drivers/gpu/drm/drm_modes.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 88232698d7a0..70aed4e2990d 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -233,7 +233,7 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
> /* 3) Nominal HSync width (% of line period) - default 8 */
> #define CVT_HSYNC_PERCENTAGE 8
> unsigned int hblank_percentage;
> - int vsyncandback_porch, vback_porch, hblank;
> + int vsyncandback_porch, __maybe_unused vback_porch, hblank;
>
> /* estimated the horizontal period */
> tmp1 = HV_FACTOR * 1000000 -
> @@ -386,9 +386,10 @@ drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay,
> int top_margin, bottom_margin;
> int interlace;
> unsigned int hfreq_est;
> - int vsync_plus_bp, vback_porch;
> - unsigned int vtotal_lines, vfieldrate_est, hperiod;
> - unsigned int vfield_rate, vframe_rate;
> + int vsync_plus_bp, __maybe_unused vback_porch;
> + unsigned int vtotal_lines, __maybe_unused vfieldrate_est;
> + unsigned int __maybe_unused hperiod;
> + unsigned int vfield_rate, __maybe_unused vframe_rate;
> int left_margin, right_margin;
> unsigned int total_active_pixels, ideal_duty_cycle;
> unsigned int hblank, total_pixels, pixel_freq;
> --
> 2.15.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/modes: tag unused variables to avoid warnings
2019-12-10 10:24 [PATCH] drm/modes: tag unused variables to avoid warnings Benjamin Gaignard
2020-01-07 13:13 ` Benjamin Gaignard
@ 2020-01-07 13:24 ` Thomas Zimmermann
2020-01-09 16:18 ` Benjamin GAIGNARD
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Zimmermann @ 2020-01-07 13:24 UTC (permalink / raw)
To: Benjamin Gaignard, jani.nikula, maarten.lankhorst, mripard, sean,
airlied, daniel, yakui.zhao
Cc: linux-kernel, dri-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 2114 bytes --]
Hi
Am 10.12.19 um 11:24 schrieb Benjamin Gaignard:
> Some variables are set but never used. To avoid warning when compiling
> with W=1 and keep the algorithm like it is tag theses variables
> with _maybe_unused macro.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> changes in this version:
> - do not modify the code to remove the unused variables
> just prefix them with __maybe_unused macro.
>
> drivers/gpu/drm/drm_modes.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 88232698d7a0..70aed4e2990d 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -233,7 +233,7 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
> /* 3) Nominal HSync width (% of line period) - default 8 */
> #define CVT_HSYNC_PERCENTAGE 8
> unsigned int hblank_percentage;
> - int vsyncandback_porch, vback_porch, hblank;
> + int vsyncandback_porch, __maybe_unused vback_porch, hblank;
>
> /* estimated the horizontal period */
> tmp1 = HV_FACTOR * 1000000 -
> @@ -386,9 +386,10 @@ drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay,
> int top_margin, bottom_margin;
> int interlace;
> unsigned int hfreq_est;
> - int vsync_plus_bp, vback_porch;
> - unsigned int vtotal_lines, vfieldrate_est, hperiod;
> - unsigned int vfield_rate, vframe_rate;
> + int vsync_plus_bp, __maybe_unused vback_porch;
> + unsigned int vtotal_lines, __maybe_unused vfieldrate_est;
> + unsigned int __maybe_unused hperiod;
> + unsigned int vfield_rate, __maybe_unused vframe_rate;
> int left_margin, right_margin;
> unsigned int total_active_pixels, ideal_duty_cycle;
> unsigned int hblank, total_pixels, pixel_freq;
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/modes: tag unused variables to avoid warnings
2020-01-07 13:24 ` Thomas Zimmermann
@ 2020-01-09 16:18 ` Benjamin GAIGNARD
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin GAIGNARD @ 2020-01-09 16:18 UTC (permalink / raw)
To: Thomas Zimmermann, jani.nikula, maarten.lankhorst, mripard, sean,
airlied, daniel, yakui.zhao
Cc: linux-kernel, dri-devel
On 1/7/20 2:24 PM, Thomas Zimmermann wrote:
> Hi
>
> Am 10.12.19 um 11:24 schrieb Benjamin Gaignard:
>> Some variables are set but never used. To avoid warning when compiling
>> with W=1 and keep the algorithm like it is tag theses variables
>> with _maybe_unused macro.
>>
>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Applied on drm-misc-next.
Thanks,
Benjamin
>
>> ---
>> changes in this version:
>> - do not modify the code to remove the unused variables
>> just prefix them with __maybe_unused macro.
>>
>> drivers/gpu/drm/drm_modes.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
>> index 88232698d7a0..70aed4e2990d 100644
>> --- a/drivers/gpu/drm/drm_modes.c
>> +++ b/drivers/gpu/drm/drm_modes.c
>> @@ -233,7 +233,7 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
>> /* 3) Nominal HSync width (% of line period) - default 8 */
>> #define CVT_HSYNC_PERCENTAGE 8
>> unsigned int hblank_percentage;
>> - int vsyncandback_porch, vback_porch, hblank;
>> + int vsyncandback_porch, __maybe_unused vback_porch, hblank;
>>
>> /* estimated the horizontal period */
>> tmp1 = HV_FACTOR * 1000000 -
>> @@ -386,9 +386,10 @@ drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay,
>> int top_margin, bottom_margin;
>> int interlace;
>> unsigned int hfreq_est;
>> - int vsync_plus_bp, vback_porch;
>> - unsigned int vtotal_lines, vfieldrate_est, hperiod;
>> - unsigned int vfield_rate, vframe_rate;
>> + int vsync_plus_bp, __maybe_unused vback_porch;
>> + unsigned int vtotal_lines, __maybe_unused vfieldrate_est;
>> + unsigned int __maybe_unused hperiod;
>> + unsigned int vfield_rate, __maybe_unused vframe_rate;
>> int left_margin, right_margin;
>> unsigned int total_active_pixels, ideal_duty_cycle;
>> unsigned int hblank, total_pixels, pixel_freq;
>>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-09 17:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 10:24 [PATCH] drm/modes: tag unused variables to avoid warnings Benjamin Gaignard
2020-01-07 13:13 ` Benjamin Gaignard
2020-01-07 13:24 ` Thomas Zimmermann
2020-01-09 16:18 ` Benjamin GAIGNARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).