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] [thread-next>] [day] [month] [year] [list]
Message-ID: <5fb2fa11-5a58-1856-7cb9-9687637d0741@redhat.com>
Date:   Mon, 20 Mar 2023 13:05:30 -0700
From:   Tom Rix <trix@...hat.com>
To:     Xu Yilun <yilun.xu@...el.com>, Michal Simek <michal.simek@....com>
Cc:     mdf@...nel.org, hao.wu@...el.com, michal.simek@...inx.com,
        nathan@...nel.org, ndesaulniers@...gle.com,
        linux-fpga@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused
 xlnx_pr_decouple_read function


On 3/20/23 9:24 AM, Tom Rix wrote:
>
> On 3/20/23 7:16 AM, Xu Yilun wrote:
>> On 2023-03-20 at 08:40:22 +0100, Michal Simek wrote:
>>>
>>> On 3/18/23 00:06, Tom Rix wrote:
>>>> CAUTION: This message has originated from an External Source. 
>>>> Please use proper judgment and caution when opening attachments, 
>>>> clicking links, or responding to this email.
>>>>
>>>>
>>>> clang with W=1 reports
>>>> drivers/fpga/xilinx-pr-decoupler.c:37:19: error: unused function 
>>>> 'xlnx_pr_decouple_read' [-Werror,-Wunused-function]
>>>> static inline u32 xlnx_pr_decouple_read(const struct 
>>>> xlnx_pr_decoupler_data *d,
>>>>                     ^
>>>> This static function is not used, so remove it.
>>>>
>>>> Signed-off-by: Tom Rix <trix@...hat.com>
>>>> ---
>>>>    drivers/fpga/xilinx-pr-decoupler.c | 6 ------
>>>>    1 file changed, 6 deletions(-)
>>>>
>>>> diff --git a/drivers/fpga/xilinx-pr-decoupler.c 
>>>> b/drivers/fpga/xilinx-pr-decoupler.c
>>>> index 2d9c491f7be9..b6f18c07c752 100644
>>>> --- a/drivers/fpga/xilinx-pr-decoupler.c
>>>> +++ b/drivers/fpga/xilinx-pr-decoupler.c
>>>> @@ -34,12 +34,6 @@ static inline void 
>>>> xlnx_pr_decoupler_write(struct xlnx_pr_decoupler_data *d,
>>>>           writel(val, d->io_base + offset);
>>>>    }
>>>>
>>>> -static inline u32 xlnx_pr_decouple_read(const struct 
>>>> xlnx_pr_decoupler_data *d,
>>>> -                                       u32 offset)
>>>> -{
>>>> -       return readl(d->io_base + offset);
>>>> -}
>>>> -
>>>>    static int xlnx_pr_decoupler_enable_set(struct fpga_bridge 
>>>> *bridge, bool enable)
>>>>    {
>>>>           int err;
>>>> -- 
>>>> 2.27.0
>>>>
>>> It should be fixed like this instead.
>>>
>>> Thanks,
>>> Michal
>>>
>>> diff --git a/drivers/fpga/xilinx-pr-decoupler.c 
>>> b/drivers/fpga/xilinx-pr-decoupler.c
>>> index 2d9c491f7be9..58508f44cd49 100644
>>> --- a/drivers/fpga/xilinx-pr-decoupler.c
>>> +++ b/drivers/fpga/xilinx-pr-decoupler.c
>>> @@ -69,7 +69,7 @@ static int xlnx_pr_decoupler_enable_show(struct
>>> fpga_bridge *bridge)
>>>          if (err)
>>>                  return err;
>>>
>>> -       status = readl(priv->io_base);
>>> +       status = xlnx_pr_decouple_read(priv);
>> OK, I'll drop the previous fix, and waiting for the new one.
>
> Michal,
>
> Will you make this change ?

Let me provide some context.

I am cleaning up about 70 similar unused functions all over the tree.

I have removed a lot of one liner wrappers that look like this.

My opinion, to be useful the wrapper needs to be used multiple places 
and/or do something non trival otherwise we will bloat the codebase with 
with 5x lines of code to do a simple readl.

But this is subjection. If you want this change, you should make it.

Tom

>
> Tom
>
>>
>> Thanks,
>> Yilun
>>
>>>          clk_disable(priv->clk);
>>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ