lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ttevsro9.fsf@intel.com>
Date: Wed, 04 Sep 2024 12:18:30 +0300
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Andy Shevchenko
 <andriy.shevchenko@...ux.intel.com>, Rodrigo Vivi
 <rodrigo.vivi@...el.com>, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
 <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David
 Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>
Subject: Re: [PATCH v1 1/1] drm/mm: Mark drm_mm_interval_tree*() functions
 with __maybe_unused

On Fri, 30 Aug 2024, Jani Nikula <jani.nikula@...ux.intel.com> wrote:
> On Thu, 29 Aug 2024, Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
>> The INTERVAL_TREE_DEFINE() uncoditionally provides a bunch of helper
>> functions which in some cases may be not used. This, in particular,
>> prevents kernel builds with `make W=1` and CONFIG_WERROR=y:
>>
>> .../drm/drm_mm.c:152:1: error: unused function 'drm_mm_interval_tree_insert' [-Werror,-Wunused-function]
>>   152 | INTERVAL_TREE_DEFINE(struct drm_mm_node, rb,
>>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>   153 |                      u64, __subtree_last,
>>       |                      ~~~~~~~~~~~~~~~~~~~~
>>   154 |                      START, LAST, static inline, drm_mm_interval_tree)
>>       |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Fix this by marking drm_mm_interval_tree*() functions with __maybe_unused.
>>
>> Fixes: 202b52b7fbf7 ("drm: Track drm_mm nodes with an interval tree")
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
>
> As discussed in [1], the key combo is W=1 and Clang, which enables
> detection for unused static inlines.
>
> Reviewed-by: Jani Nikula <jani.nikula@...el.com>

Pushed to drm-misc-next, thanks for the patch.

BR,
Jani.

>
>
> BR,
> Jani.
>
>
> [1] https://lore.kernel.org/r/20240829155950.1141978-1-andriy.shevchenko@linux.intel.com
>
>
>> ---
>>  drivers/gpu/drm/drm_mm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
>> index 5ace481c1901..1ed68d3cd80b 100644
>> --- a/drivers/gpu/drm/drm_mm.c
>> +++ b/drivers/gpu/drm/drm_mm.c
>> @@ -151,7 +151,7 @@ static void show_leaks(struct drm_mm *mm) { }
>>  
>>  INTERVAL_TREE_DEFINE(struct drm_mm_node, rb,
>>  		     u64, __subtree_last,
>> -		     START, LAST, static inline, drm_mm_interval_tree)
>> +		     START, LAST, static inline __maybe_unused, drm_mm_interval_tree)
>>  
>>  struct drm_mm_node *
>>  __drm_mm_interval_first(const struct drm_mm *mm, u64 start, u64 last)

-- 
Jani Nikula, Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ