PVS V547: always false conditions
Change-Id: I389c081331b1c5ef67bef9ffcac9055573e1ebf5 Reviewed-on: https://review.haiku-os.org/c/1605 Reviewed-by: Stephan Aßmus <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
cbda783eaa
commit
12d046d024
@@ -75,8 +75,10 @@
|
|||||||
#define USB_ENDPOINT_ATTR_IMPLICIT_USAGE 0x20
|
#define USB_ENDPOINT_ATTR_IMPLICIT_USAGE 0x20
|
||||||
#define USB_ENDPOINT_ATTR_USAGE_MASK 0x30
|
#define USB_ENDPOINT_ATTR_USAGE_MASK 0x30
|
||||||
|
|
||||||
|
/* Direction */
|
||||||
#define USB_ENDPOINT_ADDR_DIR_IN 0x80
|
#define USB_ENDPOINT_ADDR_DIR_IN 0x80
|
||||||
#define USB_ENDPOINT_ADDR_DIR_OUT 0x00
|
#define USB_ENDPOINT_ADDR_DIR_OUT 0x00
|
||||||
|
#define USB_ENDPOINT_ADDR_DIR_MASK 0x80
|
||||||
|
|
||||||
|
|
||||||
typedef struct usb_device_descriptor {
|
typedef struct usb_device_descriptor {
|
||||||
|
|||||||
@@ -1154,7 +1154,7 @@ bind_aperture(aperture_id id, area_id area, addr_t base, size_t size,
|
|||||||
|
|
||||||
status_t status = aperture->BindMemory(memory, base, size);
|
status_t status = aperture->BindMemory(memory, base, size);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
if (reservedBase < 0)
|
if (reservedBase != 0)
|
||||||
aperture->DeleteMemory(memory);
|
aperture->DeleteMemory(memory);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ get_elantech_movement(elantech_cookie *cookie, mouse_movement *movement)
|
|||||||
dprintf("ELANTECH: Fingers %d, raw %x (MOTION)\n", (packet[3] & 0xe0) >>5, packet[3]); //Most likely palm
|
dprintf("ELANTECH: Fingers %d, raw %x (MOTION)\n", (packet[3] & 0xe0) >>5, packet[3]); //Most likely palm
|
||||||
if (cookie->fingers == 0) return B_OK;
|
if (cookie->fingers == 0) return B_OK;
|
||||||
//handle overflow and delta values
|
//handle overflow and delta values
|
||||||
if ((packet[0] & 0x10) == 1) {
|
if ((packet[0] & 0x10) != 0) {
|
||||||
event.xPosition = cookie->x += 5 * (int8)packet[1];
|
event.xPosition = cookie->x += 5 * (int8)packet[1];
|
||||||
event.yPosition = cookie->y += 5 * (int8)packet[2];
|
event.yPosition = cookie->y += 5 * (int8)packet[2];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ scsi_create_bus(device_node *node, uint8 path_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = INIT_BEN(&bus->mutex, "scsi_bus_mutex");
|
res = INIT_BEN(&bus->mutex, "scsi_bus_mutex");
|
||||||
|
|
||||||
if (res < B_OK)
|
if (res < B_OK)
|
||||||
goto err3;
|
goto err3;
|
||||||
|
|
||||||
|
|||||||
@@ -493,13 +493,13 @@ ASIXDevice::_SetupEndpoints()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_IN)
|
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_MASK)
|
||||||
== USB_ENDPOINT_ADDR_DIR_IN) {
|
== USB_ENDPOINT_ADDR_DIR_IN) {
|
||||||
readEndpoint = ep;
|
readEndpoint = ep;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_OUT)
|
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_MASK)
|
||||||
== USB_ENDPOINT_ADDR_DIR_OUT) {
|
== USB_ENDPOINT_ADDR_DIR_OUT) {
|
||||||
writeEndpoint = ep;
|
writeEndpoint = ep;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -577,14 +577,14 @@ DavicomDevice::_SetupEndpoints()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_IN)
|
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_MASK)
|
||||||
== USB_ENDPOINT_ADDR_DIR_IN)
|
== USB_ENDPOINT_ADDR_DIR_IN)
|
||||||
{
|
{
|
||||||
readEndpoint = ep;
|
readEndpoint = ep;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_OUT)
|
if ((epd->endpoint_address & USB_ENDPOINT_ADDR_DIR_MASK)
|
||||||
== USB_ENDPOINT_ADDR_DIR_OUT)
|
== USB_ENDPOINT_ADDR_DIR_OUT)
|
||||||
{
|
{
|
||||||
writeEndpoint = ep;
|
writeEndpoint = ep;
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ acpi_battery_read(void* _cookie, off_t position, void *buffer, size_t* numBytes)
|
|||||||
if (position == 0) {
|
if (position == 0) {
|
||||||
char string[512];
|
char string[512];
|
||||||
char *str = string;
|
char *str = string;
|
||||||
size_t max_len = sizeof(string);
|
ssize_t max_len = sizeof(string);
|
||||||
snprintf(str, max_len, "Battery Status:\n");
|
snprintf(str, max_len, "Battery Status:\n");
|
||||||
max_len -= strlen(str);
|
max_len -= strlen(str);
|
||||||
str += strlen(str);
|
str += strlen(str);
|
||||||
|
|||||||
Reference in New Issue
Block a user