]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
LINUX: Define printf/uprintf as variadic macros
authorAndrew Deason <adeason@sinenomine.net>
Mon, 24 Sep 2012 18:03:34 +0000 (13:03 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 5 Oct 2016 14:31:30 +0000 (10:31 -0400)
Instead of defining the string 'printf' itself, make printf (and
uprintf) variadic macros. This avoids renaming printf to printk for
things like '__attribute__((format(printf,X,Y)))'.

Note that this is Linux-specific; compilers on other platforms may not
support variadic macros.

This avoids many warnings in the Linux kernel module build if we
include Linux headers after AFS headers.

Reviewed-on: http://gerrit.openafs.org/8150
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 179096d9b2c461f02236bbf670b46597ff2d4c3c)

Change-Id: I5c1c80cb5bd6996b0329969e16f9359fa1dcbc91
Reviewed-on: https://gerrit.openafs.org/12365
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/LINUX/osi_machdep.h
src/rx/rx_kernel.h

index d9f2938de58ac841baab7fca0d018599fbc01f99..a64a0c846236513af45a41665762a2a1d067a986 100644 (file)
@@ -133,8 +133,8 @@ static inline long copyinstr(char *from, char *to, int count, int *length) {
 #define copyout(F, T, C) (copy_to_user ((char*)(T), (char*)(F), (C)) > 0 ? EFAULT : 0)
 
 /* kernel print statements */
-#define printf printk
-#define uprintf printk
+#define printf(args...) printk(args)
+#define uprintf(args...) printk(args)
 
 
 #ifndef NGROUPS
index 1351d177fac6a5e3e04e8c8969c49e891e46eef7..63f09304cfca47515557838ee65231521f4573d6 100644 (file)
@@ -38,7 +38,11 @@ typedef struct socket *osi_socket;
 extern int osi_utoa(char *buf, size_t len, unsigned long val);
 #define osi_Assert(exp) (void)((exp) || (osi_AssertFailK( #exp , __FILE__, __LINE__), 0))
 
-#define        osi_Msg printf)(
+#ifdef AFS_LINUX20_ENV
+# define       osi_Msg printk)(
+#else
+# define       osi_Msg printf)(
+#endif
 #define osi_VMsg vprintf)(
 
 #define        osi_YieldIfPossible()