Re: [PATCHv7 3/3] misc: gehc-achc: new driver

From: Greg Kroah-Hartman
Date: Wed Jul 21 2021 - 12:13:49 EST


On Tue, Jul 13, 2021 at 06:35:28PM +0200, Sebastian Reichel wrote:
> General Electric Healthcare's PPD has a secondary processor from
> NXP's Kinetis K20 series. That device has two SPI chip selects:
>
> The main interface's behaviour depends on the loaded firmware
> and is currently unused.
>
> The secondary interface can be used to update the firmware using
> EzPort protocol. This is implemented by this driver using the
> kernel's firmware API. The firmware is being flashed into
> non-volatile flash memory, so it is enough to flash it once
> and not on every boot. Flashing will wear the flash memory
> (it has a life time of at least 10k programming cycles) and
> takes 3 minutes with the microcontroller being unusable. At
> the same time only occasional FW updates are expected (like e.g.
> a BIOS update). Thus the firmware update is triggered via sysfs
> instead of doing it in the driver's probe routine like many
> other drivers.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
> ---
> .../ABI/testing/sysfs-driver-ge-achc | 14 +
> drivers/misc/Kconfig | 11 +
> drivers/misc/Makefile | 1 +
> drivers/misc/gehc-achc.c | 542 ++++++++++++++++++
> drivers/spi/spidev.c | 1 -
> 5 files changed, 568 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/ABI/testing/sysfs-driver-ge-achc
> create mode 100644 drivers/misc/gehc-achc.c

This patch gives me build warnings:

drivers/misc/gehc-achc.c: In function ‘ezport_firmware_compare_data’:
./include/linux/minmax.h:20:35: warning: comparison of distinct pointer types lacks a cast
20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
./include/linux/minmax.h:26:18: note: in expansion of macro ‘__typecheck’
26 | (__typecheck(x, y) && __no_side_effects(x, y))
| ^~~~~~~~~~~
./include/linux/minmax.h:36:31: note: in expansion of macro ‘__safe_cmp’
36 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
./include/linux/minmax.h:45:25: note: in expansion of macro ‘__careful_cmp’
45 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/gehc-achc.c:305:33: note: in expansion of macro ‘min’
305 | transfer_size = min((u32) EZPORT_TRANSFER_SIZE, size - address);
| ^~~
drivers/misc/gehc-achc.c: In function ‘ezport_firmware_flash_data’:
./include/linux/minmax.h:20:35: warning: comparison of distinct pointer types lacks a cast
20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
./include/linux/minmax.h:26:18: note: in expansion of macro ‘__typecheck’
26 | (__typecheck(x, y) && __no_side_effects(x, y))
| ^~~~~~~~~~~
./include/linux/minmax.h:36:31: note: in expansion of macro ‘__safe_cmp’
36 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
./include/linux/minmax.h:45:25: note: in expansion of macro ‘__careful_cmp’
45 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/gehc-achc.c:347:33: note: in expansion of macro ‘min’
347 | transfer_size = min((u32) EZPORT_TRANSFER_SIZE, size - address);
| ^~~


How did you test build this?

thanks,

greg k-h