]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/irda/irias_object.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[mv-sheeva.git] / net / irda / irias_object.c
index cbcf04380f3a46eb94ecfb43e169079690728e7c..f07ed9fd5792fabe7e1cffc1016330ee01a0fab8 100644 (file)
@@ -22,6 +22,7 @@
  *
  ********************************************************************/
 
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/socket.h>
 #include <linux/module.h>
@@ -47,12 +48,12 @@ struct ias_object *irias_new_object( char *name, int id)
 {
        struct ias_object *obj;
 
-       IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG( 4, "%s()\n", __func__);
 
        obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC);
        if (obj == NULL) {
                IRDA_WARNING("%s(), Unable to allocate object!\n",
-                            __FUNCTION__);
+                            __func__);
                return NULL;
        }
 
@@ -60,7 +61,7 @@ struct ias_object *irias_new_object( char *name, int id)
        obj->name = kstrndup(name, IAS_MAX_CLASSNAME, GFP_ATOMIC);
        if (!obj->name) {
                IRDA_WARNING("%s(), Unable to allocate name!\n",
-                            __FUNCTION__);
+                            __func__);
                kfree(obj);
                return NULL;
        }
@@ -73,7 +74,7 @@ struct ias_object *irias_new_object( char *name, int id)
 
        if (obj->attribs == NULL) {
                IRDA_WARNING("%s(), Unable to allocate attribs!\n",
-                            __FUNCTION__);
+                            __func__);
                kfree(obj->name);
                kfree(obj);
                return NULL;
@@ -134,7 +135,7 @@ int irias_delete_object(struct ias_object *obj)
        node = hashbin_remove_this(irias_objects, (irda_queue_t *) obj);
        if (!node)
                IRDA_DEBUG( 0, "%s(), object already removed!\n",
-                           __FUNCTION__);
+                           __func__);
 
        /* Destroy */
        __irias_delete_object(obj);
@@ -268,7 +269,7 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
        /* Find object */
        obj = hashbin_lock_find(irias_objects, 0, obj_name);
        if (obj == NULL) {
-               IRDA_WARNING("%s: Unable to find object: %s\n", __FUNCTION__,
+               IRDA_WARNING("%s: Unable to find object: %s\n", __func__,
                             obj_name);
                return -1;
        }
@@ -280,14 +281,14 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
        attrib = hashbin_find(obj->attribs, 0, attrib_name);
        if (attrib == NULL) {
                IRDA_WARNING("%s: Unable to find attribute: %s\n",
-                            __FUNCTION__, attrib_name);
+                            __func__, attrib_name);
                spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags);
                return -1;
        }
 
        if ( attrib->value->type != new_value->type) {
                IRDA_DEBUG( 0, "%s(), changing value type not allowed!\n",
-                           __FUNCTION__);
+                           __func__);
                spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags);
                return -1;
        }
@@ -322,7 +323,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
        attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC);
        if (attrib == NULL) {
                IRDA_WARNING("%s: Unable to allocate attribute!\n",
-                            __FUNCTION__);
+                            __func__);
                return;
        }
 
@@ -333,7 +334,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
        attrib->value = irias_new_integer_value(value);
        if (!attrib->name || !attrib->value) {
                IRDA_WARNING("%s: Unable to allocate attribute!\n",
-                            __FUNCTION__);
+                            __func__);
                if (attrib->value)
                        irias_delete_value(attrib->value);
                kfree(attrib->name);
@@ -366,7 +367,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
        attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC);
        if (attrib == NULL) {
                IRDA_WARNING("%s: Unable to allocate attribute!\n",
-                            __FUNCTION__);
+                            __func__);
                return;
        }
 
@@ -376,7 +377,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
        attrib->value = irias_new_octseq_value( octets, len);
        if (!attrib->name || !attrib->value) {
                IRDA_WARNING("%s: Unable to allocate attribute!\n",
-                            __FUNCTION__);
+                            __func__);
                if (attrib->value)
                        irias_delete_value(attrib->value);
                kfree(attrib->name);
@@ -408,7 +409,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
        attrib = kzalloc(sizeof( struct ias_attrib), GFP_ATOMIC);
        if (attrib == NULL) {
                IRDA_WARNING("%s: Unable to allocate attribute!\n",
-                            __FUNCTION__);
+                            __func__);
                return;
        }
 
@@ -418,7 +419,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
        attrib->value = irias_new_string_value(value);
        if (!attrib->name || !attrib->value) {
                IRDA_WARNING("%s: Unable to allocate attribute!\n",
-                            __FUNCTION__);
+                            __func__);
                if (attrib->value)
                        irias_delete_value(attrib->value);
                kfree(attrib->name);
@@ -442,7 +443,7 @@ struct ias_value *irias_new_integer_value(int integer)
 
        value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
        if (value == NULL) {
-               IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+               IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
                return NULL;
        }
 
@@ -467,7 +468,7 @@ struct ias_value *irias_new_string_value(char *string)
 
        value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
        if (value == NULL) {
-               IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+               IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
                return NULL;
        }
 
@@ -475,7 +476,7 @@ struct ias_value *irias_new_string_value(char *string)
        value->charset = CS_ASCII;
        value->t.string = kstrndup(string, IAS_MAX_STRING, GFP_ATOMIC);
        if (!value->t.string) {
-               IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+               IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
                kfree(value);
                return NULL;
        }
@@ -498,7 +499,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
 
        value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
        if (value == NULL) {
-               IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+               IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
                return NULL;
        }
 
@@ -510,7 +511,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
 
        value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC);
        if (value->t.oct_seq == NULL){
-               IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+               IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
                kfree(value);
                return NULL;
        }
@@ -523,7 +524,7 @@ struct ias_value *irias_new_missing_value(void)
 
        value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
        if (value == NULL) {
-               IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+               IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
                return NULL;
        }
 
@@ -540,7 +541,7 @@ struct ias_value *irias_new_missing_value(void)
  */
 void irias_delete_value(struct ias_value *value)
 {
-       IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(4, "%s()\n", __func__);
 
        IRDA_ASSERT(value != NULL, return;);
 
@@ -558,7 +559,7 @@ void irias_delete_value(struct ias_value *value)
                 kfree(value->t.oct_seq);
                 break;
        default:
-               IRDA_DEBUG(0, "%s(), Unknown value type!\n", __FUNCTION__);
+               IRDA_DEBUG(0, "%s(), Unknown value type!\n", __func__);
                break;
        }
        kfree(value);