Skip to contentSkip to conversation

fpga-manager: Replaced macro with static inline function

PATCH In review Moritz Fischer 3 participants 3 messages Mar 1, 2016 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga-manager: Replaced macro with static inline function

---
 include/linux/fpga/fpga-mgr.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/fpga/fpga-mgr.h +4 -1
index 0940bf4..8064f1b 100644
@@ -107,7 +107,10 @@ struct fpga_manager {
 	void *priv;
 };
 
-#define to_fpga_manager(d) container_of(d, struct fpga_manager, dev)
+static inline struct fpga_manager *to_fpga_manager(struct device *d)
+{
+	return container_of(d, struct fpga_manager, dev);
+}
 
 int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags,
 		      const char *buf, size_t count);
Signature · 1 line
2.4.3
#1 lore raw
Quoted 4 lines · Moritz Fischer
---
 include/linux/fpga/fpga-mgr.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

We can't take patches without a changelog comment explaining why this change is needed :(

#2 lore raw
In reply to Moritz Fischer
Quoted 10 lines · Moritz Fischer
---
 include/linux/fpga/fpga-mgr.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/fpga/fpga-mgr.h +0 -0
index 0940bf4..8064f1b 100644

include/linux/fpga/fpga-mgr.h struct fpga_manager { · line 113

Quoted 8 lines
include/linux/fpga/fpga-mgr.h +4 -1
@@ -107,7 +107,10 @@ struct fpga_manager {
 	void *priv;
 };
 
-#define to_fpga_manager(d) container_of(d, struct fpga_manager, dev)
+static inline struct fpga_manager *to_fpga_manager(struct device *d)
+{
+	return container_of(d, struct fpga_manager, dev);
+}

Hi Moritz,

I really appreciate your work on this stuff. But I don't think we need to do this.

Alan

Quoted 7 lines
include/linux/fpga/fpga-mgr.h +0 -0
 int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags,
 		      const char *buf, size_t count);
Signature · 1 line
2.4.3