Style cleanups for arm crc32c hw support
authorJens Axboe <axboe@fb.com>
Thu, 5 Jan 2017 02:44:35 +0000 (19:44 -0700)
committerJens Axboe <axboe@fb.com>
Thu, 5 Jan 2017 02:44:35 +0000 (19:44 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
crc/crc32c-arm64.c
crc/crc32c.h

index 78fa64ec76cfd6af6d2feb87560ad31d2b0ea756..c3f42c7cd0ace8fbaef7acbbace2e2c9548b7303 100644 (file)
@@ -76,7 +76,7 @@ uint32_t crc32c_arm64(unsigned char const *data, unsigned long length)
                data += sizeof(uint64_t);
        }
 
-       if(!(len += 1024))
+       if (!(len += 1024))
                return crc;
 
        while ((len -= sizeof(uint64_t)) >= 0) {
@@ -103,11 +103,11 @@ uint32_t crc32c_arm64(unsigned char const *data, unsigned long length)
 void crc32c_arm64_probe(void)
 {
        unsigned long hwcap;
+
        if (!crc32c_probed) {
                hwcap = getauxval(AT_HWCAP);
-               if (hwcap & HWCAP_CRC32) {
+               if (hwcap & HWCAP_CRC32)
                        crc32c_arm64_available = 1;
-               }
                crc32c_probed = 1;
        }
 }
index 50d349bdddf33d0525654f07afe12aeb95c03695..5d664079b940fcb1691ceb569e7882fee7b57966 100644 (file)
@@ -46,9 +46,8 @@ static inline void crc32c_intel_probe(void)
 
 static inline uint32_t fio_crc32c(unsigned char const *buf, unsigned long len)
 {
-       if (crc32c_arm64_available) {
+       if (crc32c_arm64_available)
                return crc32c_arm64(buf, len);
-       }
 
        if (crc32c_intel_available)
                return crc32c_intel(buf, len);