Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makefs/ffs Rename min/max -> uimin/uimax for better...



details:   https://anonhg.NetBSD.org/src/rev/02e76dd74074
branches:  trunk
changeset: 993285:02e76dd74074
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Sep 03 16:29:22 2018 +0000

description:
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

        #define min(a, b)       ((a) < (b) ? (a) : (b))
        #define max(a, b)       ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c |   2 +-
 sys/arch/acorn32/mainbus/fd.c                          |   8 +-
 sys/arch/alpha/alpha/autoconf.c                        |   6 +-
 sys/arch/alpha/alpha/machdep.c                         |   8 +-
 sys/arch/alpha/alpha/prom.c                            |   6 +-
 sys/arch/alpha/stand/common/prom.c                     |   4 +-
 sys/arch/alpha/stand/netboot/if_prom.c                 |   4 +-
 sys/arch/amiga/amiga/amiga_init.c                      |   8 +-
 sys/arch/amiga/amiga/disksubr.c                        |  10 ++--
 sys/arch/amiga/dev/amidisplaycc.c                      |   6 +-
 sys/arch/amiga/dev/bzivsc.c                            |   8 +-
 sys/arch/amiga/dev/bzsc.c                              |   8 +-
 sys/arch/amiga/dev/bztzsc.c                            |   8 +-
 sys/arch/amiga/dev/cbiisc.c                            |   8 +-
 sys/arch/amiga/dev/cbsc.c                              |   8 +-
 sys/arch/amiga/dev/fd.c                                |   8 +-
 sys/arch/amiga/dev/flsc.c                              |   8 +-
 sys/arch/amiga/dev/if_es.c                             |   6 +-
 sys/arch/amiga/dev/ite.c                               |  36 +++++++-------
 sys/arch/amiga/dev/ite_cc.c                            |   6 +-
 sys/arch/amiga/dev/ite_ul.c                            |   6 +-
 sys/arch/amiga/dev/par.c                               |   8 +-
 sys/arch/arc/dev/opms.c                                |   6 +-
 sys/arch/arc/dti/btl.c                                 |   6 +-
 sys/arch/arc/jazz/fd.c                                 |   8 +-
 sys/arch/arm/arm32/bus_dma.c                           |  14 ++--
 sys/arch/arm/arm32/pmap.c                              |   6 +-
 sys/arch/arm/broadcom/bcm2835_vcaudio.c                |   6 +-
 sys/arch/arm/broadcom/bcm283x_platform.c               |   6 +-
 sys/arch/arm/broadcom/bcm53xx_eth.c                    |   8 +-
 sys/arch/arm/broadcom/bcm53xx_pax.c                    |  12 ++--
 sys/arch/arm/clps711x/clpscom.c                        |   6 +-
 sys/arch/arm/fdt/gic_fdt.c                             |   8 +-
 sys/arch/arm/imx/if_enet.c                             |   6 +-
 sys/arch/arm/imx/imx51_ccm.c                           |   8 +-
 sys/arch/arm/iomd/vidcaudio.c                          |   8 +-
 sys/arch/arm/nvidia/tegra_i2c.c                        |  18 +++---
 sys/arch/arm/omap/omap3_sdhc.c                         |  10 ++--
 sys/arch/arm/omap/omapfb.c                             |   8 +-
 sys/arch/arm/s3c2xx0/s3c2440_dma.c                     |   4 +-
 sys/arch/arm/s3c2xx0/s3c24x0_lcd.c                     |   6 +-
 sys/arch/arm/samsung/exynos_i2c.c                      |   6 +-
 sys/arch/arm/sunxi/sunxi_hdmi.c                        |   6 +-
 sys/arch/arm/sunxi/sunxi_mmc.c                         |   8 +-
 sys/arch/arm/sunxi/sunxi_nand.c                        |   8 +-
 sys/arch/arm/xscale/pxa2x0_dmac.c                      |   6 +-
 sys/arch/atari/dev/fd.c                                |   6 +-
 sys/arch/atari/dev/grfabs_et.c                         |   6 +-
 sys/arch/atari/dev/hdfd.c                              |   8 +-
 sys/arch/atari/dev/ite.c                               |  36 +++++++-------
 sys/arch/atari/dev/ite_cc.c                            |   6 +-
 sys/arch/atari/dev/lpt.c                               |   6 +-
 sys/arch/atari/dev/md_root.c                           |   8 +-
 sys/arch/epoc32/epoc32/machdep.c                       |   6 +-
 sys/arch/epoc32/windermere/wmcom.c                     |   6 +-
 sys/arch/hp300/dev/ppi.c                               |   8 +-
 sys/arch/hpcmips/hpcmips/machdep.c                     |   6 +-
 sys/arch/hpcmips/vr/flash_vrip.c                       |   8 +-
 sys/arch/hpcmips/vr/vr4181aiu.c                        |   6 +-
 sys/arch/hppa/dev/lcd.c                                |   4 +-
 sys/arch/hppa/hppa/machdep.c                           |   6 +-
 sys/arch/hppa/hppa/mainbus.c                           |   6 +-
 sys/arch/i386/pci/viapcib.c                            |   8 +-
 sys/arch/i386/stand/efiboot/efinet.c                   |   4 +-
 sys/arch/luna68k/luna68k/machdep.c                     |   6 +-
 sys/arch/m68k/m68k/mappedcopy.c                        |   8 +-
 sys/arch/m68k/m68k/pmap_motorola.c                     |   6 +-
 sys/arch/mac68k/dev/if_mc.c                            |   6 +-
 sys/arch/mac68k/dev/mac68k5380.c                       |  12 ++--
 sys/arch/mac68k/dev/sbc.c                              |  12 ++--
 sys/arch/mac68k/nubus/cpi_nubus.c                      |   6 +-
 sys/arch/mac68k/nubus/if_netdock_nubus.c               |   6 +-
 sys/arch/macppc/dev/am79c950.c                         |   6 +-
 sys/arch/macppc/dev/cuda.c                             |   8 +-
 sys/arch/macppc/dev/if_bm.c                            |   6 +-
 sys/arch/macppc/dev/kauai.c                            |   6 +-
 sys/arch/macppc/dev/pbms.c                             |   4 +-
 sys/arch/macppc/dev/pmu.c                              |   6 +-
 sys/arch/macppc/dev/smu.c                              |   4 +-
 sys/arch/macppc/dev/snapper.c                          |  12 ++--
 sys/arch/macppc/macppc/pic_ohare.c                     |   6 +-
 sys/arch/macppc/macppc/pic_u3_ht.c                     |   2 +-
 sys/arch/mips/adm5120/dev/ahci.c                       |  10 ++--
 sys/arch/mips/adm5120/dev/if_admsw.c                   |   6 +-
 sys/arch/mips/adm5120/dev/if_admswvar.h                |   8 +-
 sys/arch/mips/atheros/dev/arspi.c                      |   8 +-
 sys/arch/mips/atheros/dev/athflash.c                   |   8 +-
 sys/arch/mips/cavium/dev/if_cnmac.c                    |   6 +-
 sys/arch/mips/ingenic/jziic.c                          |  10 ++--
 sys/arch/mips/mips/cache.c                             |   6 +-
 sys/arch/mips/mips/pmap_machdep.c                      |   8 +-
 sys/arch/newsmips/apbus/if_sn.c                        |   6 +-
 sys/arch/ofppc/ofppc/disksubr.c                        |  10 ++--
 sys/arch/pmax/tc/asc_ioasic.c                          |   6 +-
 sys/arch/powerpc/booke/booke_pmap.c                    |   6 +-
 sys/arch/powerpc/booke/dev/pq3diic.c                   |   6 +-
 sys/arch/powerpc/booke/dev/pq3duart.c                  |   6 +-
 sys/arch/powerpc/booke/dev/pq3etsec.c                  |  10 ++--
 sys/arch/powerpc/booke/e500_tlb.c                      |   8 +-
 sys/arch/powerpc/oea/ofw_rascons.c                     |   8 +-
 sys/arch/powerpc/pic/intr.c                            |  10 ++--
 sys/arch/powerpc/pic/pic_distopenpic.c                 |   6 +-
 sys/arch/powerpc/pic/pic_mpcsoc.c                      |   6 +-
 sys/arch/powerpc/pic/pic_openpic.c                     |   6 +-
 sys/arch/powerpc/powerpc/bus_dma.c                     |   6 +-
 sys/arch/powerpc/powerpc/openfirm.c                    |   8 +-
 sys/arch/prep/pnpbus/nvram_pnpbus.c                    |   8 +-
 sys/arch/sandpoint/sandpoint/satmgr.c                  |  12 ++--
 sys/arch/sgimips/gio/grtwo.c                           |   8 +-
 sys/arch/sgimips/mace/mavb.c                           |   6 +-
 sys/arch/shark/isa/clock.c                             |   6 +-
 sys/arch/shark/ofw/ofrom.c                             |   6 +-
 sys/arch/shark/ofw/ofw.c                               |   6 +-
 sys/arch/sparc/dev/cgfourteen.c                        |  14 ++--
 sys/arch/sparc/dev/fd.c                                |   8 +-
 sys/arch/sparc/sparc/cache.c                           |  10 ++--
 sys/arch/sparc/sparc/cpu.c                             |  16 +++---
 sys/arch/sparc/sparc/pmap.c                            |   6 +-
 sys/arch/sparc64/dev/fdc.c                             |   8 +-
 sys/arch/sparc64/dev/ffb.c                             |   6 +-
 sys/arch/sparc64/dev/ffb_mainbus.c                     |   6 +-
 sys/arch/sparc64/dev/iommu.c                           |  14 ++--
 sys/arch/sparc64/dev/ldc.c                             |  10 ++--
 sys/arch/sparc64/dev/lom.c                             |  10 ++--
 sys/arch/sparc64/dev/pci_machdep.c                     |   8 +-
 sys/arch/sparc64/include/vmparam.h                     |   4 +-
 sys/arch/sparc64/sparc64/machdep.c                     |  10 ++--
 sys/arch/sun2/dev/if_ec.c                              |   6 +-
 sys/arch/sun2/sun2/leds.c                              |   6 +-
 sys/arch/sun2/sun2/locore2.c                           |   8 +-
 sys/arch/sun3/dev/dma.c                                |   6 +-
 sys/arch/sun3/dev/eeprom.c                             |   6 +-
 sys/arch/sun3/dev/fd.c                                 |   8 +-
 sys/arch/sun3/dev/if_ie.c                              |   8 +-
 sys/arch/sun3/sun3/leds.c                              |   6 +-
 sys/arch/sun3/sun3/locore2.c                           |   8 +-
 sys/arch/sun3/sun3x/locore2.c                          |   8 +-
 sys/arch/usermode/dev/if_veth.c                        |   6 +-
 sys/arch/usermode/usermode/copy.c                      |  12 ++--
 sys/arch/vax/vsa/asc_vsbus.c                           |   6 +-
 sys/arch/vax/vsa/hdc9224.c                             |   6 +-
 sys/arch/vax/vsa/leds.c                                |   6 +-
 sys/arch/vax/vsa/ncr.c                                 |   6 +-
 sys/arch/vax/vsa/vsaudio.c                             |   4 +-
 sys/arch/vax/vsa/vsbus.c                               |  12 ++--
 sys/arch/x68k/dev/fd.c                                 |  12 ++--
 sys/arch/x68k/dev/ite.c                                |  36 +++++++-------
 sys/arch/x68k/dev/par.c                                |   8 +-
 sys/arch/x86/x86/cpu.c                                 |   6 +-
 sys/arch/x86/x86/sys_machdep.c                         |  10 ++--
 sys/arch/xen/x86/cpu.c                                 |   6 +-
 sys/arch/xen/x86/xen_bus_dma.c                         |   6 +-
 sys/arch/xen/xen/if_xennet_xenbus.c                    |   6 +-
 sys/arch/xen/xen/xennetback_xenbus.c                   |   8 +-
 sys/compat/common/kern_info_43.c                       |   6 +-
 sys/compat/common/sysv_ipc_50.c                        |   6 +-
 sys/compat/common/vfs_syscalls_12.c                    |   6 +-
 sys/compat/common/vfs_syscalls_30.c                    |   6 +-
 sys/compat/common/vfs_syscalls_43.c                    |   6 +-
 sys/compat/ibcs2/ibcs2_misc.c                          |   8 +-
 sys/compat/linux/arch/i386/linux_ptrace.c              |   8 +-
 sys/compat/linux/arch/powerpc/linux_ptrace.c           |   8 +-
 sys/compat/linux/common/linux_file64.c                 |   6 +-
 sys/compat/linux/common/linux_misc.c                   |   8 +-
 sys/compat/linux32/common/linux32_dirent.c             |   8 +-
 sys/compat/netbsd32/netbsd32_compat_30.c               |   6 +-
 sys/compat/netbsd32/netbsd32_execve.c                  |   6 +-
 sys/compat/netbsd32/netbsd32_ioctl.c                   |   8 +-
 sys/compat/netbsd32/netbsd32_module.c                  |   6 +-
 sys/compat/osf1/osf1_file.c                            |   6 +-
 sys/compat/osf1/osf1_misc.c                            |   6 +-
 sys/compat/osf1/osf1_mount.c                           |   8 +-
 sys/compat/sunos/sunos_misc.c                          |   6 +-
 sys/compat/sunos32/sunos32_misc.c                      |   6 +-
 sys/compat/svr4/svr4_misc.c                            |   8 +-
 sys/compat/svr4_32/svr4_32_misc.c                      |   8 +-
 sys/dev/ata/ata_wdc.c                                  |   6 +-
 sys/dev/ata/ld_ataraid.c                               |   8 +-
 sys/dev/auconv.c                                       |  40 ++++++++--------
 sys/dev/audio.c                                        |  12 ++--
 sys/dev/audiobell.c                                    |   8 +-
 sys/dev/aurateconv.c                                   |   6 +-
 sys/dev/auvolconv.c                                    |   8 +-
 sys/dev/bluetooth/btmagic.c                            |   6 +-
 sys/dev/cardbus/cardbus_exrom.c                        |   6 +-
 sys/dev/dksubr.c                                       |   8 +-
 sys/dev/dtv/dtv_buffer.c                               |  10 ++--
 sys/dev/dtv/dtv_demux.c                                |   6 +-
 sys/dev/dtv/dtv_scatter.c                              |   8 +-
 sys/dev/gpib/ppi.c                                     |   8 +-
 sys/dev/hid/hid.c                                      |   6 +-
 sys/dev/hil/hil.c                                      |   4 +-
 sys/dev/i2c/ddc.c                                      |   8 +-
 sys/dev/i2c/fcu.c                                      |   8 +-
 sys/dev/i2c/ibmhawk.c                                  |   8 +-
 sys/dev/i2c/xc3028.c                                   |   6 +-
 sys/dev/i2c/xc5k.c                                     |   6 +-
 sys/dev/i2o/dpti.c                                     |   8 +-
 sys/dev/i2o/iop.c                                      |   6 +-
 sys/dev/ic/aic6360.c                                   |   6 +-
 sys/dev/ic/an.c                                        |   6 +-
 sys/dev/ic/atppc.c                                     |  10 ++--
 sys/dev/ic/cac.c                                       |   6 +-
 sys/dev/ic/ciss.c                                      |   6 +-
 sys/dev/ic/clmpcc.c                                    |   6 +-
 sys/dev/ic/dp8390.c                                    |   6 +-
 sys/dev/ic/dpt.c                                       |  10 ++--
 sys/dev/ic/dwc_mmc.c                                   |   8 +-
 sys/dev/ic/elink3.c                                    |   6 +-
 sys/dev/ic/elinkxl.c                                   |   6 +-
 sys/dev/ic/gem.c                                       |   6 +-
 sys/dev/ic/hme.c                                       |   6 +-
 sys/dev/ic/i82586.c                                    |   8 +-
 sys/dev/ic/igsfb_subr.c                                |   8 +-
 sys/dev/ic/isp_netbsd.c                                |   8 +-
 sys/dev/ic/isp_target.c                                |   6 +-
 sys/dev/ic/lance.c                                     |  18 +++---
 sys/dev/ic/lpt.c                                       |   6 +-
 sys/dev/ic/lsi64854.c                                  |   8 +-
 sys/dev/ic/malo.c                                      |   6 +-
 sys/dev/ic/mb86960.c                                   |   8 +-
 sys/dev/ic/mb89352.c                                   |   6 +-
 sys/dev/ic/mfi.c                                       |   8 +-
 sys/dev/ic/midway.c                                    |  12 ++--
 sys/dev/ic/mlx.c                                       |   8 +-
 sys/dev/ic/msm6258.c                                   |  12 ++--
 sys/dev/ic/mtd803.c                                    |   6 +-
 sys/dev/ic/mvsata.c                                    |   6 +-
 sys/dev/ic/mx98905.c                                   |  12 ++--
 sys/dev/ic/ncr53c9x.c                                  |  10 ++--
 sys/dev/ic/pl041.c                                     |   6 +-
 sys/dev/ic/pl181.c                                     |   8 +-
 sys/dev/ic/qemufwcfg.c                                 |   6 +-
 sys/dev/ic/rrunner.c                                   |   6 +-
 sys/dev/ic/rrunnerreg.h                                |   6 +-
 sys/dev/ic/rt2560.c                                    |   6 +-
 sys/dev/ic/rt2661.c                                    |  10 ++--
 sys/dev/ic/rt2860.c                                    |   6 +-
 sys/dev/ic/seeq8005.c                                  |   8 +-
 sys/dev/ic/sl811hs.c                                   |  12 ++--
 sys/dev/ic/tcic2.c                                     |   6 +-
 sys/dev/ic/tropic.c                                    |   6 +-
 sys/dev/ic/wi.c                                        |   8 +-
 sys/dev/ieee1394/firewire.c                            |   6 +-
 sys/dev/ieee1394/fwmem.c                               |   6 +-
 sys/dev/ieee1394/if_fwip.c                             |   6 +-
 sys/dev/ieee1394/sbp.c                                 |  10 ++--
 sys/dev/isa/fd.c                                       |   8 +-
 sys/dev/isa/if_eg.c                                    |   8 +-
 sys/dev/isa/if_el.c                                    |   8 +-
 sys/dev/isa/if_iy.c                                    |   6 +-
 sys/dev/isa/mcd.c                                      |   6 +-
 sys/dev/isa/sbdsp.c                                    |   6 +-
 sys/dev/kttcp.c                                        |   6 +-
 sys/dev/marvell/gtidmac.c                              |   8 +-
 sys/dev/marvell/gtmpsc.c                               |   6 +-
 sys/dev/marvell/if_mvgbe.c                             |   6 +-
 sys/dev/marvell/if_mvxpe.c                             |   6 +-
 sys/dev/marvell/mvcesa.c                               |  12 ++--
 sys/dev/mca/ed_mca.c                                   |  12 ++--
 sys/dev/mulaw.c                                        |  24 ++++----
 sys/dev/mvme/lpt_mvme.c                                |   6 +-
 sys/dev/mvme/mvmebus.c                                 |   6 +-
 sys/dev/ofisa/ofisa.c                                  |  10 ++--
 sys/dev/ofw/ofnet.c                                    |   6 +-
 sys/dev/pad/pad.c                                      |   6 +-
 sys/dev/pci/amr.c                                      |   8 +-
 sys/dev/pci/arcmsr.c                                   |   6 +-
 sys/dev/pci/auvia.c                                    |   6 +-
 sys/dev/pci/bktr/bktr_core.c                           |  16 +++---
 sys/dev/pci/cxgb/cxgb_main.c                           |   6 +-
 sys/dev/pci/cxgb/cxgb_offload.c                        |   8 +-
 sys/dev/pci/cxgb/cxgb_osdep.h                          |   2 +-
 sys/dev/pci/cxgb/cxgb_sge.c                            |  12 ++--
 sys/dev/pci/cxgb/cxgb_t3_hw.c                          |  16 +++---
 sys/dev/pci/cxgb/cxgb_xgmac.c                          |  10 ++--
 sys/dev/pci/cz.c                                       |  12 ++--
 sys/dev/pci/if_bge.c                                   |   6 +-
 sys/dev/pci/if_bwfm_pci.c                              |   8 +-
 sys/dev/pci/if_de.c                                    |   6 +-
 sys/dev/pci/if_dge.c                                   |   6 +-
 sys/dev/pci/if_enavar.h                                |   4 +-
 sys/dev/pci/if_iwi.c                                   |  10 ++--
 sys/dev/pci/if_lmc.c                                   |   6 +-
 sys/dev/pci/if_vge.c                                   |   6 +-
 sys/dev/pci/if_wm.c                                    |  12 ++--
 sys/dev/pci/if_wpi.c                                   |   6 +-
 sys/dev/pci/if_xge.c                                   |   6 +-
 sys/dev/pci/iwic_bchan.c                               |   6 +-
 sys/dev/pci/iwic_dchan.c                               |   6 +-
 sys/dev/pci/ixgbe/if_sriov.c                           |   2 +-
 sys/dev/pci/ixgbe/ixgbe.c                              |  12 ++--
 sys/dev/pci/ixgbe/ixgbe_dcb.c                          |   4 +-
 sys/dev/pci/ixgbe/ixv.c                                |   6 +-
 sys/dev/pci/machfb.c                                   |   6 +-
 sys/dev/pci/mly.c                                      |  10 ++--
 sys/dev/pci/nvme_pci.c                                 |   6 +-
 sys/dev/pci/pccbb.c                                    |   6 +-
 sys/dev/pci/pciide_common.c                            |   6 +-
 sys/dev/pci/piixide.c                                  |   8 +-
 sys/dev/pci/pm2fb.c                                    |  10 ++--
 sys/dev/pci/radeonfb.c                                 |  14 ++--
 sys/dev/pci/twa.c                                      |   6 +-
 sys/dev/pci/ubsec.c                                    |   8 +-
 sys/dev/pcmcia/if_cnw.c                                |   6 +-
 sys/dev/pcmcia/if_xi.c                                 |   6 +-
 sys/dev/pcmcia/wdc_pcmcia.c                            |   8 +-
 sys/dev/podulebus/hcsc.c                               |   6 +-
 sys/dev/podulebus/oak.c                                |   6 +-
 sys/dev/ppbus/lpt.c                                    |   6 +-
 sys/dev/rndpseudo.c                                    |   6 +-
 sys/dev/sbus/be.c                                      |   6 +-
 sys/dev/sbus/bpp.c                                     |   6 +-
 sys/dev/sbus/dbri.c                                    |   8 +-
 sys/dev/sbus/magma.c                                   |   8 +-
 sys/dev/sbus/mgx.c                                     |   6 +-
 sys/dev/sbus/qe.c                                      |   6 +-
 sys/dev/sbus/zx.c                                      |   8 +-
 sys/dev/scsipi/cd.c                                    |  10 ++--
 sys/dev/scsipi/if_se.c                                 |   6 +-
 sys/dev/scsipi/scsipi_base.c                           |   6 +-
 sys/dev/scsipi/scsipi_ioctl.c                          |   8 +-
 sys/dev/sdmmc/sdmmc_mem.c                              |   8 +-
 sys/dev/spi/spi.c                                      |   6 +-
 sys/dev/spi/spiflash.c                                 |   8 +-
 sys/dev/spkr.c                                         |   6 +-
 sys/dev/tc/asc_tcds.c                                  |   6 +-
 sys/dev/tc/bba.c                                       |   8 +-
 sys/dev/tc/if_le_ioasic.c                              |  12 ++--
 sys/dev/usb/aubtfwl.c                                  |   6 +-
 sys/dev/usb/auvitek_video.c                            |   6 +-
 sys/dev/usb/ehci.c                                     |  18 +++---
 sys/dev/usb/emdtv.c                                    |   6 +-
 sys/dev/usb/if_ural.c                                  |   6 +-
 sys/dev/usb/if_zyd.c                                   |   8 +-
 sys/dev/usb/motg.c                                     |  14 ++--
 sys/dev/usb/ohci.c                                     |  12 ++--
 sys/dev/usb/pseye.c                                    |   8 +-
 sys/dev/usb/uatp.c                                     |   6 +-
 sys/dev/usb/uaudio.c                                   |   8 +-
 sys/dev/usb/udl.c                                      |   6 +-
 sys/dev/usb/udsir.c                                    |   8 +-
 sys/dev/usb/ugen.c                                     |  44 +++++++++---------
 sys/dev/usb/uhci.c                                     |   8 +-
 sys/dev/usb/uhid.c                                     |   8 +-
 sys/dev/usb/ulpt.c                                     |   8 +-
 sys/dev/usb/umass_isdata.c                             |   6 +-
 sys/dev/usb/umidi.c                                    |   6 +-
 sys/dev/usb/urio.c                                     |   8 +-
 sys/dev/usb/usbroothub.c                               |  24 ++++----
 sys/dev/usb/uscanner.c                                 |   8 +-
 sys/dev/usb/utoppy.c                                   |  18 +++---
 sys/dev/usb/xhci.c                                     |  12 ++--
 sys/dev/video.c                                        |  12 ++--
 sys/dev/vnd.c                                          |   6 +-
 sys/dev/wscons/wscons_rinit.c                          |   8 +-
 sys/dev/wscons/wsdisplay_glyphcache.c                  |   6 +-
 sys/dev/wscons/wsemul_dumb.c                           |   6 +-
 sys/dev/wscons/wsemul_sun.c                            |  28 +++++-----
 sys/dev/wscons/wsemul_vt100.c                          |   6 +-
 sys/dev/wscons/wsemul_vt100_subr.c                     |  30 ++++++------
 sys/dev/wsfb/genfb.c                                   |   6 +-
 sys/dev/wsfont/wsfont.c                                |   8 +-
 sys/dist/pf/net/pf.c                                   |  12 ++--
 sys/fs/adosfs/adlookup.c                               |   6 +-
 sys/fs/msdosfs/msdosfs_fat.c                           |   8 +-
 sys/fs/msdosfs/msdosfs_vfsops.c                        |   6 +-
 sys/fs/nfs/client/nfs_clbio.c                          |   8 +-
 sys/fs/nfs/client/nfs_clvfsops.c                       |   6 +-
 sys/fs/nfs/common/nfs_commonsubs.c                     |  14 ++--
 sys/fs/nfs/server/nfs_nfsdport.c                       |  10 ++--
 sys/fs/ptyfs/ptyfs_vnops.c                             |   6 +-
 sys/fs/smbfs/smbfs_smb.c                               |   8 +-
 sys/kern/core_elf32.c                                  |   6 +-
 sys/kern/exec_script.c                                 |   6 +-
 sys/kern/init_sysctl.c                                 |   8 +-
 sys/kern/kern_auth.c                                   |  10 ++--
 sys/kern/kern_descrip.c                                |   8 +-
 sys/kern/kern_exec.c                                   |   6 +-
 sys/kern/kern_history.c                                |   6 +-
 sys/kern/kern_ktrace.c                                 |   8 +-
 sys/kern/kern_module.c                                 |   6 +-
 sys/kern/kern_proc.c                                   |  12 ++--
 sys/kern/kern_rndpool.c                                |   8 +-
 sys/kern/sched_4bsd.c                                  |   6 +-
 sys/kern/sched_m2.c                                    |  12 ++--
 sys/kern/subr_iostat.c                                 |   6 +-
 sys/kern/subr_lockdebug.c                              |   6 +-
 sys/kern/subr_log.c                                    |   6 +-
 sys/kern/sys_module.c                                  |   6 +-
 sys/kern/sys_pset.c                                    |   8 +-
 sys/kern/sysv_ipc.c                                    |   6 +-
 sys/kern/sysv_shm.c                                    |   6 +-
 sys/kern/tty.c                                         |   8 +-
 sys/kern/tty_pty.c                                     |  14 ++--
 sys/kern/uipc_domain.c                                 |   8 +-
 sys/kern/uipc_mbuf.c                                   |  30 ++++++------
 sys/kern/uipc_mbufdebug.c                              |   6 +-
 sys/kern/uipc_socket.c                                 |   6 +-
 sys/kern/uipc_socket2.c                                |   6 +-
 sys/kern/uipc_syscalls.c                               |   6 +-
 sys/kern/vfs_vnops.c                                   |   6 +-
 sys/lib/libkern/libkern.h                              |  10 ++--
 sys/lib/libkern/max.c                                  |   4 +-
 sys/lib/libkern/min.c                                  |   4 +-
 sys/miscfs/fdesc/fdesc_vnops.c                         |   8 +-
 sys/miscfs/kernfs/kernfs_vnops.c                       |  14 ++--
 sys/miscfs/procfs/procfs_vnops.c                       |  12 ++--
 sys/miscfs/specfs/spec_vnops.c                         |  12 ++--
 sys/net/bpf.c                                          |   8 +-
 sys/net/if_tap.c                                       |   8 +-
 sys/net/if_tun.c                                       |   8 +-
 sys/net/radix.c                                        |  10 ++--
 sys/net80211/ieee80211_crypto_ccmp.c                   |  10 ++--
 sys/net80211/ieee80211_crypto_tkip.c                   |   6 +-
 sys/net80211/ieee80211_netbsd.c                        |   6 +-
 sys/netbt/rfcomm_dlc.c                                 |   8 +-
 sys/netbt/rfcomm_session.c                             |  18 +++---
 sys/netbt/rfcomm_upper.c                               |   8 +-
 sys/netinet/ip_icmp.c                                  |  10 ++--
 sys/netinet/sctp_indata.c                              |   6 +-
 sys/netinet/sctp_input.c                               |   6 +-
 sys/netinet/sctp_output.c                              |  20 ++++----
 sys/netinet/sctp_pcb.c                                 |   6 +-
 sys/netinet/sctp_usrreq.c                              |   6 +-
 sys/netinet/sctputil.c                                 |   8 +-
 sys/netinet/tcp_congctl.c                              |  18 +++---
 sys/netinet/tcp_input.c                                |   8 +-
 sys/netinet/tcp_output.c                               |  28 +++++-----
 sys/netinet/tcp_subr.c                                 |  14 ++--
 sys/netinet/tcp_var.h                                  |   4 +-
 sys/netinet6/icmp6.c                                   |   6 +-
 sys/netinet6/nd6.c                                     |   6 +-
 sys/netipsec/ipsec_mbuf.c                              |   8 +-
 sys/netisdn/i4b_q931.c                                 |  24 ++++----
 sys/netisdn/i4b_rbch.c                                 |   6 +-
 sys/netisdn/i4b_tel.c                                  |   8 +-
 sys/netmpls/mpls_ttl.c                                 |   8 +-
 sys/netsmb/smb_crypt.c                                 |   6 +-
 sys/netsmb/smb_rq.c                                    |  12 ++--
 sys/netsmb/smb_smb.c                                   |  28 +++++-----
 sys/netsmb/smb_trantcp.c                               |   6 +-
 sys/netsmb/subr_mchain.c                               |   8 +-
 sys/nfs/nfs_clntsubs.c                                 |   8 +-
 sys/nfs/nfs_iod.c                                      |   6 +-
 sys/nfs/nfs_serv.c                                     |   8 +-
 sys/nfs/nfs_socket.c                                   |  12 ++--
 sys/nfs/nfs_subs.c                                     |  10 ++--
 sys/nfs/nfs_vfsops.c                                   |   6 +-
 sys/nfs/nfs_vnops.c                                    |   6 +-
 sys/opencrypto/criov.c                                 |  10 ++--
 sys/rump/dev/lib/libugenhc/ugenhc.c                    |  10 ++--
 sys/rump/librump/rumpkern/cons.c                       |   6 +-
 sys/rump/librump/rumpvfs/devnull.c                     |   6 +-
 sys/ufs/ext2fs/ext2fs_balloc.c                         |   6 +-
 sys/ufs/ffs/ffs_alloc.c                                |  10 ++--
 sys/ufs/ffs/ffs_wapbl.c                                |  14 ++--
 sys/ufs/lfs/lfs_segment.c                              |   6 +-
 sys/uvm/uvm_map.c                                      |   6 +-
 sys/uvm/uvm_meter.c                                    |   8 +-
 sys/uvm/uvm_pglist.c                                   |  22 ++++----
 usr.sbin/makefs/ffs/buf.h                              |  16 ++++++-
 462 files changed, 1932 insertions(+), 1918 deletions(-)

diffs (truncated from 16509 to 300 lines):

diff -r 3c17de3d41e5 -r 02e76dd74074 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c    Mon Sep 03 15:32:09 2018 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c    Mon Sep 03 16:29:22 2018 +0000
@@ -470,7 +470,7 @@
                resid = zio->io_size;
                off = 0;
                while (resid != 0) {
-                       size = min(resid, MAXPHYS);
+                       size = uimin(resid, MAXPHYS);
                        nbp = getiobuf(vp, true);
                        nbp->b_blkno = btodb(zio->io_offset + off);
                        /* Below call increments v_numoutput. */
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/acorn32/mainbus/fd.c
--- a/sys/arch/acorn32/mainbus/fd.c     Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/acorn32/mainbus/fd.c     Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.58 2015/04/26 15:15:19 mlelstv Exp $  */
+/*     $NetBSD: fd.c,v 1.59 2018/09/03 16:29:22 riastradh Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.58 2015/04/26 15:15:19 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.59 2018/09/03 16:29:22 riastradh Exp $");
 
 #include "opt_ddb.h"
 
@@ -1008,8 +1008,8 @@
                                      (char *)finfo;
                sec = fd->sc_blkno % type->seccyl;
                nblks = type->seccyl - sec;
-               nblks = min(nblks, fd->sc_bcount / FDC_BSIZE);
-               nblks = min(nblks, FDC_MAXIOSIZE / FDC_BSIZE);
+               nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
+               nblks = uimin(nblks, FDC_MAXIOSIZE / FDC_BSIZE);
                fd->sc_nblks = nblks;
                fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
                head = sec / type->sectrac;
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/alpha/alpha/autoconf.c
--- a/sys/arch/alpha/alpha/autoconf.c   Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/alpha/alpha/autoconf.c   Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.53 2014/01/20 15:05:13 tsutsui Exp $ */
+/* $NetBSD: autoconf.c,v 1.54 2018/09/03 16:29:22 riastradh Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.53 2014/01/20 15:05:13 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.54 2018/09/03 16:29:22 riastradh Exp $");
 
 #include "pci.h"
 
@@ -120,7 +120,7 @@
        bootdev_data = NULL;
 
        memcpy(hacked_boot_dev, bootinfo.booted_dev,
-           min(sizeof bootinfo.booted_dev, sizeof hacked_boot_dev));
+           uimin(sizeof bootinfo.booted_dev, sizeof hacked_boot_dev));
 #if 0
        printf("parse_prom_bootdev: boot dev = \"%s\"\n", hacked_boot_dev);
 #endif
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.350 2017/03/16 16:13:20 chs Exp $ */
+/* $NetBSD: machdep.c,v 1.351 2018/09/03 16:29:22 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.350 2017/03/16 16:13:20 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.351 2018/09/03 16:29:22 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -292,10 +292,10 @@
                                    ((struct rpb *)HWRPB_ADDR)->rpb_size;
                        }
                        memcpy(bootinfo.boot_flags, v1p->boot_flags,
-                           min(sizeof v1p->boot_flags,
+                           uimin(sizeof v1p->boot_flags,
                              sizeof bootinfo.boot_flags));
                        memcpy(bootinfo.booted_kernel, v1p->booted_kernel,
-                           min(sizeof v1p->booted_kernel,
+                           uimin(sizeof v1p->booted_kernel,
                              sizeof bootinfo.booted_kernel));
                        /* booted dev not provided in bootinfo */
                        init_prom_interface((struct rpb *)
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/alpha/alpha/prom.c
--- a/sys/arch/alpha/alpha/prom.c       Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/alpha/alpha/prom.c       Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.49 2016/10/13 16:18:20 flxd Exp $ */
+/* $NetBSD: prom.c,v 1.50 2018/09/03 16:29:22 riastradh Exp $ */
 
 /*
  * Copyright (c) 1992, 1994, 1995, 1996 Carnegie Mellon University
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.49 2016/10/13 16:18:20 flxd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.50 2018/09/03 16:29:22 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -240,7 +240,7 @@
        ret.bits = prom_getenv_disp(id, to, len);
        if (ret.u.status & 0x4)
                ret.u.retval = 0;
-       len = min(len - 1, ret.u.retval);
+       len = uimin(len - 1, ret.u.retval);
        memcpy(buf, to, len);
        buf[len] = '\0';
        prom_leave();
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/alpha/stand/common/prom.c
--- a/sys/arch/alpha/stand/common/prom.c        Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/alpha/stand/common/prom.c        Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.15 2016/10/13 16:18:20 flxd Exp $ */
+/* $NetBSD: prom.c,v 1.16 2018/09/03 16:29:22 riastradh Exp $ */
 
 /*  
  * Mach Operating System
@@ -134,7 +134,7 @@
        ret.bits = prom_dispatch(PROM_R_GETENV, id, abuf, 128);
        if (ret.u.status & 0x4)
                ret.u.retval = 0;
-       len = min(len - 1, ret.u.retval);
+       len = uimin(len - 1, ret.u.retval);
        memcpy(buf, abuf, len);
        buf[len] = '\0';
 
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/alpha/stand/netboot/if_prom.c
--- a/sys/arch/alpha/stand/netboot/if_prom.c    Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/alpha/stand/netboot/if_prom.c    Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_prom.c,v 1.20 2009/01/12 11:32:43 tsutsui Exp $ */
+/* $NetBSD: if_prom.c,v 1.21 2018/09/03 16:29:22 riastradh Exp $ */
 
 /*
  * Copyright (c) 1997 Christopher G. Demetriou.  All rights reserved.
@@ -111,7 +111,7 @@
                        cc = ret.u.retval;
        }
        if (broken_firmware)
-               cc = min(cc, len);
+               cc = uimin(cc, len);
        else
                cc = len;
        memcpy(pkt, hate, cc);
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/amiga/amiga/amiga_init.c
--- a/sys/arch/amiga/amiga/amiga_init.c Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/amiga/amiga/amiga_init.c Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amiga_init.c,v 1.129 2012/11/26 22:58:24 rkujawa Exp $ */
+/*     $NetBSD: amiga_init.c,v 1.130 2018/09/03 16:29:22 riastradh Exp $       */
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -39,7 +39,7 @@
 #include "ser.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.129 2012/11/26 22:58:24 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.130 2018/09/03 16:29:22 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1060,8 +1060,8 @@
        /*
         * Continue loading in the kernel image.
         */
-       c = min(iov->iov_len, kernel_load_endseg - kernel_load_ofs);
-       c = min(c, MAXPHYS);
+       c = uimin(iov->iov_len, kernel_load_endseg - kernel_load_ofs);
+       c = uimin(c, MAXPHYS);
        if ((error = uiomove(kernel_image + kernel_load_ofs, (int)c, uio)) != 0)
                return(error);
        kernel_load_ofs += c;
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/amiga/amiga/disksubr.c
--- a/sys/arch/amiga/amiga/disksubr.c   Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/amiga/amiga/disksubr.c   Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.68 2017/08/15 09:52:49 mlelstv Exp $    */
+/*     $NetBSD: disksubr.c,v 1.69 2018/09/03 16:29:22 riastradh Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.68 2017/08/15 09:52:49 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.69 2018/09/03 16:29:22 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -257,7 +257,7 @@
        /*
         * I also don't trust rdb->secpercyl
         */
-       lp->d_secpercyl = min(rbp->secpercyl, lp->d_nsectors * lp->d_ntracks);
+       lp->d_secpercyl = uimin(rbp->secpercyl, lp->d_nsectors * lp->d_ntracks);
        if (lp->d_secpercyl == 0)
                lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks;
 #ifdef DIAGNOSTIC
@@ -271,7 +271,7 @@
                    rbp->secpercyl, rbp->nsectors, rbp->nheads);
 #endif
        lp->d_sparespercyl =
-           max(rbp->secpercyl, lp->d_nsectors * lp->d_ntracks)
+           uimax(rbp->secpercyl, lp->d_nsectors * lp->d_ntracks)
            - lp->d_secpercyl;
        if (lp->d_sparespercyl == 0)
                lp->d_sparespertrack = 0;
@@ -443,7 +443,7 @@
                         */
                        int bsize, secperblk, minbsize, prefac;
 
-                       minbsize = max(512, lp->d_secsize);
+                       minbsize = uimax(512, lp->d_secsize);
 
                        bsize     = pbp->e.sizeblock << 2;
                        secperblk = pbp->e.secperblk;
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/amiga/dev/amidisplaycc.c
--- a/sys/arch/amiga/dev/amidisplaycc.c Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/amiga/dev/amidisplaycc.c Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amidisplaycc.c,v 1.31 2018/01/28 10:00:31 jandberg Exp $ */
+/*     $NetBSD: amidisplaycc.c,v 1.32 2018/09/03 16:29:22 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2000 Jukka Andberg.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.31 2018/01/28 10:00:31 jandberg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.32 2018/09/03 16:29:22 riastradh Exp $");
 
 /*
  * wscons interface to amiga custom chips. Contains the necessary functions
@@ -605,7 +605,7 @@
        fontlow  = scr->wsfont->firstchar;
        fonthigh = fontlow + scr->wsfont->numchars - 1;
 
-       fontheight = min(scr->fontheight, scr->wsfont->fontheight);
+       fontheight = uimin(scr->fontheight, scr->wsfont->fontheight);
        depth      = scr->depth;
        linebytes  = scr->linebytes;
 
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/amiga/dev/bzivsc.c
--- a/sys/arch/amiga/dev/bzivsc.c       Mon Sep 03 15:32:09 2018 +0000
+++ b/sys/arch/amiga/dev/bzivsc.c       Mon Sep 03 16:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bzivsc.c,v 1.31 2010/12/20 00:25:25 matt Exp $ */
+/*     $NetBSD: bzivsc.c,v 1.32 2018/09/03 16:29:22 riastradh Exp $ */
 
 /*
  * Copyright (c) 1997 Michael L. Hitch
@@ -36,7 +36,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bzivsc.c,v 1.31 2010/12/20 00:25:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bzivsc.c,v 1.32 2018/09/03 16:29:22 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -354,7 +354,7 @@
                bsc->sc_dmasize = bzivsc_max_dma;
        ptr = *addr;                    /* Kernel virtual address */
        pa = kvtop(ptr);                /* Physical address of DMA */
-       xfer = min(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
+       xfer = uimin(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
        bsc->sc_xfr_align = 0;
        /*
         * If output and unaligned, stuff odd byte into FIFO
@@ -370,7 +370,7 @@
         */
        else if ((int)ptr & 1) {
                pa = kvtop((void *)&bsc->sc_alignbuf);
-               xfer = bsc->sc_dmasize = min(xfer, sizeof(bsc->sc_alignbuf));
+               xfer = bsc->sc_dmasize = uimin(xfer, sizeof(bsc->sc_alignbuf));
                NCR_DMA(("bzivsc_dma_setup: align read by %d bytes\n", xfer));
                bsc->sc_xfr_align = 1;
        }
diff -r 3c17de3d41e5 -r 02e76dd74074 sys/arch/amiga/dev/bzsc.c




Home | Main Index | Thread Index | Old Index