--- zzzz-none-000/linux-3.10.107/drivers/spi/spi.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/drivers/spi/spi.c 2021-11-10 11:53:55.000000000 +0000 @@ -52,7 +52,8 @@ } static ssize_t -modalias_show(struct device *dev, struct device_attribute *a, char *buf) +modalias_show(struct device *dev, struct device_attribute *a __maybe_unused, + char *buf) { const struct spi_device *spi = to_spi_device(dev); @@ -501,7 +502,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n) { struct boardinfo *bi; - int i; + unsigned i; bi = kzalloc(n * sizeof(*bi), GFP_KERNEL); if (!bi) @@ -851,7 +852,7 @@ /* Device address */ prop = of_get_property(nc, "reg", &len); - if (!prop || len < sizeof(*prop)) { + if (!prop || len < (int)sizeof(*prop)) { dev_err(&master->dev, "%s has no 'reg' property\n", nc->full_name); spi_dev_put(spi); @@ -871,7 +872,7 @@ /* Device speed */ prop = of_get_property(nc, "spi-max-frequency", &len); - if (!prop || len < sizeof(*prop)) { + if (!prop || len < (int)sizeof(*prop)) { dev_err(&master->dev, "%s has no 'spi-max-frequency' property\n", nc->full_name); spi_dev_put(spi); @@ -994,7 +995,8 @@ dev_warn(&master->dev, "failed to enumerate SPI slaves\n"); } #else -static inline void acpi_register_spi_devices(struct spi_master *master) {} +static inline void acpi_register_spi_devices( + struct spi_master *master __maybe_unused) {} #endif /* CONFIG_ACPI */ static void spi_master_release(struct device *dev) @@ -1187,7 +1189,7 @@ } EXPORT_SYMBOL_GPL(spi_register_master); -static int __unregister(struct device *dev, void *null) +static int __unregister(struct device *dev, void *null __maybe_unused) { spi_unregister_device(to_spi_device(dev)); return 0; @@ -1205,8 +1207,6 @@ */ void spi_unregister_master(struct spi_master *master) { - int dummy; - if (master->queued) { if (spi_destroy_queue(master)) dev_err(&master->dev, "queue remove failed\n"); @@ -1216,7 +1216,7 @@ list_del(&master->list); mutex_unlock(&board_lock); - dummy = device_for_each_child(&master->dev, NULL, __unregister); + device_for_each_child(&master->dev, NULL, __unregister); device_unregister(&master->dev); } EXPORT_SYMBOL_GPL(spi_unregister_master); @@ -1669,7 +1669,7 @@ * keep heap costs out of the hot path unless someone else is * using the pre-allocated buffer or the transfer is too large. */ - if ((n_tx + n_rx) > SPI_BUFSIZ || !mutex_trylock(&lock)) { + if ((int)(n_tx + n_rx) > SPI_BUFSIZ || !mutex_trylock(&lock)) { local_buf = kmalloc(max((unsigned)SPI_BUFSIZ, n_tx + n_rx), GFP_KERNEL | GFP_DMA); if (!local_buf)