aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c2
-rw-r--r--scripts/mod/modpost.c9
2 files changed, 3 insertions, 8 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index e7b5350b65ce..84e21201f3c0 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -245,7 +245,7 @@ static int do_ccw_entry(const char *filename,
245 id->cu_model); 245 id->cu_model);
246 ADD(alias, "dt", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE, 246 ADD(alias, "dt", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE,
247 id->dev_type); 247 id->dev_type);
248 ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE, 248 ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_MODEL,
249 id->dev_model); 249 id->dev_model);
250 return 1; 250 return 1;
251} 251}
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 30f3ac8eb43c..0b92ddff26fd 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -923,19 +923,14 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf,
923 923
924 va_start(ap, fmt); 924 va_start(ap, fmt);
925 len = vsnprintf(tmp, SZ, fmt, ap); 925 len = vsnprintf(tmp, SZ, fmt, ap);
926 if (buf->size - buf->pos < len + 1) { 926 buf_write(buf, tmp, len);
927 buf->size += 128;
928 buf->p = realloc(buf->p, buf->size);
929 }
930 strncpy(buf->p + buf->pos, tmp, len + 1);
931 buf->pos += len;
932 va_end(ap); 927 va_end(ap);
933} 928}
934 929
935void buf_write(struct buffer *buf, const char *s, int len) 930void buf_write(struct buffer *buf, const char *s, int len)
936{ 931{
937 if (buf->size - buf->pos < len) { 932 if (buf->size - buf->pos < len) {
938 buf->size += len; 933 buf->size += len + SZ;
939 buf->p = realloc(buf->p, buf->size); 934 buf->p = realloc(buf->p, buf->size);
940 } 935 }
941 strncpy(buf->p + buf->pos, s, len); 936 strncpy(buf->p + buf->pos, s, len);