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

From: youling257
Date: Mon May 10 2021 - 10:01:53 EST


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