Merge pull request #167 from arutk/fix_block_dev_get_elevator_name_prototype

Make __block_dev_get_elevator_name return const string
This commit is contained in:
Robert Baldyga 2019-11-05 12:35:21 +01:00 committed by GitHub
commit baa621e882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ uint64_t block_dev_get_byte_length(ocf_volume_t vol)
} }
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 3, 0) #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) if (q->elevator->elevator_type == NULL)
return 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; return q->elevator->elevator_type->elevator_name;
} }
#else #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) if (q->elevator->type == NULL)
return NULL; return NULL;