@@ -192,10 +192,11 @@ static int d_raw_to_fd(const unsigned char *buf, unsigned len, int fd)
192192static void progress_runner (float progress )
193193{
194194 const size_t barWidth = 70 ;
195+ size_t i ;
195196
196197 fprintf (stdout , "[" );
197198 size_t pos = barWidth * progress ;
198- for (size_t i = 0 ; i < barWidth ; ++ i ) {
199+ for (i = 0 ; i < barWidth ; ++ i ) {
199200 if (i <= pos ) {
200201 fprintf (stdout , "=" );
201202 } else {
@@ -216,6 +217,8 @@ static int nvme_get_internal_log(int fd, const char* const filename, bool curren
216217 // By trial and error it seems that the largest transfer chunk size
217218 // is 128 * 32 = 4k sectors = 2MB
218219 const __u32 max_pages = 128 ;
220+ size_t i ;
221+ unsigned j ;
219222 err = nvme_sct_command_transfer_log (fd , current );
220223 if (err ) {
221224 fprintf (stderr , "%s: SCT command transfer failed\n" , __func__ );
@@ -267,7 +270,7 @@ static int nvme_get_internal_log(int fd, const char* const filename, bool curren
267270 }
268271 }
269272 // Now read the rest
270- for (size_t i = 1 ; i < pages ;) {
273+ for (i = 1 ; i < pages ;) {
271274 __u32 pages_chunk = max_pages ;
272275 if (pages_chunk + i >= pages ) {
273276 pages_chunk = pages - i ;
@@ -280,7 +283,7 @@ static int nvme_get_internal_log(int fd, const char* const filename, bool curren
280283 progress = (float ) (i ) / (float ) (pages );
281284 progress_runner (progress );
282285 if (filename == NULL ) {
283- for (unsigned j = 0 ; j < pages_chunk ; ++ j ) {
286+ for (j = 0 ; j < pages_chunk ; ++ j ) {
284287 fprintf (stdout , "Page: %zu of %zu\n" , i + j , pages );
285288 d (page_data + (j * page_data_len ), page_data_len , 16 , 1 );
286289 }
0 commit comments