[media] et61x251: Use current logging styles
authorJoe Perches <joe@perches.com>
Sun, 21 Aug 2011 22:56:50 +0000 (19:56 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 4 Sep 2011 00:11:59 +0000 (21:11 -0300)
Add pr_fmt and convert printks to pr_<level>
Remove explicit prefixes from logging messages.
One of the prefixes was defective, a copy/paste error.
Use ##__VA_ARGS__ for variadic macros.
Whitespace neatening.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/et61x251/et61x251.h
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/et61x251/et61x251_tas5130d1b.c

index 14bb907d650e123b4fe2be6a2366c5618f596f82..337ded4a6388d68d58c6f7afb78dc18fe0e7ba29 100644 (file)
@@ -165,45 +165,49 @@ et61x251_attach_sensor(struct et61x251_device* cam,
 #undef DBG
 #undef KDBG
 #ifdef ET61X251_DEBUG
-#      define DBG(level, fmt, args...)                                       \
-do {                                                                          \
-       if (debug >= (level)) {                                               \
-               if ((level) == 1)                                             \
-                       dev_err(&cam->usbdev->dev, fmt "\n", ## args);        \
-               else if ((level) == 2)                                        \
-                       dev_info(&cam->usbdev->dev, fmt "\n", ## args);       \
-               else if ((level) >= 3)                                        \
-                       dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n",   \
-                                __FILE__, __func__, __LINE__ , ## args); \
-       }                                                                     \
+#define DBG(level, fmt, ...)                                           \
+do {                                                                   \
+       if (debug >= (level)) {                                         \
+               if ((level) == 1)                                       \
+                       dev_err(&cam->usbdev->dev, fmt "\n",            \
+                               ##__VA_ARGS__);                         \
+               else if ((level) == 2)                                  \
+                       dev_info(&cam->usbdev->dev, fmt "\n",           \
+                                ##__VA_ARGS__);                        \
+               else if ((level) >= 3)                                  \
+                       dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", \
+                                __FILE__, __func__, __LINE__,          \
+                                ##__VA_ARGS__);                        \
+       }                                                               \
 } while (0)
-#      define KDBG(level, fmt, args...)                                      \
-do {                                                                          \
-       if (debug >= (level)) {                                               \
-               if ((level) == 1 || (level) == 2)                             \
-                       pr_info("et61x251: " fmt "\n", ## args);              \
-               else if ((level) == 3)                                        \
-                       pr_debug("sn9c102: [%s:%s:%d] " fmt "\n", __FILE__,   \
-                                __func__, __LINE__ , ## args);           \
-       }                                                                     \
+#define KDBG(level, fmt, ...)                                          \
+do {                                                                   \
+       if (debug >= (level)) {                                         \
+               if ((level) == 1 || (level) == 2)                       \
+                       pr_info(fmt "\n", ##__VA_ARGS__);               \
+               else if ((level) == 3)                                  \
+                       pr_debug("[%s:%s:%d] " fmt "\n",                \
+                                __FILE__,  __func__, __LINE__,         \
+                                ##__VA_ARGS__);                        \
+       }                                                               \
 } while (0)
-#      define V4LDBG(level, name, cmd)                                       \
-do {                                                                          \
-       if (debug >= (level))                                                 \
-               v4l_print_ioctl(name, cmd);                                   \
+#define V4LDBG(level, name, cmd)                                       \
+do {                                                                   \
+       if (debug >= (level))                                           \
+               v4l_print_ioctl(name, cmd);                             \
 } while (0)
 #else
-#      define DBG(level, fmt, args...) do {;} while(0)
-#      define KDBG(level, fmt, args...) do {;} while(0)
-#      define V4LDBG(level, name, cmd) do {;} while(0)
+#define DBG(level, fmt, ...) do {;} while(0)
+#define KDBG(level, fmt, ...) do {;} while(0)
+#define V4LDBG(level, name, cmd) do {;} while(0)
 #endif
 
 #undef PDBG
-#define PDBG(fmt, args...)                                                    \
-dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", __FILE__, __func__,   \
-        __LINE__ , ## args)
+#define PDBG(fmt, ...)                                                 \
+       dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n",             \
+                __FILE__, __func__, __LINE__, ##__VA_ARGS__)
 
 #undef PDBGG
-#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */
+#define PDBGG(fmt, args...) do {;} while (0) /* placeholder */
 
 #endif /* _ET61X251_H_ */
index 9a1e80a1e1459824b95da0abe23dc00f8e8393e7..d3777c86e1de7a3043fb40c7d355fca4872e1bd7 100644 (file)
@@ -18,6 +18,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.               *
  ***************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/init.h>
index 04b7fbb310a82d6d7737c57846d325f651f4f367..ced2e167935d83a3a8410bd371b963320548ca5e 100644 (file)
@@ -19,6 +19,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.               *
  ***************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "et61x251_sensor.h"