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>
Šī revīzija ir iekļauta:
David Sterba
2019-10-01 19:57:37 +02:00
vecāks b105e92755
revīzija 4143cb8b6f
4 mainīti faili ar 4 papildinājumiem un 4 dzēšanām

Parādīt failu

@@ -66,7 +66,7 @@ static struct file_system_type btrfs_root_fs_type;
static int btrfs_remount(struct super_block *sb, int *flags, char *data);
const char *btrfs_decode_error(int errno)
const char * __attribute_const__ btrfs_decode_error(int errno)
{
char *errstr = "unknown";