asterisk / dahdi-linux

This is the official dahdi-linux repository. All issues and PR should be raised here.
GNU General Public License v2.0
47 stars 69 forks source link

In Rocky Linux 9.2 got compilation failures related with PDE_DATA #37

Open rodolfojcj opened 11 months ago

rodolfojcj commented 11 months ago

When using either the DAHDI linux complete 3.2.0 tar.gz file or the master branch sources, trying to compile on Rocky Linux 9.2 fails with error messages like these (not necessarily all of them at the same attempt):

linux/drivers/dahdi/xpp/xbus-core.c:1842:50: error: implicit declaration of function ‘PDE_DATA’; did you mean ‘NODE_DATA’? [-Werror=implicit-function-declaration]
1842 |         return single_open(file, xbus_proc_show, PDE_DATA(inode));
                                                        ^~~~~~~~
|                                                       NODE_DATA

Or

linux/drivers/dahdi/xpp/xbus-core.c:1842:50: warning: passing argument 3 of ‘single_open’ makes pointer from integer without a cast [-Wint-conversion]
1842 |         return single_open(file, xbus_proc_show, PDE_DATA(inode));
|                                                       ^~~~~~~~~~~~~~~
|                                                       |
|                                                       int

Or

linux/drivers/dahdi/xpp/xbus-core.c:1949:28: warning: assignment to ‘void *’ from ‘ int’ makes pointer from integer without a cast [-Wint-conversion]
1949 |         file->private_data = PDE_DATA(inode);
rodolfojcj commented 11 months ago

The attached file dahdi-linux-issue-37-fix-24sept2023.zip has a possible fix to this issue.

I tested it with:

In all those cases the compilation is successful.

Thanks in advance for any developer of this project that may review and possibly apply this fix for the master branch.