]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: r8a66597-hcd: make read-only const arrays static
authorColin Ian King <colin.i.king@gmail.com>
Thu, 12 Sep 2024 13:23:45 +0000 (14:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Sep 2024 05:41:27 +0000 (07:41 +0200)
Don't populate the read-only const arrays fifoaddr, fifosel and fifoctr
on the stack at run time, instead make them static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240912132345.589397-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/r8a66597-hcd.c

index 9f4bf8c5f8a51a0698d2bd23f920f90596c149f7..6576515a29cd370fc6e55129695e57a020fa11e9 100644 (file)
@@ -297,9 +297,9 @@ static void put_child_connect_map(struct r8a66597 *r8a66597, int address)
 static void set_pipe_reg_addr(struct r8a66597_pipe *pipe, u8 dma_ch)
 {
        u16 pipenum = pipe->info.pipenum;
-       const unsigned long fifoaddr[] = {D0FIFO, D1FIFO, CFIFO};
-       const unsigned long fifosel[] = {D0FIFOSEL, D1FIFOSEL, CFIFOSEL};
-       const unsigned long fifoctr[] = {D0FIFOCTR, D1FIFOCTR, CFIFOCTR};
+       static const unsigned long fifoaddr[] = {D0FIFO, D1FIFO, CFIFO};
+       static const unsigned long fifosel[] = {D0FIFOSEL, D1FIFOSEL, CFIFOSEL};
+       static const unsigned long fifoctr[] = {D0FIFOCTR, D1FIFOCTR, CFIFOCTR};
 
        if (dma_ch > R8A66597_PIPE_NO_DMA)      /* dma fifo not use? */
                dma_ch = R8A66597_PIPE_NO_DMA;