]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
linuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC warning
authorcem <cem@FreeBSD.org>
Mon, 9 Nov 2015 16:50:42 +0000 (16:50 +0000)
committercem <cem@FreeBSD.org>
Mon, 9 Nov 2015 16:50:42 +0000 (16:50 +0000)
The code compiles fine under Clang, but GCC on PPC is less permissive about
integer and pointer sizes.  (An intmax_t is clearly *large enough* to hold a
pointer value.)

Another follow-up to r290475.

Reported by: jhibbits
Sponsored by: EMC / Isilon Storage Division

sys/compat/linuxkpi/common/include/linux/sysfs.h

index a102d4391ff825a26819e556adc783f61d16fac4..68c6e9224d9f8d412be9e10a27cd135718f003bb 100644 (file)
@@ -80,7 +80,7 @@ sysctl_handle_attr(SYSCTL_HANDLER_ARGS)
        ssize_t len;
 
        kobj = arg1;
-       attr = (struct attribute *)arg2;
+       attr = (struct attribute *)(intptr_t)arg2;
        if (kobj->ktype == NULL || kobj->ktype->sysfs_ops == NULL)
                return (ENODEV);
        buf = (char *)get_zeroed_page(GFP_KERNEL);