From ff207f9b2e8c9c65260f2b11098a03803af91511 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Mon, 28 Oct 2019 16:26:43 -0400 Subject: [PATCH] Make __block_dev_get_elevator_name return const string Returning non-const char* doesn't have any benefits since the only caller casts the output pointer to const char *. This change fixes compilation on 5.3 kernel. Signed-off-by: Adam Rutkowski --- modules/cas_cache/volume/vol_block_dev_bottom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cas_cache/volume/vol_block_dev_bottom.c b/modules/cas_cache/volume/vol_block_dev_bottom.c index ab4a275..ccd94a2 100644 --- a/modules/cas_cache/volume/vol_block_dev_bottom.c +++ b/modules/cas_cache/volume/vol_block_dev_bottom.c @@ -92,7 +92,7 @@ uint64_t block_dev_get_byte_length(ocf_volume_t vol) } #if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 3, 0) -static char *__block_dev_get_elevator_name(struct request_queue *q) +static const char *__block_dev_get_elevator_name(struct request_queue *q) { if (q->elevator->elevator_type == NULL) return NULL; @@ -106,7 +106,7 @@ static char *__block_dev_get_elevator_name(struct request_queue *q) return q->elevator->elevator_type->elevator_name; } #else -static char *__block_dev_get_elevator_name(struct request_queue *q) +static const char *__block_dev_get_elevator_name(struct request_queue *q) { if (q->elevator->type == NULL) return NULL;