From: Satyam Sharma <satyam@infradead.org>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
Joe Perches <joe@perches.com>, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] trivial - constify sched.h
Date: Fri, 31 Aug 2007 02:11:14 +0530 (IST) [thread overview]
Message-ID: <alpine.LFD.0.999.0708310121121.28360@enigma.security.iitk.ac.in> (raw)
In-Reply-To: <Pine.LNX.4.64.0708302120290.24730@fbirervta.pbzchgretzou.qr>
On Thu, 30 Aug 2007, Jan Engelhardt wrote:
>
> On Aug 28 2007 01:33, Alexey Dobriyan wrote:
> >
> >On Mon, Aug 27, 2007 at 01:40:31PM -0700, Joe Perches wrote:
> >> Add const to some struct task_struct * uses
> >
> >Why, oh, why?
>
>
> So that you can actually pass in a const struct task_struct * without having
> to cast it back to [non-const].
... which makes zero sense, because ...
> Why one would have a const struct task_struct * in the first place
> is a different matter.
... exactly.
> But see http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=77adbfbf4cf96fedf9b75bb330704828c187b190
That commit const-ified struct timespec * or struct timeval * arguments,
which made sense because: (1) those functions really did not modify the
passed structs, and, (2) callers that pass in const struct timeval *
or const struct timespec * are indeed plausible (because one can plausibly
have const timeval/timespec structs). As the changelog suggested, those
callers were having to cast away the const qualifier before passing to
these functions to avoid seeing "passing argument discards qualifiers"
warnings. While (1) holds true for the sched.h case here, (2) does not
(and there are no warnings to shut up either).
If one really wants to go about "constifying" the kernel, then I think
there's a lot of _data_ out there that should first be made const-
qualified. xxx_ops function tables, and the like.
next prev parent reply other threads:[~2007-08-30 20:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-27 20:40 Joe Perches
2007-08-27 20:59 ` Jiri Slaby
2007-08-27 21:33 ` Alexey Dobriyan
2007-08-30 19:24 ` Jan Engelhardt
2007-08-30 20:41 ` Satyam Sharma [this message]
2007-08-30 20:55 ` Jan Engelhardt
2007-08-30 21:21 ` Satyam Sharma
2007-08-31 13:53 ` Christoph Hellwig
2007-08-31 14:03 ` Matthew Wilcox
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=alpine.LFD.0.999.0708310121121.28360@enigma.security.iitk.ac.in \
--to=satyam@infradead.org \
--cc=adobriyan@gmail.com \
--cc=jengelh@computergmbh.de \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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®