diff options
author | David Sterba <dsterba@suse.com> | 2019-10-01 19:57:37 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-11-18 12:46:52 +0100 |
commit | 4143cb8b6f00910e73a7503fd922211b9f08cf48 (patch) | |
tree | 6e61a1f2ac756102f27cf4dc9a0ca19359259c81 /fs/btrfs/volumes.c | |
parent | btrfs: add __cold attribute to more functions (diff) | |
download | linux-4143cb8b6f00910e73a7503fd922211b9f08cf48.tar.xz linux-4143cb8b6f00910e73a7503fd922211b9f08cf48.zip |
btrfs: add const function attribute
For some reason the attribute is called __attribute_const__ and not
__const, marks functions that have no observable effects on program
state, IOW not reading pointers, just the arguments and calculating a
value. Allows the compiler to do some optimizations, based on
-Wsuggest-attribute=const . The effects are rather small, though, about
60 bytes decrese of btrfs.ko.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 173427731a69..d09371b0cdf9 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -297,7 +297,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, DEFINE_MUTEX(uuid_mutex); static LIST_HEAD(fs_uuids); -struct list_head *btrfs_get_fs_uuids(void) +struct list_head * __attribute_const__ btrfs_get_fs_uuids(void) { return &fs_uuids; } |