Fixes the sorting of microcode images from the filesystem
on little endian systems so that when using the ncurses
interface to download microcode, the latest version shows
up as the top option.

Signed-off-by: Brian King <brk...@linux.vnet.ibm.com>
---
 iprlib.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/iprlib.c b/iprlib.c
index 97653e4..bc4afe3 100644
--- a/iprlib.c
+++ b/iprlib.c
@@ -8369,8 +8369,11 @@ static int fw_compare(const void *parm1,
        struct ipr_fw_images *first = (struct ipr_fw_images *)parm1;
        struct ipr_fw_images *second = (struct ipr_fw_images *)parm2;
 
-       return memcmp(&second->version, &first->version,
-                     sizeof(second->version));
+       if (first->version < second->version)
+               return 1;
+       if (second->version > first->version)
+               return -1;
+       return 0;
 }
 
 /**
-- 
1.8.3.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to