Skip to content

Commit b76521f

Browse files
kelvin-caobjorn-helgaas
authored andcommitted
PCI/switchtec: Declare local state_names[] as static
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 <kw@linux.com> Link: https://lore.kernel.org/r/20211119003803.2333-3-kelvin.cao@microchip.com Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
1 parent bb17b15 commit b76521f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pci/switch/switchtec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static void stuser_set_state(struct switchtec_user *stuser,
122122
{
123123
/* requires the mrpc_mutex to already be held when called */
124124

125-
const char * const state_names[] = {
125+
static const char * const state_names[] = {
126126
[MRPC_IDLE] = "IDLE",
127127
[MRPC_QUEUED] = "QUEUED",
128128
[MRPC_RUNNING] = "RUNNING",

0 commit comments

Comments
 (0)