lkml.org 
[lkml]   [2023]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] driver base: slience unused warning
On Fri, 8 Sep 2023, Su Hui wrote:

> This variable is been used but never be read, so gcc and W=1 give such
> warning.
>
> drivers/base/module.c:36:6: error:
> variable ‘no_warn’ set but not used [-Werror=unused-but-set-variable]
>
> I wanted to use "__maybe_unused" to avoid  this warning.
>
> However it seems like a wrong using of "__maybe_unused" as Greg KH said:
>
> "But no_warn is being used in this file, it's being set but not read
> which is ok. That's a real use, so this change really isn't correct,
> sorry."

The warning itself is a real issue to be sorted though. Is this a use
case for `#pragma GCC diagnostic'?

Maciej

\
 
 \ /
  Last update: 2023-10-04 17:02    [W:0.094 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site