Thread (6 messages) 6 messages, 1 author, 2021-06-24

[PATCH v4 5/5] fpga: fpga-mgr: simplify mops check in wrappers

flat view
DORMANTno replies

From: trix@redhat.com
Date: 2021-06-24 21:18:27
Also in: linux-fpga, lkml
Subsystem: fpga manager framework, the rest · Maintainers: Moritz Fischer, Xu Yilun, Linus Torvalds

From: Tom Rix <trix@redhat.com>

The mops value is checked in fpga_mgr_create,
do not check it twice.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/fpga/fpga-mgr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index 2abb7043858dc..21b4fd34b1dbf 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -28,14 +28,14 @@ struct fpga_mgr_devres {
 /* mops wrappers */
 static inline enum fpga_mgr_states fpga_mgr_state(struct fpga_manager *mgr)
 {
-	if (mgr->mops && mgr->mops->state)
+	if (mgr->mops->state)
 		return  mgr->mops->state(mgr);
 	return FPGA_MGR_STATE_UNKNOWN;
 }
 
 static inline u64 fpga_mgr_status(struct fpga_manager *mgr)
 {
-	if (mgr->mops && mgr->mops->status)
+	if (mgr->mops->status)
 		return mgr->mops->status(mgr);
 	return 0;
 }
@@ -93,7 +93,7 @@ static inline int fpga_mgr_write_complete(struct fpga_manager *mgr,
 
 static inline void fpga_mgr_fpga_remove(struct fpga_manager *mgr)
 {
-	if (mgr->mops && mgr->mops->fpga_remove)
+	if (mgr->mops->fpga_remove)
 		mgr->mops->fpga_remove(mgr);
 }
 
-- 
2.26.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help