看驱动的时候,时常会有如下代码:
.remove = __devexit_p(XX_exit),

这里的__devexit_p有什么作用呢?
我在include/linux/init.h中找到了它的定义:

/* Functions marked as __devexit may be discarded at kernel link time, depending
on config options. Newer versions of binutils detect references from
retained sections to discarded sections and flag an error. Pointers to
__devexit functions must use __devexit_p(function_name), the wrapper will
insert either the function_name or NULL, depending on the config options.
*/
#if defined(MODULE) || defined(CONFIG_HOTPLUG)
#define __devexit_p(x) x
#else
#define __devexit_p(x) NULL
#endif

 

编译成模块或有热拔插功能时, 就需要exit函数。 否则可以为NULL, 节约空间

最新文章

  1. CI Weekly #6 | 再谈 Docker / CI / CD 实践经验
  2. zabbix触发器依赖
  3. Simple colum formatting in Yii 2 GridView
  4. tarjan算法+缩点:求强连通分量 POJ 2186
  5. Watch The Movie
  6. Storyboard 跳转 和 传值
  7. 机器学习之神经网络模型-上(Neural Networks: Representation)
  8. 服务端缓存HttpRuntime.Cache的使用
  9. 修改win7注册表发挥大容量内存优势
  10. Ubuntu 16.04 LTS安装搜狗拼音输入法网易云音乐 Remarkable
  11. 连表查询都用Left Join吧
  12. Rest API 操作List Items
  13. rest_famework 增删改查初第二阶段(中级,此阶段是优化初级阶段的代码)的使用
  14. Ubuntu 安装 VS code
  15. owa2013配置HTTPS
  16. Hadoop集群安装-CDH5(3台服务器集群)
  17. Lock 和 synchronized 的区别
  18. vue路由组件传参
  19. 3、shader深度测试(Cull、ZWrite 、ZTest )
  20. C++语言基础(9)-继承

热门文章

  1. C# winform 获取当前路径
  2. fatal error: malformed or corrupted AST file: 'Unable to load module Darwin.pcm 问题解决
  3. [转]oracle存储过程、声明变量、for循环
  4. 将android程序中的数据库导出到SD卡
  5. spring如何引用properties文件里的配置
  6. js 停止事件冒泡 阻止浏览器的默认行为
  7. asp.net session的使用与过期实例代码
  8. Collabration Web Application Screenshot(English Language) Free download now!
  9. HTML&CSS精选笔记_浮动与定位
  10. sublime常用插件及配置