ipmi:si: Move SI type information into an info structure
authorCorey Minyard <corey@minyard.net>
Tue, 15 Apr 2025 19:30:58 +0000 (14:30 -0500)
committerCorey Minyard <corey@minyard.net>
Wed, 7 May 2025 22:25:47 +0000 (17:25 -0500)
commit9cba938aecbbffe95286e0b07f21ec6d4b12b42c
treefb720dd4671afc362bb20e1814895f7025cbbf3b
parent4f79eaa2ceac86a0e0f304b0bab556cca5bf4f30
ipmi:si: Move SI type information into an info structure

Andy reported:

Debian clang version 19.1.7 is not happy when compiled with
`make W=1` (note, CONFIG_WERROR=y is the default):

ipmi_si_platform.c:268:15: error: cast to smaller integer type 'enum si_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
  268 |         io.si_type      = (enum si_type)device_get_match_data(&pdev->dev);

The IPMI SI type is an enum that was cast into a pointer that was
then cast into an enum again.  That's not the greatest style, so
instead create an info structure to hold the data and use that.

Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Closes: https://lore.kernel.org/lkml/20250415085156.446430-1-andriy.shevchenko@linux.intel.com/
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Corey Minyard <corey@minyard.net>
drivers/char/ipmi/ipmi_si.h
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_si_parisc.c
drivers/char/ipmi/ipmi_si_pci.c
drivers/char/ipmi/ipmi_si_platform.c