platform/x86: dell_rbu: Use max_t() to get rid of casting
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 28 Jan 2020 21:23:29 +0000 (23:23 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 10 Feb 2020 15:47:38 +0000 (17:47 +0200)
There is no need to cast both values in max_t() macro, so, use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/dell_rbu.c

index 416a7db..e0fe7e8 100644 (file)
@@ -134,9 +134,7 @@ static int create_packet(void *data, size_t length)
         *       due to BIOS errata. This shouldn't be used for higher floors
         *       or you will run out of mem trying to allocate the array.
         */
-       packet_array_size = max(
-                       (unsigned int)(allocation_floor / rbu_data.packetsize),
-                       (unsigned int)1);
+       packet_array_size = max_t(unsigned int, allocation_floor / rbu_data.packetsize, 1);
        invalid_addr_packet_array = kcalloc(packet_array_size, sizeof(void *),
                                                GFP_KERNEL);