Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1678036 > unrolled thread

[PATCH] mmc: rtsx_usb_sdmmc: make array 'width' static const

Started byColin King <colin.king@canonical.com>
First post2017-06-29 20:20 +0200
Last post2017-06-29 20:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] mmc: rtsx_usb_sdmmc: make array 'width' static const Colin King <colin.king@canonical.com> - 2017-06-29 20:20 +0200

#1678036 — [PATCH] mmc: rtsx_usb_sdmmc: make array 'width' static const

FromColin King <colin.king@canonical.com>
Date2017-06-29 20:20 +0200
Subject[PATCH] mmc: rtsx_usb_sdmmc: make array 'width' static const
Message-ID<tXMcN-2zD-9@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

array width is on-stack and not modified and should be
made static const.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/mmc/host/rtsx_usb_sdmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
index 12d2fbe9c520..76da1687ab37 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -909,7 +909,7 @@ static int sd_set_bus_width(struct rtsx_usb_sdmmc *host,
 		unsigned char bus_width)
 {
 	int err = 0;
-	u8 width[] = {
+	static const u8 width[] = {
 		[MMC_BUS_WIDTH_1] = SD_BUS_WIDTH_1BIT,
 		[MMC_BUS_WIDTH_4] = SD_BUS_WIDTH_4BIT,
 		[MMC_BUS_WIDTH_8] = SD_BUS_WIDTH_8BIT,
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web