Re: [PATCH 2/2] proc: convert everything to "struct proc_ops"

youling257
2021-05-10T14:01:53Z

Hi, my xt_qtaguid module need convert to "struct proc_ops",
https://github.com/youling257/android-4.9/commit/a6e3cddcceb96eb3edeb0da0951399b75d4f8731
https://github.com/youling257/android-4.9/commit/9eb92f5bcdcbc5b54d7dfe4b3050c8b9b8a17999

static const struct proc_ops qtudev_proc_ops = {
.proc_open = qtudev_open,
.proc_release = qtudev_release,
};

static struct miscdevice qtu_device = {
.minor = MISC_DYNAMIC_MINOR,
.name = QTU_DEV_NAME,
.fops = &qtudev_proc_ops,
/* How sad it doesn't allow for defaults: .mode = S_IRUGO | S_IWUSR */
};

I have problem about ".fops = &qtudev_fops,", convert to ".fops = &qtudev_proc_ops," is right?

build error, can you help me?
CALL /root/1/scripts/atomic/check-atomics.sh
CALL /root/1/scripts/checksyscalls.sh
CHK include/generated/compile.h
CC net/netfilter/xt_qtaguid.o
/root/1/net/netfilter/xt_qtaguid.c:2895:10: error: initialization of ‘const struct file_operations *’ from incompatible pointer type ‘const struct proc_ops *’ [-Werror=incompatible-pointer-types]
2895 | .fops = &qtudev_proc_ops,
| ^
/root/1/net/netfilter/xt_qtaguid.c:2895:10: note: (near initialization for ‘qtu_device.fops’)
cc1: some warnings being treated as errors