Page MenuHomeFreeBSD

nvme: avoid gcc -Werror=int-to-pointer-cast on 32-bit arch
ClosedPublic

Authored by rlibby on Jun 26 2024, 7:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 12:29 PM
Unknown Object (File)
Tue, Oct 29, 4:08 AM
Unknown Object (File)
Tue, Oct 29, 4:08 AM
Unknown Object (File)
Tue, Oct 29, 4:08 AM
Unknown Object (File)
Tue, Oct 29, 4:08 AM
Unknown Object (File)
Tue, Oct 29, 3:48 AM
Unknown Object (File)
Wed, Oct 23, 4:07 PM
Unknown Object (File)
Oct 8 2024, 8:55 AM
Subscribers

Details

Summary

There may be a nicer way to spell this.

Test Plan

make buildkernel on amd64 and i386, examine warnings

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rlibby edited the test plan for this revision. (Show Details)
rlibby added a reviewer: imp.
This revision is now accepted and ready to land.Jun 26 2024, 8:13 PM

why the crazy vm_offset_t instead of uintptr_t??

sys/dev/nvme/nvme_ctrlr.c
1366–1367

why not (uintptr_t) here and below?

In D45750#1043538, @imp wrote:

why the crazy vm_offset_t instead of uintptr_t??

Yeah, I think you're right. I waffled on that, I'm happy to make it uintptr_t, I believe they're always the same size.

My drive-by understanding was that in the is_user block, npc->addr is a user address and in that sense vm_offset_t may technically be more appropriate to represent it than a pointer (and vmapbuf casts the pointer to vm_offset_t)... but I'm not proposing we change the vmapbuf prototype for this, and anyway that doesn't apply to the second case.

I'll fix this up with uintptr_t this evening.

imp: s/vm_offset_t/uintptr_t/

This revision now requires review to proceed.Jun 27 2024, 3:31 AM
This revision is now accepted and ready to land.Jun 27 2024, 3:34 AM