fix: 6.7.5-200.fc39.x86_64 compilation error
This should fix this error when compiling :
/tmp/evdi/module/evdi_gem.c: In function ‘evdi_gem_fault’: /tmp/evdi/module/evdi_gem.c:214:40: error: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘loff_t’ {aka ‘long long int’} [-Werror=sign-compare] 214 | if (!obj->pages || page_offset >= num_pages) | ^~
Before submitting the PR please make sure you have run ci scripts:
-
./ci/build_against_kernel(see--helpfor all options) We need backward compatibility and this script is a handy way of testing build compliance with many kernel versions. -
./ci/run_style_checkWe want to be as style compliant as possible. Again, this is a handy way of checking it.
If you have more than one change consider creating separate PRs for them; it will make the review process much easier. Also provide some description (links to source code or mailing list are welcome - this might help to understand the change).
Thanks for the contribution!
Hi,
I just made few research on my own to fix my error on my computer and I found this. I don't know if it is the most elegant way or if it will break other stuffs, I just wanted to share my solution :)
Regards
page_offset is an unsigned long so you don't remove different signedness by casting it to unsigned. I'd prefer num_pages to be cast to unsigned long.
both casts work for compilation on f39.
Yes, I think it's because despite having different signedness, unsigned int is a subset of long long int.