Some curious code across the project

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jens,

I spotted some code that looks like a mistake or needs to be explicated.


https://github.com/axboe/fio/blob/master/log.c#L127

In this code, we can see two fwrite overrding the same ret variable.

I was wondering if these two fwrite must be exclusive to each other or 
if ret value must be inspected before being overwritten.


There is almost the same case here : 
https://github.com/axboe/fio/blob/051382218cbe5101a5caa83eab55ed04608f8475/blktrace.c#L763



https://github.com/axboe/fio/blob/051382218cbe5101a5caa83eab55ed04608f8475/zbd.c#L1330

"new_len = new_len / min_bs * min_bs"

I'm not really what it means to be done here. Is it a typo or a kind of 
rounding ?



https://github.com/axboe/fio/blob/051382218cbe5101a5caa83eab55ed04608f8475/engines/sg.c#L461

Looks like the ret is useless here.


https://github.com/axboe/fio/blob/051382218cbe5101a5caa83eab55ed04608f8475/engines/sg.c#L964

ret value is unused here, shall we return it or just ignore ret ?


https://github.com/axboe/fio/blob/051382218cbe5101a5caa83eab55ed04608f8475/lib/fls.h#L35

Looks like the x <<= 1 do anything here as x is a local value and we 
don't process it anymore.


I can provide patches to these issues,

Erwan,





[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux