Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / net / irda / parameters.c
index 7183e9e..fc1a205 100644 (file)
@@ -133,7 +133,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
        int err;
 
        p.pi = pi;             /* In case handler needs to know */
-       p.pl = type & PV_MASK; /* The integer type codes the lenght as well */
+       p.pl = type & PV_MASK; /* The integer type codes the length as well */
        p.pv.i = 0;            /* Clear value */
 
        /* Call handler for this parameter */
@@ -142,29 +142,29 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
                return err;
 
        /*
-        * If parameter lenght is still 0, then (1) this is an any length
+        * If parameter length is still 0, then (1) this is an any length
         * integer, and (2) the handler function does not care which length
         * we choose to use, so we pick the one the gives the fewest bytes.
         */
        if (p.pl == 0) {
                if (p.pv.i < 0xff) {
-                       IRDA_DEBUG(2, "%s(), using 1 byte\n", __FUNCTION__);
+                       IRDA_DEBUG(2, "%s(), using 1 byte\n", __func__);
                        p.pl = 1;
                } else if (p.pv.i < 0xffff) {
-                       IRDA_DEBUG(2, "%s(), using 2 bytes\n", __FUNCTION__);
+                       IRDA_DEBUG(2, "%s(), using 2 bytes\n", __func__);
                        p.pl = 2;
                } else {
-                       IRDA_DEBUG(2, "%s(), using 4 bytes\n", __FUNCTION__);
+                       IRDA_DEBUG(2, "%s(), using 4 bytes\n", __func__);
                        p.pl = 4; /* Default length */
                }
        }
        /* Check if buffer is long enough for insertion */
        if (len < (2+p.pl)) {
                IRDA_WARNING("%s: buffer too short for insertion!\n",
-                            __FUNCTION__);
+                            __func__);
                return -1;
        }
-       IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__,
                   p.pi, p.pl, p.pv.i);
        switch (p.pl) {
        case 1:
@@ -187,7 +187,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
                break;
        default:
                IRDA_WARNING("%s: length %d not supported\n",
-                            __FUNCTION__, p.pl);
+                            __func__, p.pl);
                /* Skip parameter */
                return -1;
        }
@@ -206,11 +206,11 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
 {
        irda_param_t p;
        int n = 0;
-       int extract_len;        /* Real lenght we extract */
+       int extract_len;        /* Real length we extract */
        int err;
 
        p.pi = pi;     /* In case handler needs to know */
-       p.pl = buf[1]; /* Extract lenght of value */
+       p.pl = buf[1]; /* Extract length of value */
        p.pv.i = 0;    /* Clear value */
        extract_len = p.pl;     /* Default : extract all */
 
@@ -218,7 +218,7 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
        if (len < (2+p.pl)) {
                IRDA_WARNING("%s: buffer too short for parsing! "
                             "Need %d bytes, but len is only %d\n",
-                            __FUNCTION__, p.pl, len);
+                            __func__, p.pl, len);
                return -1;
        }
 
@@ -230,7 +230,7 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
        if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) {
                IRDA_ERROR("%s: invalid parameter length! "
                           "Expected %d bytes, but value had %d bytes!\n",
-                          __FUNCTION__, type & PV_MASK, p.pl);
+                          __func__, type & PV_MASK, p.pl);
 
                /* Most parameters are bit/byte fields or little endian,
                 * so it's ok to only extract a subset of it (the subset
@@ -268,13 +268,13 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
                break;
        default:
                IRDA_WARNING("%s: length %d not supported\n",
-                            __FUNCTION__, p.pl);
+                            __func__, p.pl);
 
                /* Skip parameter */
                return p.pl+2;
        }
 
-       IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__,
                   p.pi, p.pl, p.pv.i);
        /* Call handler for this parameter */
        err = (*func)(self, &p, PV_PUT);
@@ -294,19 +294,19 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
        irda_param_t p;
        int err;
 
-       IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+       IRDA_DEBUG(2, "%s()\n", __func__);
 
        p.pi = pi;     /* In case handler needs to know */
-       p.pl = buf[1]; /* Extract lenght of value */
+       p.pl = buf[1]; /* Extract length of value */
 
-       IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __func__,
                   p.pi, p.pl);
 
        /* Check if buffer is long enough for parsing */
        if (len < (2+p.pl)) {
                IRDA_WARNING("%s: buffer too short for parsing! "
                             "Need %d bytes, but len is only %d\n",
-                            __FUNCTION__, p.pl, len);
+                            __func__, p.pl, len);
                return -1;
        }
 
@@ -314,7 +314,7 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
         * checked that the buffer is long enough */
        strncpy(str, buf+2, p.pl);
 
-       IRDA_DEBUG(2, "%s(), str=0x%02x 0x%02x\n", __FUNCTION__,
+       IRDA_DEBUG(2, "%s(), str=0x%02x 0x%02x\n", __func__,
                   (__u8) str[0], (__u8) str[1]);
 
        /* Null terminate string */
@@ -339,17 +339,17 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
        irda_param_t p;
 
        p.pi = pi;     /* In case handler needs to know */
-       p.pl = buf[1]; /* Extract lenght of value */
+       p.pl = buf[1]; /* Extract length of value */
 
        /* Check if buffer is long enough for parsing */
        if (len < (2+p.pl)) {
                IRDA_WARNING("%s: buffer too short for parsing! "
                             "Need %d bytes, but len is only %d\n",
-                            __FUNCTION__, p.pl, len);
+                            __func__, p.pl, len);
                return -1;
        }
 
-       IRDA_DEBUG(0, "%s(), not impl\n", __FUNCTION__);
+       IRDA_DEBUG(0, "%s(), not impl\n", __func__);
 
        return p.pl+2; /* Extracted pl+2 bytes */
 }
@@ -473,7 +473,7 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len,
            (pi_minor > info->tables[pi_major].len-1))
        {
                IRDA_DEBUG(0, "%s(), no handler for parameter=0x%02x\n",
-                          __FUNCTION__, pi);
+                          __func__, pi);
 
                /* Skip this parameter */
                return -1;
@@ -487,7 +487,7 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len,
 
        /*  Check if handler has been implemented */
        if (!pi_minor_info->func) {
-               IRDA_MESSAGE("%s: no handler for pi=%#x\n", __FUNCTION__, pi);
+               IRDA_MESSAGE("%s: no handler for pi=%#x\n", __func__, pi);
                /* Skip this parameter */
                return -1;
        }
@@ -527,7 +527,7 @@ static int irda_param_extract(void *self, __u8 *buf, int len,
            (pi_minor > info->tables[pi_major].len-1))
        {
                IRDA_DEBUG(0, "%s(), no handler for parameter=0x%02x\n",
-                          __FUNCTION__, buf[0]);
+                          __func__, buf[0]);
 
                /* Skip this parameter */
                return 2 + buf[n + 1];  /* Continue */
@@ -539,13 +539,13 @@ static int irda_param_extract(void *self, __u8 *buf, int len,
        /* Find expected data type for this parameter identifier (pi)*/
        type = pi_minor_info->type;
 
-       IRDA_DEBUG(3, "%s(), pi=[%d,%d], type=%d\n", __FUNCTION__,
+       IRDA_DEBUG(3, "%s(), pi=[%d,%d], type=%d\n", __func__,
                   pi_major, pi_minor, type);
 
        /*  Check if handler has been implemented */
        if (!pi_minor_info->func) {
                IRDA_MESSAGE("%s: no handler for pi=%#x\n",
-                            __FUNCTION__, buf[n]);
+                            __func__, buf[n]);
                /* Skip this parameter */
                return 2 + buf[n + 1]; /* Continue */
        }