evdi icon indicating copy to clipboard operation
evdi copied to clipboard

fix: 6.7.5-200.fc39.x86_64 compilation error

Open Kronk74 opened this issue 1 year ago • 1 comments

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!

Kronk74 avatar Feb 23 '24 05:02 Kronk74

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

Kronk74 avatar Feb 23 '24 05:02 Kronk74

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.

displaylink-emajewsk avatar Apr 03 '24 10:04 displaylink-emajewsk

both casts work for compilation on f39.

sarabrajsingh avatar Apr 07 '24 00:04 sarabrajsingh

Yes, I think it's because despite having different signedness, unsigned int is a subset of long long int.

displaylink-emajewsk avatar Apr 08 '24 07:04 displaylink-emajewsk