Commit c09879b1 authored by Adam Wujek's avatar Adam Wujek 💬

kernel: remove variable comparison type warning

Remove following warning when comparing variables:
In file included from include/linux/cache.h:4:0,
                 from include/linux/time.h:4,
                 from include/linux/stat.h:18,
                 from include/linux/sysfs.h:20,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from
/nfs/cs-ccr-nfsdev/vol1/u1/awujek/coht/fmc/svec-sw/kernel/svec-sysfs.c:11:
/nfs/cs-ccr-nfsdev/vol1/u1/awujek/coht/fmc/svec-sw/kernel/svec-sysfs.c:
In function ‘__next_token’:
include/linux/kernel.h:724:17: warning: comparison of distinct pointer
types lacks a cast [enabled by default]
  (void) (&_min1 == &_min2);  \
                 ^
/nfs/cs-ccr-nfsdev/vol1/u1/awujek/coht/fmc/svec-sw/kernel/svec-sysfs.c:297:8:
note: in expansion of macro ‘min’
  len = min(p - tok + 1, buf_length - 1);
        ^
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent d6bee229
......@@ -294,7 +294,7 @@ static int __next_token(char **str, char *buf, int buf_length)
while (*p && !isspace(*p))
p++;
len = min(p - tok + 1, buf_length - 1);
len = min((int) (p - tok + 1), buf_length - 1);
memcpy(buf, tok, len);
buf[len - 1] = 0;
......
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