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: <20160816145212.GA4254@dell>
Date:	Tue, 16 Aug 2016 15:52:12 +0100
From:	Lee Jones <lee.jones@...aro.org>
To:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:	kernel@...inux.com, patrice.chotard@...com, ohad@...ery.com,
	bjorn.andersson@...aro.org, ssantosh@...nel.org,
	linux-remoteproc@...r.kernel.org, ludovic.barre@...com,
	s-anna@...com, loic.pallardy@...com
Subject: [PATCH 3/2+1] remoteproc: core: Move of_get_rproc() helper to header

remoteproc: core: Move of_get_rproc() helper to header

Since of_get_rproc() has been made a simple helper, we can move it
to the remoteproc.h and make it a 'static inline'.

Suggested-by: Suman Anna <s-anna@...com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 1c5d5d8..6966fb2 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1267,25 +1267,6 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name)
 	return of_get_rproc_by_index(np, index);
 }
 EXPORT_SYMBOL(of_get_rproc_by_name);
-
-/**
- * of_get_rproc() - lookup and obtain a reference to an rproc
- * @np: node to search for rproc
- *
- * Finds an rproc handle using the default remote processor's phandle,
- * and then returns a handle to the rproc.
- *
- * This function increments the remote processor's refcount, so always
- * use rproc_put() to decrement it back once rproc isn't needed anymore.
- *
- * Returns a pointer to the rproc struct on success or an appropriate error
- * code otherwise.
- */
-struct rproc *of_get_rproc(struct device_node *np)
-{
-	return of_get_rproc_by_index(np, 0);
-}
-EXPORT_SYMBOL(of_get_rproc);
 #endif
 
 /**
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 0e1adc9..ec1cffd 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -515,7 +515,6 @@ extern struct rproc *of_get_rproc_by_index(struct device_node *np,
 					   int index);
 extern struct rproc *of_get_rproc_by_name(struct device_node *np,
 					  const char *name);
-extern struct rproc *of_get_rproc(struct device_node *np);
 #else
 static inline
 struct rproc *of_get_rproc_by_index(struct device_node *np, int index)
@@ -527,11 +526,24 @@ struct rproc *of_get_rproc_by_name(struct device_node *np, const char *name)
 {
 	return NULL;
 }
-static inline
-struct rproc *of_get_rproc(struct device_node *np)
+#endif /* CONFIG_OF */
+
+/**
+ * of_get_rproc() - lookup and obtain a reference to an rproc
+ * @np: node to search for rproc
+ *
+ * Finds an rproc handle using the default remote processor's phandle,
+ * and then returns a handle to the rproc.
+ *
+ * This function increments the remote processor's refcount, so always
+ * use rproc_put() to decrement it back once rproc isn't needed anymore.
+ *
+ * Returns a pointer to the rproc struct on success or an appropriate error
+ * code otherwise.
+ */
+static inline struct rproc *of_get_rproc(struct device_node *np)
 {
-	return NULL;
+	return of_get_rproc_by_index(np, 0);
 }
-#endif /* CONFIG_OF */
 
 #endif /* REMOTEPROC_H */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ