tools/libxc: Shuffle definitions and uses of min()/max() macros
PATCH v3 1/2 tools/libxc: Shuffle definitions and uses of min()/max() macros
Move the typesafe min() macro from xc_dom_decompress_unsafe_xz.c to xc_private.h, and complement it with an equivalent max() macro.
Replace current users of type unsafe MIN()/MAX() macros, and remove their scattered definitions.
---
v3: Rebase on top of min_t()/max_t() changes.
--- tools/libxc/xc_core_x86.c | 4 ---- tools/libxc/xc_dom_decompress_unsafe_xz.c | 6 ------ tools/libxc/xc_domain_restore.c | 2 +- tools/libxc/xc_private.h | 11 +++++++++++ tools/libxc/xg_private.h | 2 +- tools/libxc/xg_save_restore.h | 7 ------- 6 files changed, 13 insertions(+), 19 deletions(-)
tools/libxc/xc_core_x86.c +0 -4
@@ -24,10 +24,6 @@#define GET_FIELD (_p, _f) ((dinfo->guest_width==8) ? ((_p)->x64._f) : ((_p)->x32._f)) -#ifndef MAX -#define MAX (_a, _b) ((_a) >= (_b) ? (_a) : (_b)) -#endif -int xc_core_arch_gpfn_may_present (struct xc_core_arch_context *arch_ctxt,unsigned long pfn)
tools/libxc/xc_dom_decompress_unsafe_xz.c +0 -6
@@ -34,12 +34,6 @@ static inline u32 le32_to_cpup(const u32 *p)return cpu_to_le32 (*p); } -#define min (x,y) ({ \ - const typeof(x) _x = (x); \ - const typeof(y) _y = (y); \ - (void) (&_x == &_y); \ - _x < _y ? _x : _y; }) -#define __force#define always_inline
tools/libxc/xc_domain_restore.c +1 -1
@@ -339,7 +339,7 @@ static xen_pfn_t *load_p2m_frame_list(/* Any remaining bytes of this chunk: read and discard. */ while ( chunk_bytes ) { -unsigned long sz =MIN (chunk_bytes,sizeof (xen_pfn_t)); + unsigned long sz = min_t(unsigned long, chunk_bytes, sizeof(xen_pfn_t));if (RDEXACT (io_fd, &p2m_fl_zero, sz) ) {PERROR ("read-and-discard extended-info chunk bytes failed" );
tools/libxc/xc_private.h +11 -0
@@ -349,6 +349,17 @@ int xc_ffs16(uint16_t x);int xc_ffs32 (uint32_t x);int xc_ffs64 (uint64_t x); +#define min (X ,Y ) ({ \ + const typeof (X) _x = (X); \ + const typeof (Y) _y = (Y); \ + (void) (&_x == &_y); \ + (_x < _y) ? _x : _y; }) +#define max (X ,Y ) ({ \ + const typeof (X) _x = (X); \ + const typeof (Y) _y = (Y); \ + (void) (&_x == &_y); \ + (_x > _y) ? _x : _y; }) +#define min_t (type,x,y) \ ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })#define max_t (type,x,y) \
tools/libxc/xg_private.h +1 -1
@@ -159,7 +159,7 @@ static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,/* Size in bytes of the pfn_to_mfn_frame_list */ #define P2M_GUEST_FL_SIZE ((P2M_FL_ENTRIES) * (dinfo->guest_width))#define P2M_TOOLS_FL_SIZE ((P2M_FL_ENTRIES) * \ - MAX((sizeof (xen_pfn_t)), dinfo->guest_width)) + max_t(size_t, sizeof(xen_pfn_t), dinfo->guest_width))/* Masks for PTE<->PFN conversions */ #define MADDR_BITS_X86 ((dinfo->guest_width == 8) ? 52 : 44)
tools/libxc/xg_save_restore.h +0 -7
@@ -392,10 +392,3 @@ static inline int get_platform_info(xc_interface *xch, uint32_t dom,else \memset (&(_p)->x32._f[0 ], (_v),sizeof ((_p)->x32._f)); \ }while (0 ) - -#ifndef MAX -#define MAX (_a, _b) ((_a) >= (_b) ? (_a) : (_b)) -#endif -#ifndef MIN -#define MIN (_a, _b) ((_a) <= (_b) ? (_a) : (_b)) -#endif
Signature · 1 line
1.7.10.4
PATCH v3 2/2 tools/libxc: Implement writev_exact() in the same style as write_exact()
This implementation of writev_exact() will cope with an iovcnt greater than IOV_MAX because glibc will actually let this work anyway, and it is very useful not to have to work about this in the caller of writev_exact(). The caller is still required to ensure that the sum of iov_len's doesn't overflow a ssize_t.
---
v3:
* Re-add adjustment for partial writes.
* Split min/max adjustment into separate patch.
v2:
* Remove adjustment for partial writes of a specific iov[] entry.
--- tools/libxc/xc_private.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_private.h | 2 ++ 2 files changed, 62 insertions(+)
tools/libxc/xc_private.c +60 -0
@@ -858,6 +858,66 @@ int write_exact(int fd, const void *data, size_t size)return 0 ; } +int writev_exact (int fd,const struct iovec *iov,int iovcnt) +{ +struct iovec *local_iov =NULL ; +int rc =0 , iov_idx =0 , saved_errno =0 ; +ssize_t len; + +while ( iov_idx < iovcnt ) + { +/* Skip over iov[] entries with 0 length. */ +while ( iov[iov_idx].iov_len ==0 ) +if ( ++iov_idx == iovcnt ) + goto out; + + len =writev (fd, &iov[iov_idx],min (iovcnt - iov_idx,IOV_MAX )); + saved_errno = errno; + +if ( (len ==-1 ) && (errno ==EINTR ) ) +continue ; +if ( len <=0 ) + { + rc =-1 ; + goto out; + } + +/* Check iov[] to see whether we had a partial or complete write. */ +while ( len >0 && (iov_idx < iovcnt) ) + { +if ( len >= iov[iov_idx].iov_len ) + len -= iov[iov_idx++].iov_len; +else + { +/* Partial write of iov[iov_idx]. Copy iov so we can adjust +* element iov_idx and resubmit the rest. */ +if ( !local_iov ) + { + local_iov =malloc (iovcnt *sizeof (*iov)); +if ( !local_iov ) + { + saved_errno =ENOMEM ; + goto out; + } + + iov =memcpy (local_iov, iov, iovcnt *sizeof (*iov)); + } + + local_iov[iov_idx].iov_base += len; + local_iov[iov_idx].iov_len -= len; +break ; + } + } + } + + saved_errno =0 ; + + out: +free (local_iov); + errno = saved_errno; +return rc; +} +int xc_ffs8 (uint8_t x) {int i;
tools/libxc/xc_private.h +2 -0
@@ -28,6 +28,7 @@#include <sys/stat.h> #include <stdlib.h> #include <sys/ioctl.h> +#include <sys/uio.h> #include "xenctrl.h" #include "xenctrlosdep.h"
@@ -343,6 +344,7 @@ int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu);/* Return 0 on success; -1 on error setting errno. */ int read_exact (int fd,void *data,size_t size);/* EOF => -1, errno=0 */ int write_exact (int fd,const void *data,size_t size); +int writev_exact (int fd,const struct iovec *iov,int iovcnt);int xc_ffs8 (uint8_t x);int xc_ffs16 (uint16_t x);
Signature · 1 line
1.7.10.4
Re: [Patch v3 2/2] tools/libxc: Implement writev_exact() in the same style as write_exact()
At 07/16/2014 10:32 PM, Andrew Cooper Wrote:
Quoted 32 lines
This implementation of
writev_exact()will cope with an iovcnt greater thanIOV_MAXbecause glibc will actually let this work anyway, and it is very useful not to have to work about this in the caller ofwritev_exact(). The caller is still required to ensure that the sum of iov_len's doesn't overflow assize_t.Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>---
v3:
* Re-add adjustment for partial writes.
* Split min/max adjustment into separate patch.v2:
* Remove adjustment for partial writes of a specific iov[] entry.--- tools/libxc/xc_private.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_private.h | 2 ++ 2 files changed, 62 insertions(+)tools/libxc/xc_private.c +2
-0@@ -858,6 +858,66 @@ int write_exact(int fd, const void *data, size_t size)return 0 ; } +int writev_exact (int fd,const struct iovec *iov,int iovcnt) +{
tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 872
Quoted 10 lines
tools/libxc/xc_private.c +10
-0+struct iovec *local_iov =NULL ; +int rc =0 , iov_idx =0 , saved_errno =0 ; +ssize_t len; + +while ( iov_idx < iovcnt ) + { +/* Skip over iov[] entries with 0 length. */ +while ( iov[iov_idx].iov_len ==0 ) +if ( ++iov_idx == iovcnt ) + goto out;
set saved_errn to 0 before goto out?
Quoted 72 lines
tools/libxc/xc_private.c +48
-0+ + len =writev (fd, &iov[iov_idx],min (iovcnt - iov_idx,IOV_MAX )); + saved_errno = errno; + +if ( (len ==-1 ) && (errno ==EINTR ) ) +continue ; +if ( len <=0 ) + { + rc =-1 ; + goto out; + } + +/* Check iov[] to see whether we had a partial or complete write. */ +while ( len >0 && (iov_idx < iovcnt) ) + { +if ( len >= iov[iov_idx].iov_len ) + len -= iov[iov_idx++].iov_len; +else + { +/* Partial write of iov[iov_idx]. Copy iov so we can adjust +* element iov_idx and resubmit the rest. */ +if ( !local_iov ) + { + local_iov =malloc (iovcnt *sizeof (*iov)); +if ( !local_iov ) + { + saved_errno =ENOMEM ; + goto out; + } + + iov =memcpy (local_iov, iov, iovcnt *sizeof (*iov)); + } + + local_iov[iov_idx].iov_base += len; + local_iov[iov_idx].iov_len -= len; +break ; + } + } + } + + saved_errno =0 ; + + out: +free (local_iov); + errno = saved_errno; +return rc; +} +int xc_ffs8 (uint8_t x) {int i;tools/libxc/xc_private.h +2
-0@@ -28,6 +28,7 @@#include <sys/stat.h> #include <stdlib.h> #include <sys/ioctl.h> +#include <sys/uio.h> #include "xenctrl.h" #include "xenctrlosdep.h" @@ -343,6 +344,7 @@ int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu);/* Return 0 on success; -1 on error setting errno. */ int read_exact (int fd,void *data,size_t size);/* EOF => -1, errno=0 */ int write_exact (int fd,const void *data,size_t size); +int writev_exact (int fd,const struct iovec *iov,int iovcnt);int xc_ffs8 (uint8_t x);int xc_ffs16 (uint16_t x);
Re: [Patch v3 2/2] tools/libxc: Implement writev_exact() in the same style as write_exact()
Quoted 31 lines · Wen Congyang
At 07/16/2014 10:32 PM, Andrew Cooper Wrote:
Quoted 30 lines
This implementation of
writev_exact()will cope with an iovcnt greater thanIOV_MAXbecause glibc will actually let this work anyway, and it is very useful not to have to work about this in the caller ofwritev_exact(). The caller is still required to ensure that the sum of iov_len's doesn't overflow assize_t.Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>---
v3:
* Re-add adjustment for partial writes.
* Split min/max adjustment into separate patch.v2:
* Remove adjustment for partial writes of a specific iov[] entry.--- tools/libxc/xc_private.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_private.h | 2 ++ 2 files changed, 62 insertions(+)tools/libxc/xc_private.c +0
-0@@ -858,6 +858,66 @@ int write_exact(int fd, const void *data, size_t size)return 0 ; }
Quoted 13 lines
tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 872
Quoted 12 lines
tools/libxc/xc_private.c +12
-0+int writev_exact (int fd,const struct iovec *iov,int iovcnt) +{ +struct iovec *local_iov =NULL ; +int rc =0 , iov_idx =0 , saved_errno =0 ; +ssize_t len; + +while ( iov_idx < iovcnt ) + { +/* Skip over iov[] entries with 0 length. */ +while ( iov[iov_idx].iov_len ==0 ) +if ( ++iov_idx == iovcnt ) + goto out;set
saved_errnto 0 before goto out?
Good catch.
~Andrew
PATCH v4 2/2 tools/libxc: Implement writev_exact() in the same style as write_exact()
This implementation of writev_exact() will cope with an iovcnt greater than IOV_MAX because glibc will actually let this work anyway, and it is very useful not to have to work about this in the caller of writev_exact(). The caller is still required to ensure that the sum of iov_len's doesn't overflow a ssize_t.
---
v4:
* Set errno to 0 when exiting due to 0-length iov[]s.
v3:
* Re-add adjustment for partial writes.
* Split min/max adjustment into separate patch.
v2:
* Remove adjustment for partial writes of a specific iov[] entry.
--- tools/libxc/xc_private.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_private.h | 2 ++ 2 files changed, 65 insertions(+)
tools/libxc/xc_private.c +63 -0
@@ -858,6 +858,69 @@ int write_exact(int fd, const void *data, size_t size)return 0 ; } +int writev_exact (int fd,const struct iovec *iov,int iovcnt) +{ +struct iovec *local_iov =NULL ; +int rc =0 , iov_idx =0 , saved_errno =0 ; +ssize_t len; + +while ( iov_idx < iovcnt ) + { +/* Skip over iov[] entries with 0 length. */ +while ( iov[iov_idx].iov_len ==0 ) +if ( ++iov_idx == iovcnt ) + { + saved_errno =0 ; + goto out; + } + + len =writev (fd, &iov[iov_idx],min (iovcnt - iov_idx,IOV_MAX )); + saved_errno = errno; + +if ( (len ==-1 ) && (errno ==EINTR ) ) +continue ; +if ( len <=0 ) + { + rc =-1 ; + goto out; + } + +/* Check iov[] to see whether we had a partial or complete write. */ +while ( len >0 && (iov_idx < iovcnt) ) + { +if ( len >= iov[iov_idx].iov_len ) + len -= iov[iov_idx++].iov_len; +else + { +/* Partial write of iov[iov_idx]. Copy iov so we can adjust +* element iov_idx and resubmit the rest. */ +if ( !local_iov ) + { + local_iov =malloc (iovcnt *sizeof (*iov)); +if ( !local_iov ) + { + saved_errno =ENOMEM ; + goto out; + } + + iov =memcpy (local_iov, iov, iovcnt *sizeof (*iov)); + } + + local_iov[iov_idx].iov_base += len; + local_iov[iov_idx].iov_len -= len; +break ; + } + } + } + + saved_errno =0 ; + + out: +free (local_iov); + errno = saved_errno; +return rc; +} +int xc_ffs8 (uint8_t x) {int i;
tools/libxc/xc_private.h +2 -0
@@ -28,6 +28,7 @@#include <sys/stat.h> #include <stdlib.h> #include <sys/ioctl.h> +#include <sys/uio.h> #include "xenctrl.h" #include "xenctrlosdep.h"
@@ -343,6 +344,7 @@ int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu);/* Return 0 on success; -1 on error setting errno. */ int read_exact (int fd,void *data,size_t size);/* EOF => -1, errno=0 */ int write_exact (int fd,const void *data,size_t size); +int writev_exact (int fd,const struct iovec *iov,int iovcnt);int xc_ffs8 (uint8_t x);int xc_ffs16 (uint16_t x);
Signature · 1 line
1.7.10.4
Re: [Patch v3 2/2] tools/libxc: Implement writev_exact() in the same style as write_exact()
In reply to Andrew CooperQuoted 46 lines · Andrew Cooper
Quoted 31 lines · Wen Congyang
At 07/16/2014 10:32 PM, Andrew Cooper Wrote:
Quoted 30 lines
This implementation of
writev_exact()will cope with an iovcnt greater thanIOV_MAXbecause glibc will actually let this work anyway, and it is very useful not to have to work about this in the caller ofwritev_exact(). The caller is still required to ensure that the sum of iov_len's doesn't overflow assize_t.Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>---
v3:
* Re-add adjustment for partial writes.
* Split min/max adjustment into separate patch.v2:
* Remove adjustment for partial writes of a specific iov[] entry.--- tools/libxc/xc_private.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_private.h | 2 ++ 2 files changed, 62 insertions(+)tools/libxc/xc_private.c +0
-0@@ -858,6 +858,66 @@ int write_exact(int fd, const void *data, size_t size)return 0 ; }Quoted 13 lines
tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 872
Quoted 12 lines
tools/libxc/xc_private.c +12
-0+int writev_exact (int fd,const struct iovec *iov,int iovcnt) +{ +struct iovec *local_iov =NULL ; +int rc =0 , iov_idx =0 , saved_errno =0 ; +ssize_t len; + +while ( iov_idx < iovcnt ) + { +/* Skip over iov[] entries with 0 length. */ +while ( iov[iov_idx].iov_len ==0 ) +if ( ++iov_idx == iovcnt ) + goto out;set
saved_errnto 0 before goto out?
Quoted 1 line
Good catch.
Isn't this a success path? errno is generally undefined on success.
Ian.
Re: [Patch v3 2/2] tools/libxc: Implement writev_exact() in the same style as write_exact()
At 07/18/2014 05:53 PM, Ian Campbell Wrote:
Quoted 47 lines · Andrew Cooper
Quoted 46 lines · Wen Congyang
Quoted 44 lines
At 07/16/2014 10:32 PM, Andrew Cooper Wrote:
Quoted 32 lines
This implementation of
writev_exact()will cope with an iovcnt greater thanIOV_MAXbecause glibc will actually let this work anyway, and it is very useful not to have to work about this in the caller ofwritev_exact(). The caller is still required to ensure that the sum of iov_len's doesn't overflow assize_t.Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>---
v3:
* Re-add adjustment for partial writes.
* Split min/max adjustment into separate patch.v2:
* Remove adjustment for partial writes of a specific iov[] entry.--- tools/libxc/xc_private.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_private.h | 2 ++ 2 files changed, 62 insertions(+)tools/libxc/xc_private.c +2
-0@@ -858,6 +858,66 @@ int write_exact(int fd, const void *data, size_t size)return 0 ; } +int writev_exact (int fd,const struct iovec *iov,int iovcnt) +{tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 872
Quoted 10 lines
tools/libxc/xc_private.c +10
-0+struct iovec *local_iov =NULL ; +int rc =0 , iov_idx =0 , saved_errno =0 ; +ssize_t len; + +while ( iov_idx < iovcnt ) + { +/* Skip over iov[] entries with 0 length. */ +while ( iov[iov_idx].iov_len ==0 ) +if ( ++iov_idx == iovcnt ) + goto out;set
saved_errnto 0 before goto out?
Quoted 3 lines
Quoted 1 line
Good catch.
Isn't this a success path? errno is generally undefined on success.
Yes, but we set saved_errno to 0 here:
tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 919
Quoted 7 lines
tools/libxc/xc_private.c +7
-0+ saved_errno =0 ; + + out: +free (local_iov); + errno = saved_errno; +return rc; +}
I think there is no need to save errno in this function, because we return -1 when writev()/malloc() fails.
Another problem:
tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 902
Quoted 7 lines
tools/libxc/xc_private.c +7
-0+ local_iov =malloc (iovcnt *sizeof (*iov)); +if ( !local_iov ) + { + saved_errno =ENOMEM ; + goto out; + } +
rc is not set to -1 before goto out.
Thanks
Wen Congyang
Quoted 5 lines
Ian.
.
Re: [Patch v3 2/2] tools/libxc: Implement writev_exact() in the same style as write_exact()
Quoted 60 lines · Wen Congyang
At 07/18/2014 05:53 PM, Ian Campbell Wrote:
Quoted 46 lines · Andrew Cooper
Quoted 45 lines · Wen Congyang
Quoted 44 lines
At 07/16/2014 10:32 PM, Andrew Cooper Wrote:
Quoted 32 lines
This implementation of
writev_exact()will cope with an iovcnt greater thanIOV_MAXbecause glibc will actually let this work anyway, and it is very useful not to have to work about this in the caller ofwritev_exact(). The caller is still required to ensure that the sum of iov_len's doesn't overflow assize_t.Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>CC Ian Jackson <[email protected]>---
v3:
* Re-add adjustment for partial writes.
* Split min/max adjustment into separate patch.v2:
* Remove adjustment for partial writes of a specific iov[] entry.--- tools/libxc/xc_private.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_private.h | 2 ++ 2 files changed, 62 insertions(+)tools/libxc/xc_private.c +2
-0@@ -858,6 +858,66 @@ int write_exact(int fd, const void *data, size_t size)return 0 ; } +int writev_exact (int fd,const struct iovec *iov,int iovcnt) +{tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 872
Quoted 10 lines
tools/libxc/xc_private.c +10
-0+struct iovec *local_iov =NULL ; +int rc =0 , iov_idx =0 , saved_errno =0 ; +ssize_t len; + +while ( iov_idx < iovcnt ) + { +/* Skip over iov[] entries with 0 length. */ +while ( iov[iov_idx].iov_len ==0 ) +if ( ++iov_idx == iovcnt ) + goto out;set
saved_errnto 0 before goto out?Quoted 2 lines
Quoted 1 line
Good catch.
Isn't this a success path? errno is generally undefined on success.
Yes, but we set
saved_errnoto 0 here:tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 919
Quoted 7 lines
tools/libxc/xc_private.c +7
-0+ saved_errno =0 ; + + out: +free (local_iov); + errno = saved_errno; +return rc; +}I think there is no need to save errno in this function, because we return -1 when writev()/malloc() fails.
Quoted 1 line
Another problem:
I am deliberately creating the same (somewhat quirky) error semantics of write_exact(), for consistency reasons.
The key point is that EOF is -1 and errno of 0.
Quoted 11 lines
tools/libxc/xc_private.c int write_exact(int fd, const void *data, size_t size) · line 902
Quoted 7 lines
tools/libxc/xc_private.c +7
-0+ local_iov =malloc (iovcnt *sizeof (*iov)); +if ( !local_iov ) + { + saved_errno =ENOMEM ; + goto out; + } +rc is not set to -1 before goto out.
Thanks
Wen Congyang
Good point.
~Andrew
Quoted 7 lines · Andrew Cooper
Move the typesafe
min()macro fromxc_dom_decompress_unsafe_xz.ctoxc_private.h, and complement it with an equivalentmax()macro.Replace current users of type unsafe MIN()/MAX() macros, and remove their scattered definitions.
Signed-off-by Andrew Cooper <[email protected]>
Ian Campbell
AppliedQuoted 10 lines · Ian Campbell
Quoted 7 lines · Andrew Cooper
Move the typesafe
min()macro fromxc_dom_decompress_unsafe_xz.ctoxc_private.h, and complement it with an equivalentmax()macro.Replace current users of type unsafe MIN()/MAX() macros, and remove their scattered definitions.
Signed-off-by Andrew Cooper <[email protected]>Acked-by Ian Campbell <[email protected]>
Applied, thanks.