Closed Kronk74 closed 3 months ago
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
.
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--help
for all options) We need backward compatibility and this script is a handy way of testing build compliance with many kernel versions../ci/run_style_check
We 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!