Commit a6b3c483 authored by Emese Revfy's avatar Emese Revfy Committed by David S. Miller

isdn: Constify some function parameters

The coming initify gcc plugin expects const pointer types, and caught
some __printf arguments that weren't const yet. This fixes those.
Signed-off-by: default avatarEmese Revfy <re.emese@gmail.com>
[kees: expanded commit message]
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a60c907
...@@ -659,7 +659,7 @@ int jiftime(char *s, long mark) ...@@ -659,7 +659,7 @@ int jiftime(char *s, long mark)
static u_char tmpbuf[HISAX_STATUS_BUFSIZE]; static u_char tmpbuf[HISAX_STATUS_BUFSIZE];
void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt,
va_list args) va_list args)
{ {
/* if head == NULL the fmt contains the full info */ /* if head == NULL the fmt contains the full info */
...@@ -669,23 +669,24 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...@@ -669,23 +669,24 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
u_char *p; u_char *p;
isdn_ctrl ic; isdn_ctrl ic;
int len; int len;
const u_char *data;
if (!cs) { if (!cs) {
printk(KERN_WARNING "HiSax: No CardStatus for message"); printk(KERN_WARNING "HiSax: No CardStatus for message");
return; return;
} }
spin_lock_irqsave(&cs->statlock, flags); spin_lock_irqsave(&cs->statlock, flags);
p = tmpbuf;
if (head) { if (head) {
p = tmpbuf;
p += jiftime(p, jiffies); p += jiftime(p, jiffies);
p += sprintf(p, " %s", head); p += sprintf(p, " %s", head);
p += vsprintf(p, fmt, args); p += vsprintf(p, fmt, args);
*p++ = '\n'; *p++ = '\n';
*p = 0; *p = 0;
len = p - tmpbuf; len = p - tmpbuf;
p = tmpbuf; data = tmpbuf;
} else { } else {
p = fmt; data = fmt;
len = strlen(fmt); len = strlen(fmt);
} }
if (len > HISAX_STATUS_BUFSIZE) { if (len > HISAX_STATUS_BUFSIZE) {
...@@ -699,13 +700,12 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...@@ -699,13 +700,12 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
if (i >= len) if (i >= len)
i = len; i = len;
len -= i; len -= i;
memcpy(cs->status_write, p, i); memcpy(cs->status_write, data, i);
cs->status_write += i; cs->status_write += i;
if (cs->status_write > cs->status_end) if (cs->status_write > cs->status_end)
cs->status_write = cs->status_buf; cs->status_write = cs->status_buf;
p += i;
if (len) { if (len) {
memcpy(cs->status_write, p, len); memcpy(cs->status_write, data + i, len);
cs->status_write += len; cs->status_write += len;
} }
#ifdef KERNELSTACK_DEBUG #ifdef KERNELSTACK_DEBUG
...@@ -729,7 +729,7 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...@@ -729,7 +729,7 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
} }
} }
void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...) void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...)
{ {
va_list args; va_list args;
......
...@@ -1288,9 +1288,9 @@ int jiftime(char *s, long mark); ...@@ -1288,9 +1288,9 @@ int jiftime(char *s, long mark);
int HiSax_command(isdn_ctrl *ic); int HiSax_command(isdn_ctrl *ic);
int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb); int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
__printf(3, 4) __printf(3, 4)
void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...); void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...);
__printf(3, 0) __printf(3, 0)
void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args); void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, va_list args);
void HiSax_reportcard(int cardnr, int sel); void HiSax_reportcard(int cardnr, int sel);
int QuickHex(char *txt, u_char *p, int cnt); int QuickHex(char *txt, u_char *p, int cnt);
void LogFrame(struct IsdnCardState *cs, u_char *p, int size); void LogFrame(struct IsdnCardState *cs, u_char *p, int size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment