关闭

tagged initiallization

419人阅读 评论(0) 收藏 举报
分类:

struct file_operations scull_fops = {
      .owner = THIS_MODULE,
      .llseek = scull_llseek,
      .read = scull_read,
      .write = scull_write,
      .ioctl = scull_ioctl,
      .open = scull_open,
      .release = scull_release,
};


This declaration uses the standard C tagged structure initialization syntax. This syntax is preferred because it makes drivers more portable across changes in the definitions of the structures and, arguably, makes the code more compact and readable.

Tagged initialization allows the reordering of structure members; in some cases, substantial performance improvements have been realized by placing pointers to frequently accessed members in the same hardware cache line.



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:242654次
    • 积分:3812
    • 等级:
    • 排名:第8382名
    • 原创:108篇
    • 转载:240篇
    • 译文:4篇
    • 评论:9条
    文章分类
    最新评论