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

staging: unisys: use the kernel min define

The kernel already provides a min function, we should be using that
instead of creating our own MINNUM.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

David Kershner and committed by
Greg Kroah-Hartman
7126395e aef0278e

+4 -8
-3
drivers/staging/unisys/include/iochannel.h
··· 61 61 * IO Partition is defined below. 62 62 */ 63 63 64 - /* Defines and enums. */ 65 - #define MINNUM(a, b) (((a) < (b)) ? (a) : (b)) 66 - 67 64 /* 68 65 * Define the two queues per data channel between iopart and ioguestparts. 69 66 * IOCHAN_TO_IOPART -- used by guest to 'insert' signals to iopart.
+4 -5
drivers/staging/unisys/visornic/visornic_main.c
··· 198 198 }; 199 199 200 200 /* Returns next non-zero index on success or 0 on failure (i.e. out of room). */ 201 - static u16 add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len, 201 + static u16 add_physinfo_entries(u64 inp_pfn, u16 inp_off, u16 inp_len, 202 202 u16 index, u16 max_pi_arr_entries, 203 203 struct phys_info pi_arr[]) 204 204 { 205 - u32 len; 206 - u16 i, firstlen; 205 + u16 i, len, firstlen; 207 206 208 207 firstlen = PI_PAGE_SIZE - inp_off; 209 208 if (inp_len <= firstlen) { ··· 226 227 pi_arr[index].pi_len = firstlen; 227 228 } else { 228 229 pi_arr[index + i].pi_off = 0; 229 - pi_arr[index + i].pi_len = 230 - (u16)MINNUM(len, (u32)PI_PAGE_SIZE); 230 + pi_arr[index + i].pi_len = min_t(u16, len, 231 + PI_PAGE_SIZE); 231 232 } 232 233 } 233 234 return index + i;