Thread (3 messages) 3 messages, 2 authors, 2021-03-10

Re: [PATCH iwlwifi-next] iwlwifi: de-const properly where needed

From: Kalle Valo <hidden>
Date: 2021-03-01 07:25:03

"Bjoern A. Zeeb" [off-list ref] writes:
In order to de-const variables simply casting through (void *) is
not enough: "cast from 'const .. *' to 'void *' drops const qualifier".
Cast through (uintptr_t) as well [1] to make this compile on systems
with more strict requirements.
In addition passing const void *data to dma_map_single() also
drops the (const) qualifier.  De-constify on variable on assignment
which may be overwritten later.  In either case the (void *) cast
to dma_map_single() is not needed (anymore) either.

[1] See __DECONST() in sys/sys/cdefs.h in FreeBSD

Sponsored-by:  The FreeBSD Foundation
Signed-off-by: Bjoern A. Zeeb <redacted>
Why are we using the const in the first place? That sounds like a bug to
me.

BTW, your patches are hard to read due to excessive context, I guess you
are using a very large context value with diff? Our recommendation is to
use git with default values, see the wiki below for more info.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help