@@ -369,10 +369,8 @@ rpc_bdev_lvol_create(struct spdk_jsonrpc_request *request,
369
369
clear_method = LVOL_CLEAR_WITH_DEFAULT ;
370
370
}
371
371
372
- const int min_priority_class = 0 ;
373
- const int max_priority_class = (1 << NBITS_PRIORITY_CLASS ) - 1 ;
374
- if (!(req .lvol_priority_class >= min_priority_class && req .lvol_priority_class <= max_priority_class )) {
375
- SPDK_ERRLOG ("lvol priority class is not within the allowed range of [%d, %d]" , min_priority_class , max_priority_class );
372
+ if (!(req .lvol_priority_class >= MIN_PRIORITY_CLASS && req .lvol_priority_class <= MAX_PRIORITY_CLASS )) {
373
+ SPDK_ERRLOG ("lvol priority class is not within the allowed range of [%d, %d]" , MIN_PRIORITY_CLASS , MAX_PRIORITY_CLASS );
376
374
spdk_jsonrpc_send_error_response (request , - EINVAL , spdk_strerror (EINVAL ));
377
375
goto cleanup ;
378
376
}
@@ -1712,10 +1710,8 @@ void rpc_bdev_lvol_set_priority_class(struct spdk_jsonrpc_request *request,
1712
1710
goto cleanup ;
1713
1711
}
1714
1712
1715
- const int min_priority_class = 0 ;
1716
- const int max_priority_class = (1 << NBITS_PRIORITY_CLASS ) - 1 ;
1717
- if (!(req .lvol_priority_class >= min_priority_class && req .lvol_priority_class <= max_priority_class )) {
1718
- SPDK_ERRLOG ("lvol priority class is not within the allowed range of [%d, %d]" , min_priority_class , max_priority_class );
1713
+ if (!(req .lvol_priority_class >= MIN_PRIORITY_CLASS && req .lvol_priority_class <= MAX_PRIORITY_CLASS )) {
1714
+ SPDK_ERRLOG ("lvol priority class is not within the allowed range of [%d, %d]" , MIN_PRIORITY_CLASS , MAX_PRIORITY_CLASS );
1719
1715
spdk_jsonrpc_send_error_response (request , - EINVAL , spdk_strerror (EINVAL ));
1720
1716
goto cleanup ;
1721
1717
}
0 commit comments