aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2017-03-05 23:44:35 +0200
committerKevin Wolf <kwolf@redhat.com>2017-04-27 15:39:49 +0200
commit0731a50feba67a829b86df6dffec682c821f1152 (patch)
tree287169ab1971ece29f3303c756c6e7b37bb680cf /block
parent81b2d5ceb0cfb4cdc2163492e3169ed714b0cda9 (diff)
block: Constify data passed by pointer to blk_name
blk_name() is not modifying data passed to it through pointer and it returns also a pointer to const so the argument can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/block-backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index 7405024e08..ae3d7713ce 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -420,7 +420,7 @@ void monitor_remove_blk(BlockBackend *blk)
* Return @blk's name, a non-null string.
* Returns an empty string iff @blk is not referenced by the monitor.
*/
-const char *blk_name(BlockBackend *blk)
+const char *blk_name(const BlockBackend *blk)
{
return blk->name ?: "";
}