diff options
author | pfg <pfg@FreeBSD.org> | 2017-02-24 21:20:48 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-02-24 21:20:48 +0000 |
commit | b60107f812c62f2d9cf79c42a2150a98626263fd (patch) | |
tree | 83fbcf514df2ca65172eb770ef34d06b71d31446 | |
parent | fe5ebb6120b1cda239d0a16eea656611dc08059b (diff) | |
download | FreeBSD-src-b60107f812c62f2d9cf79c42a2150a98626263fd.zip FreeBSD-src-b60107f812c62f2d9cf79c42a2150a98626263fd.tar.gz |
MFC r313554:
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
-rw-r--r-- | sys/dev/hpt27xx/hpt27xx_osm_bsd.c | 2 | ||||
-rw-r--r-- | sys/dev/hpt27xx/ldm.h | 4 | ||||
-rw-r--r-- | sys/dev/hptnr/hptnr_osm_bsd.c | 2 | ||||
-rw-r--r-- | sys/dev/hptnr/ldm.h | 3 | ||||
-rw-r--r-- | sys/dev/hptrr/hptrr_osm_bsd.c | 2 | ||||
-rw-r--r-- | sys/dev/hptrr/ldm.h | 4 |
6 files changed, 3 insertions, 14 deletions
diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c index 5dbf33d..9d4f461 100644 --- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c +++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c @@ -297,7 +297,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus_ext, PVDEV vd) 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; diff --git a/sys/dev/hpt27xx/ldm.h b/sys/dev/hpt27xx/ldm.h index 58cddad..defa459 100644 --- a/sys/dev/hpt27xx/ldm.h +++ b/sys/dev/hpt27xx/ldm.h @@ -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) diff --git a/sys/dev/hptnr/hptnr_osm_bsd.c b/sys/dev/hptnr/hptnr_osm_bsd.c index 214303d..eeaf667 100644 --- a/sys/dev/hptnr/hptnr_osm_bsd.c +++ b/sys/dev/hptnr/hptnr_osm_bsd.c @@ -294,7 +294,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus_ext, PVDEV vd) 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; diff --git a/sys/dev/hptnr/ldm.h b/sys/dev/hptnr/ldm.h index 087cb20..a8f2991 100644 --- a/sys/dev/hptnr/ldm.h +++ b/sys/dev/hptnr/ldm.h @@ -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 ]; diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c index b5e718a..83c6493 100644 --- a/sys/dev/hptrr/hptrr_osm_bsd.c +++ b/sys/dev/hptrr/hptrr_osm_bsd.c @@ -300,7 +300,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus_ext, PVDEV vd) 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; diff --git a/sys/dev/hptrr/ldm.h b/sys/dev/hptrr/ldm.h index 93a92fa..1ec3427 100644 --- a/sys/dev/hptrr/ldm.h +++ b/sys/dev/hptrr/ldm.h @@ -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) |