Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: lpc_ich: Use ALIGN_DOWN() to obtain the start of the SPI base range

Instead of open coding, use ALIGN_DOWN() for alignment.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231229145059.6138-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Ilpo Järvinen and committed by
Lee Jones
fc99c013 1d8c51ed

+2 -1
+2 -1
drivers/mfd/lpc_ich.c
··· 38 38 39 39 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 40 40 41 + #include <linux/align.h> 41 42 #include <linux/kernel.h> 42 43 #include <linux/module.h> 43 44 #include <linux/errno.h> ··· 1322 1321 case INTEL_SPI_BYT: 1323 1322 pci_read_config_dword(dev, SPIBASE_BYT, &spi_base); 1324 1323 if (spi_base & SPIBASE_BYT_EN) { 1325 - res->start = spi_base & ~(SPIBASE_BYT_SZ - 1); 1324 + res->start = ALIGN_DOWN(spi_base, SPIBASE_BYT_SZ); 1326 1325 res->end = res->start + SPIBASE_BYT_SZ - 1; 1327 1326 1328 1327 info->set_writeable = lpc_ich_byt_set_writeable;