DisplayLink / evdi

Extensible Virtual Display Interface
MIT License
689 stars 179 forks source link

fix: 6.7.5-200.fc39.x86_64 compilation error #458

Closed Kronk74 closed 3 months ago

Kronk74 commented 4 months ago

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:

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 commented 4 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

displaylink-emajewsk commented 3 months ago

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.

sarabrajsingh commented 3 months ago

both casts work for compilation on f39.

displaylink-emajewsk commented 3 months ago

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