./include/linux/bug.h:37:45: error: negative width in bit-field ''
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
^
./include/linux/kernel.h:857:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
BUILD_BUG_ON_ZERO((perms) & 2) +
^
./include/linux/sysfs.h:102:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
.mode = VERIFY_OCTAL_PERMISSIONS(_mode) },
^
./include/linux/device.h:578:45: note: in expansion of macro '__ATTR'
struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
^
/home/ivan/ivan/Ecar507/longan/thirty/ltr_303/ltr_303als.c:355:8: note: in expansion of macro 'DEVICE_ATTR'
static DEVICE_ATTR(ls_poll_delay, 0666,
------------------------------------------------------------解决方案-------------------------------------------------------
在调用DEVICE_ATTR之前重新定义VERIFY_OCTAL_PERMISSIONS,至于原因,可以去跟踪DEVICE_ATTR这个宏的定义。
#undef VERIFY_OCTAL_PERMISSIONS
#define VERIFY_OCTAL_PERMISSIONS(parmx) (parmx)
static DEVICE_ATTR(lux, 0666,
ltr303_als_lux_show, NULL);
static DEVICE_ATTR(enable, 0666,
NULL, ltr303_enable_store);
static DEVICE_ATTR(ls_poll_delay, 0666,
ltr303_delay_show, ltr303_delay_store);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)