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:
parent
b322554630
commit
446dc38f89
@ -614,7 +614,6 @@ supports_device(device_node* parent)
|
|||||||
|
|
||||||
if (strcmp(bus, "pci") != 0)
|
if (strcmp(bus, "pci") != 0)
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
|
||||||
|
|
||||||
if (type == PCI_base_peripheral) {
|
if (type == PCI_base_peripheral) {
|
||||||
if (subType != PCI_sd_host)
|
if (subType != PCI_sd_host)
|
||||||
|
@ -218,7 +218,7 @@ read_status(usb_device_info *udi, usb_mass_CSW* csw, int transfer_len)
|
|||||||
int try = 0;
|
int try = 0;
|
||||||
do{
|
do{
|
||||||
status = queue_bulk(udi, csw, CSW_LENGTH, true);
|
status = queue_bulk(udi, csw, CSW_LENGTH, true);
|
||||||
if(0 == try){
|
if(try == 0){
|
||||||
if(B_OK != status || B_OK != udi->status){
|
if(B_OK != status || B_OK != udi->status){
|
||||||
status = (*udi->usb_m->clear_feature)(udi->pipe_in, USB_FEATURE_ENDPOINT_HALT);
|
status = (*udi->usb_m->clear_feature)(udi->pipe_in, USB_FEATURE_ENDPOINT_HALT);
|
||||||
if(status != 0){
|
if(status != 0){
|
||||||
|
@ -283,9 +283,8 @@ play_hangman(void)
|
|||||||
while (*str) {
|
while (*str) {
|
||||||
if (!(BIT_FROM_LETTER(*str) & tried_letters))
|
if (!(BIT_FROM_LETTER(*str) & tried_letters))
|
||||||
gotit=0;
|
gotit=0;
|
||||||
if (*str == try) {
|
if (try == *str)
|
||||||
gotone = 1;
|
gotone = 1;
|
||||||
}
|
|
||||||
str++;
|
str++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ spawn_device(usb_device usb_dev)
|
|||||||
}
|
}
|
||||||
release_sem_etc(dev_table_sem, 1, B_DO_NOT_RESCHEDULE);
|
release_sem_etc(dev_table_sem, 1, B_DO_NOT_RESCHEDULE);
|
||||||
|
|
||||||
// In the case we cannot us
|
// In the case we cannot find a free slot
|
||||||
if (bt_usb_devices[i] != new_bt_dev) {
|
if (i >= MAX_BT_GENERIC_USB_DEVICES) {
|
||||||
ERROR("%s: Device could not be added\n", __func__);
|
ERROR("%s: Device could not be added\n", __func__);
|
||||||
goto bail2;
|
goto bail2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user