Skip to contentSkip to conversation

fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function

PATCH Applied Tom Rix 3 participants 9 messages Mar 17, 2023 – Mar 21, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author reviewer
#0 lore raw

PATCH 1/1 fpga: xilinx-pr-decoupler: remove unused xlnx_pr_decouple_read function

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.

---
 drivers/fpga/xilinx-pr-decoupler.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -6
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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;
Signature · 1 line
2.27.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · 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.

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

Quoted 26 lines
---
 drivers/fpga/xilinx-pr-decoupler.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -6
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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;
Signature · 1 line
2.27.0
author reviewer
#2 lore raw
Quoted 8 lines · Xu Yilun
Quoted 5 lines · 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.

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

Quoted 28 lines
Quoted 25 lines
---
  drivers/fpga/xilinx-pr-decoupler.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -6
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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;
Signature · 1 line
2.27.0
maintainer Applied
#3 lore raw
Quoted 8 lines · Tom Rix
Quoted 6 lines · Xu Yilun
Quoted 5 lines · 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.

Quoted 4 lines
Quoted 2 lines

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.

Quoted 31 lines

Tom

Quoted 27 lines
Quoted 24 lines
---
  drivers/fpga/xilinx-pr-decoupler.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -6
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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;
Signature · 1 line
2.27.0
maintainer
#4 lore raw
In reply to Tom Rix
Quoted 32 lines · Tom Rix

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.

---
  drivers/fpga/xilinx-pr-decoupler.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -7
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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;
--
Quoted 2 lines

2.27.0

It should be fixed like this instead.

Thanks,
Michal

drivers/fpga/xilinx-pr-decoupler.c +1 -1
index 2d9c491f7be9..58508f44cd49 100644
@@ -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);
 
maintainer
#5 lore raw
Quoted 48 lines · Michal Simek
Quoted 32 lines · Tom Rix

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.

---
  drivers/fpga/xilinx-pr-decoupler.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -7
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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;
--
Quoted 2 lines

2.27.0

It should be fixed like this instead.

Thanks,
Michal

drivers/fpga/xilinx-pr-decoupler.c +0 -0
index 2d9c491f7be9..58508f44cd49 100644

drivers/fpga/xilinx-pr-decoupler.c static int xlnx_pr_decoupler_enable_show(struct · line 73

Quoted 6 lines
drivers/fpga/xilinx-pr-decoupler.c +1 -1
@@ -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

Quoted 3 lines
drivers/fpga/xilinx-pr-decoupler.c +0 -0
        clk_disable(priv->clk);
 
author reviewer
#6 lore raw
Quoted 51 lines · Xu Yilun
Quoted 50 lines · Michal Simek
Quoted 32 lines · Tom Rix

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.

---
   drivers/fpga/xilinx-pr-decoupler.c | 6 ------
   1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -7
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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;
--
Quoted 2 lines

2.27.0

It should be fixed like this instead.

Thanks,
Michal

drivers/fpga/xilinx-pr-decoupler.c +0 -0
index 2d9c491f7be9..58508f44cd49 100644
@@ -69,7 +69,7 @@ static int xlnx_pr_decoupler_enable_show(struct
 fpga_bridge *bridge)
         if (err)
                 return err;
 
Quoted 3 lines

drivers/fpga/xilinx-pr-decoupler.c static int xlnx_pr_decoupler_enable_show(struct fpga_bridge *bridge) · line 72

Quoted 2 lines
drivers/fpga/xilinx-pr-decoupler.c +1 -1
-       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

Quoted 6 lines

Thanks,
Yilun

Quoted 2 lines
drivers/fpga/xilinx-pr-decoupler.c +0 -0
         clk_disable(priv->clk);
 
author reviewer
#7 lore raw
Quoted 55 lines · Tom Rix
Quoted 53 lines · Xu Yilun
Quoted 52 lines · Michal Simek
Quoted 31 lines · Tom Rix

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.

---
   drivers/fpga/xilinx-pr-decoupler.c | 6 ------

   1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -6
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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)
Quoted 5 lines

   {
          int err;

Signature · 1 line
2.27.0

It should be fixed like this instead.

Thanks,
Michal

drivers/fpga/xilinx-pr-decoupler.c +0 -0
index 2d9c491f7be9..58508f44cd49 100644
@@ -69,7 +69,7 @@ static int xlnx_pr_decoupler_enable_show(struct
 fpga_bridge *bridge)
          if (err)
                  return err;
 
Quoted 7 lines
Quoted 3 lines

drivers/fpga/xilinx-pr-decoupler.c static int xlnx_pr_decoupler_enable_show(struct fpga_bridge *bridge) · line 72

Quoted 2 lines
drivers/fpga/xilinx-pr-decoupler.c +1 -1
-       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

Quoted 9 lines

Tom

Quoted 6 lines

Thanks,
Yilun

Quoted 2 lines
drivers/fpga/xilinx-pr-decoupler.c +0 -0
          clk_disable(priv->clk);
 
maintainer
#8 lore raw
Quoted 67 lines · Tom Rix
Quoted 55 lines · Tom Rix
Quoted 53 lines · Xu Yilun
Quoted 52 lines · Michal Simek
Quoted 31 lines · Tom Rix

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.

---
   drivers/fpga/xilinx-pr-decoupler.c | 6 ------

   1 file changed, 6 deletions(-)
drivers/fpga/xilinx-pr-decoupler.c +0 -6
index 2d9c491f7be9..b6f18c07c752 100644
@@ -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)
Quoted 5 lines

   {
          int err;

Signature · 1 line
2.27.0

It should be fixed like this instead.

Thanks,
Michal

drivers/fpga/xilinx-pr-decoupler.c +0 -0
index 2d9c491f7be9..58508f44cd49 100644
@@ -69,7 +69,7 @@ static int xlnx_pr_decoupler_enable_show(struct
 fpga_bridge *bridge)
          if (err)
                  return err;
 
Quoted 7 lines
Quoted 3 lines

drivers/fpga/xilinx-pr-decoupler.c static int xlnx_pr_decoupler_enable_show(struct fpga_bridge *bridge) · line 72

Quoted 2 lines
drivers/fpga/xilinx-pr-decoupler.c +1 -1
-       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.

Quoted 7 lines

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