Skip to content

Commit bbd7a03

Browse files
ColinIanKingJiri Kosina
authored andcommitted
HID: intel-thc-hid: intel-thc: make read-only arrays static const
Don't populate the read-only arrays frequency and frequency_div on the stack at run time, instead make them static const. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Even Xu <even.xu@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent 37d66cf commit bbd7a03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ EXPORT_SYMBOL_NS_GPL(thc_port_select, "INTEL_THC");
11211121

11221122
static u8 thc_get_spi_freq_div_val(struct thc_device *dev, u32 spi_freq_val)
11231123
{
1124-
int frequency[] = {
1124+
static const int frequency[] = {
11251125
THC_SPI_FREQUENCY_7M,
11261126
THC_SPI_FREQUENCY_15M,
11271127
THC_SPI_FREQUENCY_17M,
@@ -1130,7 +1130,7 @@ static u8 thc_get_spi_freq_div_val(struct thc_device *dev, u32 spi_freq_val)
11301130
THC_SPI_FREQUENCY_31M,
11311131
THC_SPI_FREQUENCY_41M,
11321132
};
1133-
u8 frequency_div[] = {
1133+
static const u8 frequency_div[] = {
11341134
THC_SPI_FRQ_DIV_2,
11351135
THC_SPI_FRQ_DIV_1,
11361136
THC_SPI_FRQ_DIV_7,

0 commit comments

Comments
 (0)