clean-up: fixes "unsigned<0" warning
PATCH 1/1 clean-up: fixes "unsigned<0" warning
This patch fixes 5 warnings "comparison of unsigned expression < 0 is always false" occuring on lines 1987, 1988, 1989, 1990, 1992
Signed-off-by Riina Kikas <[email protected]>
drivers/block/as-iosched.c +7 -9
@@ -1974,23 +1974,21 @@SHOW_FUNCTION (as_write_batchexpire_show, ad->batch_expire[REQ_ASYNC ]);#undef SHOW_FUNCTION -#define STORE_FUNCTION (__FUNC, __PTR,MIN ,MAX ) \ +#define STORE_FUNCTION (__FUNC, __PTR,MAX ) \ static ssize_t __FUNC(struct as_data *ad, const char *page, size_t count) \ { \ int ret = as_var_store(__PTR, (page), count); \ - if (*(__PTR) < (MIN)) \ - *(__PTR) = (MIN); \ - else if (*(__PTR) > (MAX)) \ + if (*(__PTR) > (MAX)) \ *(__PTR) = (MAX); \ return ret; \ } -STORE_FUNCTION (as_readexpire_store, &ad->fifo_expire[REQ_SYNC ],0 ,INT_MAX ); -STORE_FUNCTION (as_writeexpire_store, &ad->fifo_expire[REQ_ASYNC ],0 ,INT_MAX ); -STORE_FUNCTION (as_anticexpire_store, &ad->antic_expire,0 ,INT_MAX ); +STORE_FUNCTION (as_readexpire_store, &ad->fifo_expire[REQ_SYNC ],INT_MAX ); +STORE_FUNCTION (as_writeexpire_store, &ad->fifo_expire[REQ_ASYNC ],INT_MAX ); +STORE_FUNCTION (as_anticexpire_store, &ad->antic_expire,INT_MAX );STORE_FUNCTION (as_read_batchexpire_store, - &ad->batch_expire[REQ_SYNC ],0 ,INT_MAX ); + &ad->batch_expire[REQ_SYNC ],INT_MAX );STORE_FUNCTION (as_write_batchexpire_store, - &ad->batch_expire[REQ_ASYNC ],0 ,INT_MAX ); + &ad->batch_expire[REQ_ASYNC ],INT_MAX );#undef STORE_FUNCTIONstatic struct as_fs_entry as_est_entry = {