BugFix: fix some errors found by cppcheck

Fix coding style violations and minor errors (race condition in h2generic.cpp).

Change-Id: Iec58f2f431de79320579704ac449475f18deb731
Reviewed-on: https://review.haiku-os.org/c/1186
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Lee Mon 2019-03-10 17:00:39 +03:00 committed by waddlesplash
parent b322554630
commit 446dc38f89
4 changed files with 4 additions and 6 deletions

View File

@ -614,7 +614,6 @@ supports_device(device_node* parent)
if (strcmp(bus, "pci") != 0)
return 0.0f;
}
if (type == PCI_base_peripheral) {
if (subType != PCI_sd_host)

View File

@ -218,7 +218,7 @@ read_status(usb_device_info *udi, usb_mass_CSW* csw, int transfer_len)
int try = 0;
do{
status = queue_bulk(udi, csw, CSW_LENGTH, true);
if(0 == try){
if(try == 0){
if(B_OK != status || B_OK != udi->status){
status = (*udi->usb_m->clear_feature)(udi->pipe_in, USB_FEATURE_ENDPOINT_HALT);
if(status != 0){

View File

@ -283,9 +283,8 @@ play_hangman(void)
while (*str) {
if (!(BIT_FROM_LETTER(*str) & tried_letters))
gotit=0;
if (*str == try) {
if (try == *str)
gotone = 1;
}
str++;
}
}

View File

@ -124,8 +124,8 @@ spawn_device(usb_device usb_dev)
}
release_sem_etc(dev_table_sem, 1, B_DO_NOT_RESCHEDULE);
// In the case we cannot us
if (bt_usb_devices[i] != new_bt_dev) {
// In the case we cannot find a free slot
if (i >= MAX_BT_GENERIC_USB_DEVICES) {
ERROR("%s: Device could not be added\n", __func__);
goto bail2;
}