From: Johannes Berg <johannes@sipsolutions.net>
To: Kalle Valo <kvalo@kernel.org>, Dan Carpenter <dan.carpenter@oracle.com>
Cc: Francesco Magliocca <franciman12@gmail.com>,
Jeff Johnson <quic_jjohnson@quicinc.com>,
ath10k@lists.infradead.org, rmanohar@qti.qualcomm.com,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linuxfoundation.org>
Subject: Re: Use of void pointer arithmetic?
Date: Thu, 24 Feb 2022 11:31:12 +0100 [thread overview]
Message-ID: <2fd265ec46a8b582b7c5dea9524185b6fe1b0322.camel@sipsolutions.net> (raw)
In-Reply-To: <87fso8vb3w.fsf_-_@kernel.org>
On Thu, 2022-02-24 at 11:59 +0200, Kalle Valo wrote:
>
> A good question. I have always just thought we should avoid void pointer
> arithmetic due to the C standard, but now that you mention it void
> pointers can indeed simplify the code. So I'm not so sure anymore.
>
> Any opinions? Is there a kernel wide recommendation for this?
The kernel only enables it with W=3, which I guess nobody uses anyway
... Originally it came from commit 4a5838ad9d2d ("kbuild: Add extra gcc
checks") with a pointer to
http://marc.info/?l=kernel-janitors&m=129802065918147&w=2
(which is offline right now due to an expired certificate ...)
but setting back my clock it seems to point to
https://lore.kernel.org/all/20110218091716.GA4384@bicker/
but the thread kind of revolves around -Wconversion.
FreeBSD does enable -Wpointer-arith which is why we've been trying to
keep iwlwifi clean as a courtesy to them, but for really Linux-only code
I dunno if there's much point. Although of course that applies also to
FreeBSD ...
johannes
next prev parent reply other threads:[~2022-02-24 10:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220221122638.7971-1-franciman12@gmail.com>
[not found] ` <e32de43c-e00a-5766-e988-fe192d36d719@quicinc.com>
[not found] ` <CAH4F6utmtAM3CzX2_Fbn94Sb-X8m0patPh8yWwbuBB0t1VYH=g@mail.gmail.com>
[not found] ` <87o82wvhtk.fsf@kernel.org>
[not found] ` <20220224075346.GL3943@kadam>
2022-02-24 9:59 ` Kalle Valo
2022-02-24 10:31 ` Johannes Berg [this message]
2022-02-24 17:45 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2fd265ec46a8b582b7c5dea9524185b6fe1b0322.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ath10k@lists.infradead.org \
--cc=dan.carpenter@oracle.com \
--cc=franciman12@gmail.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_jjohnson@quicinc.com \
--cc=rmanohar@qti.qualcomm.com \
--cc=torvalds@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®