Author: pfg Date: Fri Feb 10 15:18:41 2017 New Revision: 313554 URL: https://svnweb.freebsd.org/changeset/base/313554
Log: Clean redundant MIN/MAX declarations in some HighPoint drivers. The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX() internally which match the macros from sys/param.h. MIN() is not used, MAX is only used once and can be replaced with the max() version in libkern.h which operates on u_ints. MFC after: 2 weeks Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c head/sys/dev/hpt27xx/ldm.h head/sys/dev/hptnr/hptnr_osm_bsd.c head/sys/dev/hptnr/ldm.h head/sys/dev/hptrr/hptrr_osm_bsd.c head/sys/dev/hptrr/ldm.h Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 10 15:03:54 2017 (r313553) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 10 15:18:41 2017 (r313554) @@ -297,7 +297,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_lock_vbus(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: head/sys/dev/hpt27xx/ldm.h ============================================================================== --- head/sys/dev/hpt27xx/ldm.h Fri Feb 10 15:03:54 2017 (r313553) +++ head/sys/dev/hpt27xx/ldm.h Fri Feb 10 15:18:41 2017 (r313554) @@ -59,10 +59,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; #define hpt_time_after_eq(a, b) ((int)(a) - (int)(b) >= 0) Modified: head/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- head/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 10 15:03:54 2017 (r313553) +++ head/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 10 15:18:41 2017 (r313554) @@ -294,7 +294,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: head/sys/dev/hptnr/ldm.h ============================================================================== --- head/sys/dev/hptnr/ldm.h Fri Feb 10 15:03:54 2017 (r313553) +++ head/sys/dev/hptnr/ldm.h Fri Feb 10 15:18:41 2017 (r313554) @@ -58,9 +58,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 10 15:03:54 2017 (r313553) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 10 15:18:41 2017 (r313554) @@ -300,7 +300,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: head/sys/dev/hptrr/ldm.h ============================================================================== --- head/sys/dev/hptrr/ldm.h Fri Feb 10 15:03:54 2017 (r313553) +++ head/sys/dev/hptrr/ldm.h Fri Feb 10 15:18:41 2017 (r313554) @@ -58,10 +58,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; #define hpt_time_after_eq(a, b) ((long)(a) - (long)(b) >= 0) _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"