]> wimlib.net Git - wimlib/blobdiff - src/resource.c
WIM chunk size: Calculate with existing macros when possible
[wimlib] / src / resource.c
index d60f5476ebadd9557e948e6c7e823f5d30e536b5..29bfcd7fd0a962fb7c29d6f7621251876bc43e5d 100644 (file)
@@ -97,8 +97,8 @@ read_compressed_resource(int in_fd,
 
        /* Calculate how many chunks the resource consists of in its entirety.
         * */
-       u64 num_chunks = (resource_uncompressed_size + WIM_CHUNK_SIZE - 1) /
-                                                               WIM_CHUNK_SIZE;
+       u64 num_chunks = DIV_ROUND_UP(resource_uncompressed_size, WIM_CHUNK_SIZE);
+
        /* As mentioned, the first chunk has no entry in the chunk table. */
        u64 num_chunk_entries = num_chunks - 1;