All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-17 23:06 ` Tom Rix
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-17 23:06 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, michal.simek, nathan, ndesaulniers
  Cc: linux-fpga, linux-arm-kernel, linux-kernel, llvm, Tom Rix

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@redhat.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


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-17 23:06 ` Tom Rix
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-17 23:06 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, michal.simek, nathan, ndesaulniers
  Cc: linux-fpga, linux-arm-kernel, linux-kernel, llvm, Tom Rix

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@redhat.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-17 23:06 ` Tom Rix
@ 2023-03-18  9:59   ` Xu Yilun
  -1 siblings, 0 replies; 18+ messages in thread
From: Xu Yilun @ 2023-03-18  9:59 UTC (permalink / raw)
  To: Tom Rix
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm

On 2023-03-17 at 19:06:17 -0400, Tom Rix wrote:
> 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.

I prefer to move the description as the first section. If you agree, I
could do it before apply.

Acked-by: Xu Yilun <yilun.xu@intel.com>

> 
> Signed-off-by: Tom Rix <trix@redhat.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
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-18  9:59   ` Xu Yilun
  0 siblings, 0 replies; 18+ messages in thread
From: Xu Yilun @ 2023-03-18  9:59 UTC (permalink / raw)
  To: Tom Rix
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm

On 2023-03-17 at 19:06:17 -0400, Tom Rix wrote:
> 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.

I prefer to move the description as the first section. If you agree, I
could do it before apply.

Acked-by: Xu Yilun <yilun.xu@intel.com>

> 
> Signed-off-by: Tom Rix <trix@redhat.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
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-18  9:59   ` Xu Yilun
@ 2023-03-18 12:59     ` Tom Rix
  -1 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-18 12:59 UTC (permalink / raw)
  To: Xu Yilun
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm


On 3/18/23 2:59 AM, Xu Yilun wrote:
> On 2023-03-17 at 19:06:17 -0400, Tom Rix wrote:
>> 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.
> I prefer to move the description as the first section. If you agree, I
> could do it before apply.

I have no preference, that is fine.

Tom

>
> Acked-by: Xu Yilun <yilun.xu@intel.com>
>
>> Signed-off-by: Tom Rix <trix@redhat.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
>>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-18 12:59     ` Tom Rix
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-18 12:59 UTC (permalink / raw)
  To: Xu Yilun
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm


On 3/18/23 2:59 AM, Xu Yilun wrote:
> On 2023-03-17 at 19:06:17 -0400, Tom Rix wrote:
>> 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.
> I prefer to move the description as the first section. If you agree, I
> could do it before apply.

I have no preference, that is fine.

Tom

>
> Acked-by: Xu Yilun <yilun.xu@intel.com>
>
>> Signed-off-by: Tom Rix <trix@redhat.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
>>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-18 12:59     ` Tom Rix
@ 2023-03-20  1:32       ` Xu Yilun
  -1 siblings, 0 replies; 18+ messages in thread
From: Xu Yilun @ 2023-03-20  1:32 UTC (permalink / raw)
  To: Tom Rix
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm

On 2023-03-18 at 05:59:28 -0700, Tom Rix wrote:
> 
> On 3/18/23 2:59 AM, Xu Yilun wrote:
> > On 2023-03-17 at 19:06:17 -0400, Tom Rix wrote:
> > > 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.
> > I prefer to move the description as the first section. If you agree, I
> > could do it before apply.
> 
> I have no preference, that is fine.

Applied, thanks.

> 
> Tom
> 
> > 
> > Acked-by: Xu Yilun <yilun.xu@intel.com>
> > 
> > > Signed-off-by: Tom Rix <trix@redhat.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
> > > 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-20  1:32       ` Xu Yilun
  0 siblings, 0 replies; 18+ messages in thread
From: Xu Yilun @ 2023-03-20  1:32 UTC (permalink / raw)
  To: Tom Rix
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm

On 2023-03-18 at 05:59:28 -0700, Tom Rix wrote:
> 
> On 3/18/23 2:59 AM, Xu Yilun wrote:
> > On 2023-03-17 at 19:06:17 -0400, Tom Rix wrote:
> > > 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.
> > I prefer to move the description as the first section. If you agree, I
> > could do it before apply.
> 
> I have no preference, that is fine.

Applied, thanks.

> 
> Tom
> 
> > 
> > Acked-by: Xu Yilun <yilun.xu@intel.com>
> > 
> > > Signed-off-by: Tom Rix <trix@redhat.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
> > > 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-17 23:06 ` Tom Rix
@ 2023-03-20  7:40   ` Michal Simek
  -1 siblings, 0 replies; 18+ messages in thread
From: Michal Simek @ 2023-03-20  7:40 UTC (permalink / raw)
  To: Tom Rix, mdf, hao.wu, yilun.xu, michal.simek, nathan, ndesaulniers
  Cc: linux-fpga, linux-arm-kernel, linux-kernel, llvm



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@redhat.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);

         clk_disable(priv->clk);


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-20  7:40   ` Michal Simek
  0 siblings, 0 replies; 18+ messages in thread
From: Michal Simek @ 2023-03-20  7:40 UTC (permalink / raw)
  To: Tom Rix, mdf, hao.wu, yilun.xu, michal.simek, nathan, ndesaulniers
  Cc: linux-fpga, linux-arm-kernel, linux-kernel, llvm



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@redhat.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);

         clk_disable(priv->clk);


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-20  7:40   ` Michal Simek
@ 2023-03-20 14:16     ` Xu Yilun
  -1 siblings, 0 replies; 18+ messages in thread
From: Xu Yilun @ 2023-03-20 14:16 UTC (permalink / raw)
  To: Michal Simek
  Cc: Tom Rix, mdf, hao.wu, michal.simek, nathan, ndesaulniers,
	linux-fpga, linux-arm-kernel, linux-kernel, llvm

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@redhat.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.

Thanks,
Yilun

> 
>         clk_disable(priv->clk);
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-20 14:16     ` Xu Yilun
  0 siblings, 0 replies; 18+ messages in thread
From: Xu Yilun @ 2023-03-20 14:16 UTC (permalink / raw)
  To: Michal Simek
  Cc: Tom Rix, mdf, hao.wu, michal.simek, nathan, ndesaulniers,
	linux-fpga, linux-arm-kernel, linux-kernel, llvm

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@redhat.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.

Thanks,
Yilun

> 
>         clk_disable(priv->clk);
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-20 14:16     ` Xu Yilun
@ 2023-03-20 16:24       ` Tom Rix
  -1 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-20 16:24 UTC (permalink / raw)
  To: Xu Yilun, Michal Simek
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm


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@redhat.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 ?

Tom

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-20 16:24       ` Tom Rix
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-20 16:24 UTC (permalink / raw)
  To: Xu Yilun, Michal Simek
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm


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@redhat.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 ?

Tom

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-20 16:24       ` Tom Rix
@ 2023-03-20 20:05         ` Tom Rix
  -1 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-20 20:05 UTC (permalink / raw)
  To: Xu Yilun, Michal Simek
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm


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@redhat.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);
>>>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-20 20:05         ` Tom Rix
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rix @ 2023-03-20 20:05 UTC (permalink / raw)
  To: Xu Yilun, Michal Simek
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm


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@redhat.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);
>>>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
  2023-03-20 20:05         ` Tom Rix
@ 2023-03-21 15:35           ` Michal Simek
  -1 siblings, 0 replies; 18+ messages in thread
From: Michal Simek @ 2023-03-21 15:35 UTC (permalink / raw)
  To: Tom Rix, Xu Yilun
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm



On 3/20/23 21:05, Tom Rix wrote:
> 
> 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@redhat.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.

I understand your position. From my perspective when drivers use these wrappers 
around io functions they are pretty much prepared to be easily extended for 
other access method. And also it helps with debugging.

I sent the patch here.
https://lore.kernel.org/r/0381e4e8061c2fee182a104768e84feff3a82d25.1679412800.git.michal.simek@amd.com

Thanks,
Michal


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function
@ 2023-03-21 15:35           ` Michal Simek
  0 siblings, 0 replies; 18+ messages in thread
From: Michal Simek @ 2023-03-21 15:35 UTC (permalink / raw)
  To: Tom Rix, Xu Yilun
  Cc: mdf, hao.wu, michal.simek, nathan, ndesaulniers, linux-fpga,
	linux-arm-kernel, linux-kernel, llvm



On 3/20/23 21:05, Tom Rix wrote:
> 
> 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@redhat.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.

I understand your position. From my perspective when drivers use these wrappers 
around io functions they are pretty much prepared to be easily extended for 
other access method. And also it helps with debugging.

I sent the patch here.
https://lore.kernel.org/r/0381e4e8061c2fee182a104768e84feff3a82d25.1679412800.git.michal.simek@amd.com

Thanks,
Michal


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-03-21 15:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17 23:06 [PATCH] fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function Tom Rix
2023-03-17 23:06 ` Tom Rix
2023-03-18  9:59 ` Xu Yilun
2023-03-18  9:59   ` Xu Yilun
2023-03-18 12:59   ` Tom Rix
2023-03-18 12:59     ` Tom Rix
2023-03-20  1:32     ` Xu Yilun
2023-03-20  1:32       ` Xu Yilun
2023-03-20  7:40 ` Michal Simek
2023-03-20  7:40   ` Michal Simek
2023-03-20 14:16   ` Xu Yilun
2023-03-20 14:16     ` Xu Yilun
2023-03-20 16:24     ` Tom Rix
2023-03-20 16:24       ` Tom Rix
2023-03-20 20:05       ` Tom Rix
2023-03-20 20:05         ` Tom Rix
2023-03-21 15:35         ` Michal Simek
2023-03-21 15:35           ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.