Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9075fa9 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

treewide: use __printf not __attribute__((format(printf,...)))



Standardize the style for compiler based printf format verification.
Standardized the location of __printf too.

Done via script and a little typing.

$ grep -rPl --include=*.[ch] -w "__attribute__" * | \
  grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
  xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

[akpm@linux-foundation.org: revert arch bits]
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ae29bc92
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ hisax_findcard(int driverid)
	return (struct IsdnCardState *) 0;
}

static __attribute__((format(printf, 3, 4))) void
static __printf(3, 4) void
link_debug(struct Channel *chanp, int direction, char *fmt, ...)
{
	va_list args;
@@ -1068,7 +1068,7 @@ init_d_st(struct Channel *chanp)
	return 0;
}

static __attribute__((format(printf, 2, 3))) void
static __printf(2, 3) void
callc_debug(struct FsmInst *fi, char *fmt, ...)
{
	va_list args;
+2 −2
Original line number Diff line number Diff line
@@ -1287,9 +1287,9 @@ int jiftime(char *s, long mark);

int HiSax_command(isdn_ctrl * ic);
int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
__attribute__((format(printf, 3, 4)))
__printf(3, 4)
void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
__attribute__((format(printf, 3, 0)))
__printf(3, 0)
void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
void HiSax_reportcard(int cardnr, int sel);
int QuickHex(char *txt, u_char * p, int cnt);
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#define B_XMTBUFREADY	1
#define B_ACKPENDING	2

__attribute__((format(printf, 2, 3)))
__printf(2, 3)
void debugl1(struct IsdnCardState *cs, char *fmt, ...);
void DChannel_proc_xmt(struct IsdnCardState *cs);
void DChannel_proc_rcv(struct IsdnCardState *cs);
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ static char *strL3Event[] =
	"EV_TIMEOUT",
};

static __attribute__((format(printf, 2, 3))) void
static __printf(2, 3) void
l3m_debug(struct FsmInst *fi, char *fmt, ...)
{
	va_list args;
+2 −2
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ static struct FsmNode L1FnList[] __initdata =
	{ST_L1_F8, EV_IND_RSY,           l1_ignore},
};

static __attribute__((format(printf, 2, 3)))
static __printf(2, 3)
void l1m_debug(struct FsmInst *fi, char *fmt, ...)
{
	va_list args;
@@ -270,7 +270,7 @@ static char *strDoutEvent[] =
	"EV_DOUT_UNDERRUN",
};

static __attribute__((format(printf, 2, 3)))
static __printf(2, 3)
void dout_debug(struct FsmInst *fi, char *fmt, ...)
{
	va_list args;
Loading