https://github.com/torvalds/linux
Revision f4b477c47332367d35686bd2b808c2156b96d7c7 authored by Artem Bityutskiy on 10 January 2009, 11:12:09 UTC, committed by Linus Torvalds on 10 January 2009, 14:04:33 UTC
The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls
take a pointer to an RB node or RB root. They do not change the
pointed objects, so add a 'const' qualifier in order to make life
of the users of these functions easier.

Indeed, if I have my own constant pointer &const struct my_type *p,
and I call 'rb_next(&p->rb)', I get a GCC warning:

warning: passing argument 1 of ‘rb_next’ discards qualifiers from pointer target type

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cfce41a
History
Tip revision: f4b477c47332367d35686bd2b808c2156b96d7c7 authored by Artem Bityutskiy on 10 January 2009, 11:12:09 UTC
rbtree: add const qualifier to some functions
Tip revision: f4b477c
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
virt
.gitignore -rw-r--r-- 867 bytes
.mailmap -rw-r--r-- 3.9 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.5 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 106.2 KB
Makefile -rw-r--r-- 54.1 KB
README -rw-r--r-- 16.7 KB
REPORTING-BUGS -rw-r--r-- 3.1 KB

README

back to top