瀏覽代碼

coda_venus_readdir(): use offsetof()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 14 年之前
父節點
當前提交
ee60498f3e
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      fs/coda/dir.c

+ 1 - 2
fs/coda/dir.c

@@ -449,8 +449,7 @@ static int coda_venus_readdir(struct file *coda_file, void *buf,
 	struct file *host_file;
 	struct file *host_file;
 	struct dentry *de;
 	struct dentry *de;
 	struct venus_dirent *vdir;
 	struct venus_dirent *vdir;
-	unsigned long vdir_size =
-	    (unsigned long)(&((struct venus_dirent *)0)->d_name);
+	unsigned long vdir_size = offsetof(struct venus_dirent, d_name);
 	unsigned int type;
 	unsigned int type;
 	struct qstr name;
 	struct qstr name;
 	ino_t ino;
 	ino_t ino;