From b76521f6482d2a2a691e4eb1a496d55d73aea064 Mon Sep 17 00:00:00 2001 From: Kelvin Cao Date: Thu, 18 Nov 2021 16:38:03 -0800 Subject: PCI/switchtec: Declare local state_names[] as static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The local state_names[] array is constant and need not be allocated and populated each time we enter stuser_set_state(). Declare it as static. See the link below for the discussion. https://lore.kernel.org/r/20211014141859.11444-1-kelvin.cao@microchip.com/ [bhelgaas: simplify commit log] Suggested-by: Krzysztof WilczyƄski Link: https://lore.kernel.org/r/20211119003803.2333-3-kelvin.cao@microchip.com Signed-off-by: Kelvin Cao Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe --- drivers/pci/switch/switchtec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 6e2d6c5ea4b5..c36c1238c604 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -122,7 +122,7 @@ static void stuser_set_state(struct switchtec_user *stuser, { /* requires the mrpc_mutex to already be held when called */ - const char * const state_names[] = { + static const char * const state_names[] = { [MRPC_IDLE] = "IDLE", [MRPC_QUEUED] = "QUEUED", [MRPC_RUNNING] = "RUNNING", -- cgit v1.2.3-59-g8ed1b