Page MenuHomeFreeBSD

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

Authored by rlibby on Wed, Jun 26, 7:50 PM.
Tags
None
Referenced Files
F87074468: D45750.id140297.diff
Sat, Jun 29, 12:15 AM
F87074256: D45750.id140296.diff
Sat, Jun 29, 12:12 AM
F87066226: D45750.diff
Fri, Jun 28, 9:44 PM
Unknown Object (File)
Fri, Jun 28, 7:05 PM
Unknown Object (File)
Thu, Jun 27, 2:58 PM
Unknown Object (File)
Thu, Jun 27, 2:54 PM
Unknown Object (File)
Thu, Jun 27, 3:51 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.Wed, Jun 26, 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.Thu, Jun 27, 3:31 AM
This revision is now accepted and ready to land.Thu, Jun 27, 3:34 AM