From: Mitchell Blank Jr <mitch@sfgoth.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] simple const-ification for list.h
Date: Mon, 1 Sep 2003 03:42:21 -0700 [thread overview]
Message-ID: <20030901104221.GA15886@gaz.sfgoth.com> (raw)
This patch fixed up some warnings I was getting compiling some (unmerged)
code I'm working on. Basically a few trivial list.h functions can operate
safely on "const" pointers, so their prototypes should reflect that.
-Mitch
--- linux-2.6.0-test4-VIRGIN/include/linux/list.h 2003-07-13 20:34:41.000000000 -0700
+++ linux-2.6.0-test4mnb1/include/linux/list.h 2003-08-31 16:43:40.057169288 -0700
@@ -203,7 +203,7 @@
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
-static inline int list_empty(struct list_head *head)
+static inline int list_empty(const struct list_head *head)
{
return head->next == head;
}
@@ -408,12 +408,12 @@
#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
#define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL)
-static __inline__ int hlist_unhashed(struct hlist_node *h)
+static __inline__ int hlist_unhashed(const struct hlist_node *h)
{
return !h->pprev;
}
-static __inline__ int hlist_empty(struct hlist_head *h)
+static __inline__ int hlist_empty(const struct hlist_head *h)
{
return !h->first;
}
next reply other threads:[~2003-09-01 10:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-01 10:42 Mitchell Blank Jr [this message]
2003-09-01 12:22 ` [PATCH] __inline__ to inline in list.h Erlend Aasland
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=20030901104221.GA15886@gaz.sfgoth.com \
--to=mitch@sfgoth.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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®