[ewg] [PATCH 3/8 warnings] inline functions

Jeremy Brown jeremy.brown at qlogic.com
Fri Oct 5 16:47:34 PDT 2007


Tziporet, Vlad,

I've included the third of the eight warning fix patches.

Thanks!

Jeremy Brown

---

Make functions defined in .h file inline so to silence compiler warnings.

Signed-off-by: John Gregor <john.gregor at qlogic.com>

diff -r 604839d153e7 kernel_addons/backport/2.6.9_U3/include/linux/device.h
--- a/kernel_addons/backport/2.6.9_U3/include/linux/device.h	Thu May 10 18:47:50 2007 -0700
+++ b/kernel_addons/backport/2.6.9_U3/include/linux/device.h	Thu May 10 18:59:25 2007 -0700
@@ -23,12 +23,12 @@
  * called directly.
  */
 
-static void class_create_release(struct class *cls)
+static inline void class_create_release(struct class *cls)
 {
 	kfree(cls);
 }
 
-static void class_device_create_release(struct class_device *class_dev)
+static inline void class_device_create_release(struct class_device *class_dev)
 {
 	kfree(class_dev);
 }
@@ -44,7 +44,7 @@ static void class_device_create_release(
  * Note, the pointer created here is to be destroyed when finished by
  * making a call to class_destroy().
  */
-static struct class *class_create(struct module *owner, char *name)
+static inline struct class *class_create(struct module *owner, char *name)
 {
 	struct class *cls;
 	int retval;
@@ -78,7 +78,7 @@ error:
  * Note, the pointer to be destroyed must have been created with a call
  * to class_create().
  */
-static void class_destroy(struct class *cls)
+static inline void class_destroy(struct class *cls)
 {
 	if ((cls == NULL) || (IS_ERR(cls)))
 		return;
@@ -103,7 +103,7 @@ static void class_destroy(struct class *
  * Note: the struct class passed to this function must have previously
  * been created with a call to class_create().
  */
-static struct class_device *class_device_create(struct class *cls, void *parent, dev_t devt,
+static inline struct class_device *class_device_create(struct class *cls, void *parent, dev_t devt,
 					 struct device *device, char *fmt, ...)
 {
 	va_list args;





More information about the ewg mailing list