ChangeSet 1.893.2.12, 2002/12/24 11:55:39-08:00, [EMAIL PROTECTED]

[PATCH] 2.4.20 usbvideo cleanups 1/4

This is a backport of some usbvideo cleanups from 2.5:

Replace static const char proc[] = <function name> with __FUNCTION__


diff -Nru a/drivers/usb/usbvideo.c b/drivers/usb/usbvideo.c
--- a/drivers/usb/usbvideo.c    Mon Jan  6 11:31:02 2003
+++ b/drivers/usb/usbvideo.c    Mon Jan  6 11:31:02 2003
@@ -564,18 +564,17 @@
  */
 void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode)
 {
-       static const char proc[] = "usbvideo_TestPattern";
        usbvideo_frame_t *frame;
        int num_cell = 0;
        int scan_length = 0;
        static int num_pass = 0;
 
        if (uvd == NULL) {
-               err("%s: uvd == NULL", proc);
+               err("%s: uvd == NULL", __FUNCTION__);
                return;
        }
        if ((uvd->curframe < 0) || (uvd->curframe >= USBVIDEO_NUMFRAMES)) {
-               err("%s: uvd->curframe=%d.", proc, uvd->curframe);
+               err("%s: uvd->curframe=%d.", __FUNCTION__, uvd->curframe);
                return;
        }
 
@@ -675,17 +674,16 @@
 
 static void usbvideo_ClientIncModCount(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_ClientIncModCount";
        if (uvd == NULL) {
-               err("%s: uvd == NULL", proc);
+               err("%s: uvd == NULL", __FUNCTION__);
                return;
        }
        if (uvd->handle == NULL) {
-               err("%s: uvd->handle == NULL", proc);
+               err("%s: uvd->handle == NULL", __FUNCTION__);
                return;
        }
        if (uvd->handle->md_module == NULL) {
-               err("%s: uvd->handle->md_module == NULL", proc);
+               err("%s: uvd->handle->md_module == NULL", __FUNCTION__);
                return;
        }
        __MOD_INC_USE_COUNT(uvd->handle->md_module);
@@ -693,17 +691,16 @@
 
 static void usbvideo_ClientDecModCount(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_ClientDecModCount";
        if (uvd == NULL) {
-               err("%s: uvd == NULL", proc);
+               err("%s: uvd == NULL", __FUNCTION__);
                return;
        }
        if (uvd->handle == NULL) {
-               err("%s: uvd->handle == NULL", proc);
+               err("%s: uvd->handle == NULL", __FUNCTION__);
                return;
        }
        if (uvd->handle->md_module == NULL) {
-               err("%s: uvd->handle->md_module == NULL", proc);
+               err("%s: uvd->handle->md_module == NULL", __FUNCTION__);
                return;
        }
        __MOD_DEC_USE_COUNT(uvd->handle->md_module);
@@ -717,19 +714,18 @@
        const usbvideo_cb_t *cbTbl,
        struct module *md )
 {
-       static const char proc[] = "usbvideo_register";
        usbvideo_t *cams;
        int i, base_size;
 
        /* Check parameters for sanity */
        if ((num_cams <= 0) || (pCams == NULL) || (cbTbl == NULL)) {
-               err("%s: Illegal call", proc);
+               err("%s: Illegal call", __FUNCTION__);
                return -EINVAL;
        }
 
        /* Check registration callback - must be set! */
        if (cbTbl->probe == NULL) {
-               err("%s: probe() is required!", proc);
+               err("%s: probe() is required!", __FUNCTION__);
                return -EINVAL;
        }
 
@@ -740,7 +736,7 @@
                return -ENOMEM;
        }
        dbg("%s: Allocated $%p (%d. bytes) for %d. cameras",
-           proc, cams, base_size, num_cams);
+           __FUNCTION__, cams, base_size, num_cams);
        memset(cams, 0, base_size);
 
        /* Copy callbacks, apply defaults for those that are not set */
@@ -764,14 +760,14 @@
 #else /* !USES_PROC_FS */
        /* Report a warning so that user knows why there is no /proc entries */
        if ((cams->cb.procfs_read != NULL) || (cams->cb.procfs_write == NULL)) {
-               dbg("%s: /proc fs support requested but not configured!", proc);
+               dbg("%s: /proc fs support requested but not configured!", 
+__FUNCTION__);
        }
 #endif
        cams->num_cameras = num_cams;
        cams->cam = (uvd_t *) &cams[1];
        cams->md_module = md;
        if (cams->md_module == NULL)
-               warn("%s: module == NULL!", proc);
+               warn("%s: module == NULL!", __FUNCTION__);
        init_MUTEX(&cams->lock);        /* to 1 == available */
 
        for (i = 0; i < num_cams; i++) {
@@ -786,11 +782,11 @@
                        if (up->user_data == NULL) {
                                up->user_size = 0;
                                err("%s: Failed to allocate user_data (%d. bytes)",
-                                   proc, up->user_size);
+                                   __FUNCTION__, up->user_size);
                                return -ENOMEM;
                        }
                        dbg("%s: Allocated cams[%d].user_data=$%p (%d. bytes)",
-                            proc, i, up->user_data, up->user_size);
+                            __FUNCTION__, i, up->user_data, up->user_size);
                }
        }
 
@@ -804,7 +800,7 @@
 
 #if USES_PROC_FS
        if (cams->uses_procfs) {
-               dbg("%s: Creating /proc filesystem entries.", proc);
+               dbg("%s: Creating /proc filesystem entries.", __FUNCTION__);
                usbvideo_procfs_level1_create(cams);
        }
 #endif
@@ -829,31 +825,30 @@
  */
 void usbvideo_Deregister(usbvideo_t **pCams)
 {
-       static const char proc[] = "usbvideo_deregister";
        usbvideo_t *cams;
        int i;
 
        if (pCams == NULL) {
-               err("%s: pCams == NULL", proc);
+               err("%s: pCams == NULL", __FUNCTION__);
                return;
        }
        cams = *pCams;
        if (cams == NULL) {
-               err("%s: cams == NULL", proc);
+               err("%s: cams == NULL", __FUNCTION__);
                return;
        }
 
 #if USES_PROC_FS
        if (cams->uses_procfs) {
-               dbg("%s: Deregistering filesystem entries.", proc);
+               dbg("%s: Deregistering filesystem entries.", __FUNCTION__);
                usbvideo_procfs_level1_destroy(cams);
        }
 #endif
 
-       dbg("%s: Deregistering %s driver.", proc, cams->drvName);
+       dbg("%s: Deregistering %s driver.", __FUNCTION__, cams->drvName);
        usb_deregister(&cams->usbdrv);
 
-       dbg("%s: Deallocating cams=$%p (%d. cameras)", proc, cams, cams->num_cameras);
+       dbg("%s: Deallocating cams=$%p (%d. cameras)", __FUNCTION__, cams, 
+cams->num_cameras);
        for (i=0; i < cams->num_cameras; i++) {
                uvd_t *up = &cams->cam[i];
                int warning = 0;
@@ -867,16 +862,16 @@
                }
                if (warning) {
                        err("%s: Warning: user_data=$%p user_size=%d.",
-                           proc, up->user_data, up->user_size);
+                           __FUNCTION__, up->user_data, up->user_size);
                } else {
                        dbg("%s: Freeing %d. $%p->user_data=$%p",
-                           proc, i, up, up->user_data);
+                           __FUNCTION__, i, up, up->user_data);
                        kfree(up->user_data);
                }
        }
        /* Whole array was allocated in one chunk */
        dbg("%s: Freed %d uvd_t structures",
-           proc, cams->num_cameras);
+           __FUNCTION__, cams->num_cameras);
        kfree(cams);
        *pCams = NULL;
 }
@@ -905,17 +900,16 @@
  */
 void usbvideo_Disconnect(struct usb_device *dev, void *ptr)
 {
-       static const char proc[] = "usbvideo_Disconnect";
        uvd_t *uvd = (uvd_t *) ptr;
        int i;
 
        if ((dev == NULL) || (uvd == NULL)) {
-               err("%s($%p,$%p): Illegal call.", proc, dev, ptr);
+               err("%s($%p,$%p): Illegal call.", __FUNCTION__, dev, ptr);
                return;
        }
        usbvideo_ClientIncModCount(uvd);
        if (uvd->debug > 0)
-               info("%s(%p,%p.)", proc, dev, ptr);
+               info("%s(%p,%p.)", __FUNCTION__, dev, ptr);
 
        down(&uvd->lock);
        uvd->remove_pending = 1; /* Now all ISO data will be ignored */
@@ -930,7 +924,7 @@
        uvd->dev = NULL;            /* USB device is no more */
 
        if (uvd->user)
-               info("%s: In use, disconnect pending.", proc);
+               info("%s: In use, disconnect pending.", __FUNCTION__);
        else
                usbvideo_CameraRelease(uvd);
        up(&uvd->lock);
@@ -951,19 +945,18 @@
  */
 void usbvideo_CameraRelease(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_CameraRelease";
        if (uvd == NULL) {
-               err("%s: Illegal call", proc);
+               err("%s: Illegal call", __FUNCTION__);
                return;
        }
        video_unregister_device(&uvd->vdev);
        if (uvd->debug > 0)
-               info("%s: Video unregistered.", proc);
+               info("%s: Video unregistered.", __FUNCTION__);
 
 #if USES_PROC_FS
        assert(uvd->handle != NULL);
        if (uvd->handle->uses_procfs) {
-               dbg("%s: Removing /proc/%s/ filesystem entries.", proc, 
uvd->handle->drvName);
+               dbg("%s: Removing /proc/%s/ filesystem entries.", __FUNCTION__, 
+uvd->handle->drvName);
                usbvideo_procfs_level2_destroy(uvd);
        }
 #endif
@@ -1071,22 +1064,21 @@
 
 int usbvideo_RegisterVideoDevice(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_RegisterVideoDevice";
        char tmp1[20], tmp2[20];        /* Buffers for printing */
 
        if (uvd == NULL) {
-               err("%s: Illegal call.", proc);
+               err("%s: Illegal call.", __FUNCTION__);
                return -EINVAL;
        }
        if (uvd->video_endp == 0) {
-               info("%s: No video endpoint specified; data pump disabled.", proc);
+               info("%s: No video endpoint specified; data pump disabled.", 
+__FUNCTION__);
        }
        if (uvd->paletteBits == 0) {
-               err("%s: No palettes specified!", proc);
+               err("%s: No palettes specified!", __FUNCTION__);
                return -EINVAL;
        }
        if (uvd->defaultPalette == 0) {
-               info("%s: No default palette!", proc);
+               info("%s: No default palette!", __FUNCTION__);
        }
 
        uvd->max_frame_size = VIDEOSIZE_X(uvd->canvas) *
@@ -1096,17 +1088,17 @@
 
        if (uvd->debug > 0) {
                info("%s: iface=%d. endpoint=$%02x paletteBits=$%08lx",
-                    proc, uvd->iface, uvd->video_endp, uvd->paletteBits);
+                    __FUNCTION__, uvd->iface, uvd->video_endp, uvd->paletteBits);
        }
        if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
-               err("%s: video_register_device failed", proc);
+               err("%s: video_register_device failed", __FUNCTION__);
                return -EPIPE;
        }
        if (uvd->debug > 1) {
-               info("%s: video_register_device() successful", proc);
+               info("%s: video_register_device() successful", __FUNCTION__);
        }
        if (uvd->dev == NULL) {
-               err("%s: uvd->dev == NULL", proc);
+               err("%s: uvd->dev == NULL", __FUNCTION__);
                return -EINVAL;
        }
 
@@ -1119,7 +1111,7 @@
        if (uvd->handle->uses_procfs) {
                if (uvd->debug > 0) {
                        info("%s: Creating /proc/video/%s/ filesystem entries.",
-                            proc, uvd->handle->drvName);
+                            __FUNCTION__, uvd->handle->drvName);
                }
                usbvideo_procfs_level2_create(uvd);
        }
@@ -1187,19 +1179,18 @@
  */
 int usbvideo_v4l_open(struct video_device *dev, int flags)
 {
-       static const char proc[] = "usbvideo_v4l_open";
        uvd_t *uvd = (uvd_t *) dev;
        const int sb_size = FRAMES_PER_DESC * uvd->iso_packet_len;
        int i, errCode = 0;
 
        if (uvd->debug > 1)
-               info("%s($%p,$%08x", proc, dev, flags);
+               info("%s($%p,$%08x", __FUNCTION__, dev, flags);
 
        usbvideo_ClientIncModCount(uvd);
        down(&uvd->lock);
 
        if (uvd->user) {
-               err("%s: Someone tried to open an already opened device!", proc);
+               err("%s: Someone tried to open an already opened device!", 
+__FUNCTION__);
                errCode = -EBUSY;
        } else {
                /* Clear statistics */
@@ -1215,7 +1206,7 @@
                RingQueue_Allocate(&uvd->dp, 128*1024); /* FIXME #define */
                if ((uvd->fbuf == NULL) ||
                    (!RingQueue_IsAllocated(&uvd->dp))) {
-                       err("%s: Failed to allocate fbuf or dp", proc);
+                       err("%s: Failed to allocate fbuf or dp", __FUNCTION__);
                        errCode = -ENOMEM;
                } else {
                        /* Allocate all buffers */
@@ -1261,19 +1252,19 @@
                if (errCode == 0) {
                        if (VALID_CALLBACK(uvd, setupOnOpen)) {
                                if (uvd->debug > 1)
-                                       info("%s: setupOnOpen callback", proc);
+                                       info("%s: setupOnOpen callback", __FUNCTION__);
                                errCode = GET_CALLBACK(uvd, setupOnOpen)(uvd);
                                if (errCode < 0) {
                                        err("%s: setupOnOpen callback failed (%d.).",
-                                           proc, errCode);
+                                           __FUNCTION__, errCode);
                                } else if (uvd->debug > 1) {
-                                       info("%s: setupOnOpen callback successful", 
proc);
+                                       info("%s: setupOnOpen callback successful", 
+__FUNCTION__);
                                }
                        }
                        if (errCode == 0) {
                                uvd->settingsAdjusted = 0;
                                if (uvd->debug > 1)
-                                       info("%s: Open succeeded.", proc);
+                                       info("%s: Open succeeded.", __FUNCTION__);
                                uvd->user++;
                        }
                }
@@ -1282,7 +1273,7 @@
        if (errCode != 0)
                usbvideo_ClientDecModCount(uvd);
        if (uvd->debug > 0)
-               info("%s: Returning %d.", proc, errCode);
+               info("%s: Returning %d.", __FUNCTION__, errCode);
        return errCode;
 }
 
@@ -1300,12 +1291,11 @@
  */
 void usbvideo_v4l_close(struct video_device *dev)
 {
-       static const char proc[] = "usbvideo_v4l_close";
        uvd_t *uvd = (uvd_t *)dev;
        int i;
 
        if (uvd->debug > 1)
-               info("%s($%p)", proc, dev);
+               info("%s($%p)", __FUNCTION__, dev);
 
        down(&uvd->lock);       
        usbvideo_StopDataPump(uvd);
@@ -1332,7 +1322,7 @@
        usbvideo_ClientDecModCount(uvd);
 
        if (uvd->debug > 1)
-               info("%s: Completed.", proc);
+               info("%s: Completed.", __FUNCTION__);
 }
 
 /*
@@ -1585,7 +1575,6 @@
  */
 long usbvideo_v4l_read(struct video_device *dev, char *buf, unsigned long count, int 
noblock)
 {
-       static const char proc[] = "usbvideo_v4l_read";
        uvd_t *uvd = (uvd_t *) dev;
        int frmx = -1;
        usbvideo_frame_t *frame;
@@ -1594,7 +1583,7 @@
                return -EFAULT;
 
        if (uvd->debug >= 1)
-               info("%s: %ld. bytes, noblock=%d.", proc, count, noblock);
+               info("%s: %ld. bytes, noblock=%d.", __FUNCTION__, count, noblock);
 
        down(&uvd->lock);       
 
@@ -1640,7 +1629,7 @@
         */
        if (frmx == -1) {
                if (uvd->defaultPalette == 0) {
-                       err("%s: No default palette; don't know what to do!", proc);
+                       err("%s: No default palette; don't know what to do!", 
+__FUNCTION__);
                        count = -EFAULT;
                        goto read_done;
                }
@@ -1718,7 +1707,7 @@
        frame->seqRead_Index += count;
        if (uvd->debug >= 1) {
                err("%s: {copy} count used=%ld, new seqRead_Index=%ld",
-                       proc, count, frame->seqRead_Index);
+                   __FUNCTION__, count, frame->seqRead_Index);
        }
 
        /* Finally check if the frame is done with and "release" it */
@@ -1729,7 +1718,7 @@
                /* Mark it as available to be used again. */
                uvd->frame[frmx].frameState = FrameState_Unused;
                if (usbvideo_NewFrame(uvd, frmx ? 0 : 1)) {
-                       err("%s: usbvideo_NewFrame failed.", proc);
+                       err("%s: usbvideo_NewFrame failed.", __FUNCTION__);
                }
        }
 read_done:
@@ -1827,15 +1816,14 @@
  */
 int usbvideo_StartDataPump(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_StartDataPump";
        struct usb_device *dev = uvd->dev;
        int i, errFlag;
 
        if (uvd->debug > 1)
-               info("%s($%p)", proc, uvd);
+               info("%s($%p)", __FUNCTION__, uvd);
 
        if (!CAMERA_IS_OPERATIONAL(uvd)) {
-               err("%s: Camera is not operational",proc);
+               err("%s: Camera is not operational", __FUNCTION__);
                return -EFAULT;
        }
        uvd->curframe = -1;
@@ -1843,14 +1831,14 @@
        /* Alternate interface 1 is is the biggest frame size */
        i = usb_set_interface(dev, uvd->iface, uvd->ifaceAltActive);
        if (i < 0) {
-               err("%s: usb_set_interface error", proc);
+               err("%s: usb_set_interface error", __FUNCTION__);
                uvd->last_error = i;
                return -EBUSY;
        }
        if (VALID_CALLBACK(uvd, videoStart))
                GET_CALLBACK(uvd, videoStart)(uvd);
        else 
-               err("%s: videoStart not set", proc);
+               err("%s: videoStart not set", __FUNCTION__);
 
        /* We double buffer the Iso lists */
        for (i=0; i < USBVIDEO_NUMSBUF; i++) {
@@ -1882,12 +1870,12 @@
        for (i=0; i < USBVIDEO_NUMSBUF; i++) {
                errFlag = usb_submit_urb(uvd->sbuf[i].urb);
                if (errFlag)
-                       err("%s: usb_submit_isoc(%d) ret %d", proc, i, errFlag);
+                       err("%s: usb_submit_isoc(%d) ret %d", __FUNCTION__, i, 
+errFlag);
        }
 
        uvd->streaming = 1;
        if (uvd->debug > 1)
-               info("%s: streaming=1 video_endp=$%02x", proc, uvd->video_endp);
+               info("%s: streaming=1 video_endp=$%02x", __FUNCTION__, 
+uvd->video_endp);
        return 0;
 }
 
@@ -1903,11 +1891,10 @@
  */
 void usbvideo_StopDataPump(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_StopDataPump";
        int i, j;
 
        if (uvd->debug > 1)
-               info("%s($%p)", proc, uvd);
+               info("%s($%p)", __FUNCTION__, uvd);
 
        if ((uvd == NULL) || (!uvd->streaming) || (uvd->dev == NULL))
                return;
@@ -1916,10 +1903,10 @@
        for (i=0; i < USBVIDEO_NUMSBUF; i++) {
                j = usb_unlink_urb(uvd->sbuf[i].urb);
                if (j < 0)
-                       err("%s: usb_unlink_urb() error %d.", proc, j);
+                       err("%s: usb_unlink_urb() error %d.", __FUNCTION__, j);
        }
        if (uvd->debug > 1)
-               info("%s: streaming=0", proc);
+               info("%s: streaming=0", __FUNCTION__);
        uvd->streaming = 0;
 
        if (!uvd->remove_pending) {
@@ -1927,12 +1914,12 @@
                if (VALID_CALLBACK(uvd, videoStop))
                        GET_CALLBACK(uvd, videoStop)(uvd);
                else 
-                       err("%s: videoStop not set" ,proc);
+                       err("%s: videoStop not set", __FUNCTION__);
 
                /* Set packet size to 0 */
                j = usb_set_interface(uvd->dev, uvd->iface, uvd->ifaceAltInactive);
                if (j < 0) {
-                       err("%s: usb_set_interface() error %d.", proc, j);
+                       err("%s: usb_set_interface() error %d.", __FUNCTION__, j);
                        uvd->last_error = j;
                }
        }
@@ -2052,16 +2039,15 @@
 
 int usbvideo_GetFrame(uvd_t *uvd, int frameNum)
 {
-       static const char proc[] = "usbvideo_GetFrame";
        usbvideo_frame_t *frame = &uvd->frame[frameNum];
 
        if (uvd->debug >= 2)
-               info("%s($%p,%d.)", proc, uvd, frameNum);
+               info("%s($%p,%d.)", __FUNCTION__, uvd, frameNum);
 
        switch (frame->frameState) {
         case FrameState_Unused:
                if (uvd->debug >= 2)
-                       info("%s: FrameState_Unused", proc);
+                       info("%s: FrameState_Unused", __FUNCTION__);
                return -EINVAL;
         case FrameState_Ready:
         case FrameState_Grabbing:
@@ -2071,7 +2057,7 @@
        redo:
                if (!CAMERA_IS_OPERATIONAL(uvd)) {
                        if (uvd->debug >= 2)
-                               info("%s: Camera is not operational (1)", proc);
+                               info("%s: Camera is not operational (1)", 
+__FUNCTION__);
                        return -EIO;
                }
                ntries = 0; 
@@ -2080,24 +2066,24 @@
                        signalPending = signal_pending(current);
                        if (!CAMERA_IS_OPERATIONAL(uvd)) {
                                if (uvd->debug >= 2)
-                                       info("%s: Camera is not operational (2)", 
proc);
+                                       info("%s: Camera is not operational (2)", 
+__FUNCTION__);
                                return -EIO;
                        }
                        assert(uvd->fbuf != NULL);
                        if (signalPending) {
                                if (uvd->debug >= 2)
-                                       info("%s: Signal=$%08x", proc, signalPending);
+                                       info("%s: Signal=$%08x", __FUNCTION__, 
+signalPending);
                                if (uvd->flags & FLAGS_RETRY_VIDIOCSYNC) {
                                        usbvideo_TestPattern(uvd, 1, 0);
                                        uvd->curframe = -1;
                                        uvd->stats.frame_num++;
                                        if (uvd->debug >= 2)
-                                               info("%s: Forced test pattern screen", 
proc);
+                                               info("%s: Forced test pattern screen", 
+__FUNCTION__);
                                        return 0;
                                } else {
                                        /* Standard answer: Interrupted! */
                                        if (uvd->debug >= 2)
-                                               info("%s: Interrupted!", proc);
+                                               info("%s: Interrupted!", __FUNCTION__);
                                        return -EINTR;
                                }
                        } else {
@@ -2107,17 +2093,17 @@
                                else if (VALID_CALLBACK(uvd, processData))
                                        GET_CALLBACK(uvd, processData)(uvd, frame);
                                else 
-                                       err("%s: processData not set", proc);
+                                       err("%s: processData not set", __FUNCTION__);
                        }
                } while (frame->frameState == FrameState_Grabbing);
                if (uvd->debug >= 2) {
                        info("%s: Grabbing done; state=%d. (%lu. bytes)",
-                            proc, frame->frameState, frame->seqRead_Length);
+                            __FUNCTION__, frame->frameState, frame->seqRead_Length);
                }
                if (frame->frameState == FrameState_Error) {
                        int ret = usbvideo_NewFrame(uvd, frameNum);
                        if (ret < 0) {
-                               err("%s: usbvideo_NewFrame() failed (%d.)", proc, ret);
+                               err("%s: usbvideo_NewFrame() failed (%d.)", 
+__FUNCTION__, ret);
                                return ret;
                        }
                        goto redo;
@@ -2149,7 +2135,7 @@
                }
                frame->frameState = FrameState_Done_Hold;
                if (uvd->debug >= 2)
-                       info("%s: Entered FrameState_Done_Hold state.", proc);
+                       info("%s: Entered FrameState_Done_Hold state.", __FUNCTION__);
                return 0;
 
        case FrameState_Done_Hold:
@@ -2160,12 +2146,12 @@
                 * it will be released back into the wild to roam freely.
                 */
                if (uvd->debug >= 2)
-                       info("%s: FrameState_Done_Hold state.", proc);
+                       info("%s: FrameState_Done_Hold state.", __FUNCTION__);
                return 0;
        }
 
        /* Catch-all for other cases. We shall not be here. */
-       err("%s: Invalid state %d.", proc, frame->frameState);
+       err("%s: Invalid state %d.", __FUNCTION__, frame->frameState);
        frame->frameState = FrameState_Unused;
        return 0;
 }
@@ -2253,13 +2239,12 @@
  */
 void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd, usbvideo_frame_t *frame)
 {
-       static const char proc[] = "usbvideo_SoftwareContrastAdjustment";
        int i, j, v4l_linesize;
        signed long adj;
        const int ccm = 128; /* Color correction median - see below */
 
        if ((uvd == NULL) || (frame == NULL)) {
-               err("%s: Illegal call.", proc);
+               err("%s: Illegal call.", __FUNCTION__);
                return;
        }
        adj = (uvd->vpic.contrast - 0x8000) >> 8; /* -128..+127 = -ccm..+(ccm-1)*/
@@ -2311,14 +2296,12 @@
 
 static void usbvideo_procfs_level1_create(usbvideo_t *ut)
 {
-       static const char proc[] = "usbvideo_procfs_level1_create";
-
        if (ut == NULL) {
-               err("%s: ut == NULL", proc);
+               err("%s: ut == NULL", __FUNCTION__);
                return;
        }
        if (video_proc_entry == NULL) {
-               err("%s: /proc/video/ doesn't exist.", proc);
+               err("%s: /proc/video/ doesn't exist.", __FUNCTION__);
                return;
        }
        ut->procfs_dEntry = create_proc_entry(ut->drvName, S_IFDIR, video_proc_entry);
@@ -2326,16 +2309,14 @@
                if (ut->md_module != NULL)
                        ut->procfs_dEntry->owner = ut->md_module;
        } else {
-               err("%s: Unable to initialize /proc/video/%s", proc, ut->drvName);
+               err("%s: Unable to initialize /proc/video/%s", __FUNCTION__, 
+ut->drvName);
        }
 }
 
 static void usbvideo_procfs_level1_destroy(usbvideo_t *ut)
 {
-       static const char proc[] = "usbvideo_procfs_level1_destroy";
-
        if (ut == NULL) {
-               err("%s: ut == NULL", proc);
+               err("%s: ut == NULL", __FUNCTION__);
                return;
        }
        if (ut->procfs_dEntry != NULL) {
@@ -2346,15 +2327,13 @@
 
 static void usbvideo_procfs_level2_create(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_procfs_level2_create";
-
        if (uvd == NULL) {
-               err("%s: uvd == NULL", proc);
+               err("%s: uvd == NULL", __FUNCTION__);
                return;
        }
        assert(uvd->handle != NULL);
        if (uvd->handle->procfs_dEntry == NULL) {
-               err("%s: uvd->handle->procfs_dEntry == NULL", proc);
+               err("%s: uvd->handle->procfs_dEntry == NULL", __FUNCTION__);
                return;
        }
 
@@ -2368,16 +2347,14 @@
                uvd->procfs_vEntry->read_proc = uvd->handle->cb.procfs_read;
                uvd->procfs_vEntry->write_proc = uvd->handle->cb.procfs_write;
        } else {
-               err("%s: Failed to create entry \"%s\"", proc, uvd->videoName);
+               err("%s: Failed to create entry \"%s\"", __FUNCTION__, uvd->videoName);
        }
 }
 
 static void usbvideo_procfs_level2_destroy(uvd_t *uvd)
 {
-       static const char proc[] = "usbvideo_procfs_level2_destroy";
-
        if (uvd == NULL) {
-               err("%s: uvd == NULL", proc);
+               err("%s: uvd == NULL", __FUNCTION__);
                return;
        }
        if (uvd->procfs_vEntry != NULL) {


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to