0666权限,0666 权限

使用DEVICE_ATTR设置0666权限编译报错:

./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);  

0666权限664权限权限06440525日语常用寒暄语01卡管家一匹无卡支付界的实力黑马JSP程序如何打包抖音刷单平台06月24日各大市场铝锭价格表08年属于什么生肖年考试让我走上人生巅峰txt全集下载凤云倾轩辕夜阑TXT下载实力武装MINIJCW改装案例年兽的画法简单又漂亮幼儿园作画中国年兽双色球走势综合朱砂和神砂是两种药吗039试探0314现实混杂着虚假01vip彩票下载安装0406故事会交友软件随机匹配聊天手机ip地址不可用茶叶送人一般送多少克简述合法性机制的内涵03版射雕英雄传演员表03射雕演员