libunicap/libunicap-0.9.12-arraycmp.patch

79 lines
2.6 KiB
Diff

From 6cf16e964e312a2e040cc3e7b45be21715961a19 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 7 Oct 2010 11:02:48 +0200
Subject: [PATCH 2/2] linunicap: do not compare arrays with NULL
---
cpi/vid21394/vid21394_base.c | 2 +-
cpi/vid21394/vid21394_cpi.c | 3 ---
src/unicap_helpers.c | 10 +++++-----
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/cpi/vid21394/vid21394_base.c b/cpi/vid21394/vid21394_base.c
index 464a760..2ba576d 100644
--- a/cpi/vid21394/vid21394_base.c
+++ b/cpi/vid21394/vid21394_base.c
@@ -501,7 +501,7 @@ static unicap_status_t _vid21394_send_fcp_command_new( vid21394handle_t vid21394
raw1394handle_t raw1394handle = vid21394handle->raw1394handle;
- nodeid_t nodeid = nodeid = 0xffc0 | vid21394handle->node;
+ nodeid_t nodeid = 0xffc0 | vid21394handle->node;
unicap_status_t status = STATUS_SUCCESS;
diff --git a/cpi/vid21394/vid21394_cpi.c b/cpi/vid21394/vid21394_cpi.c
index e3778e4..738d0d7 100644
--- a/cpi/vid21394/vid21394_cpi.c
+++ b/cpi/vid21394/vid21394_cpi.c
@@ -654,7 +654,6 @@ int cpi_enumerate_formats( void *cpi_data, unicap_format_t *format, int index )
return STATUS_INVALID_PARAMETER;
}
- if( !data->current_formats )
{
int tmp;
cpi_reenumerate_formats( cpi_data, &tmp );
@@ -683,7 +682,6 @@ int cpi_set_format( void *cpi_data, unicap_format_t *format )
TRACE( "cpi_set_format\n" );
- if( !data->current_formats )
{
int tmp;
cpi_reenumerate_formats( cpi_data, &tmp );
@@ -845,7 +843,6 @@ unicap_status_t cpi_get_format( void *cpi_data, unicap_format_t *format )
{
vid21394_data_t *data = cpi_data;
- if( !data->current_formats )
{
int tmp;
cpi_reenumerate_formats( cpi_data, &tmp );
diff --git a/src/unicap_helpers.c b/src/unicap_helpers.c
index c2e1ec4..67578ac 100644
--- a/src/unicap_helpers.c
+++ b/src/unicap_helpers.c
@@ -105,13 +105,13 @@ unicap_status_t unicap_describe_device( unicap_device_t *device, char *buffer, s
"Vendor id: %u ( 0x%x )\n"\
"cpi: %s\n"\
"device: %s\n",
- device->identifier ? device->identifier : "(nil)",
- device->model_name ? device->model_name : "(nil)",
- device->vendor_name ? device->vendor_name : "(nil)",
+ device->identifier,
+ device->model_name,
+ device->vendor_name,
device->model_id,
device->vendor_id, device->vendor_id,
- device->cpi_layer ? device->cpi_layer : "(nil)",
- device->device ? device->device : "(nil)" );
+ device->cpi_layer,
+ device->device);
strncpy( buffer, tmp_buffer, (*buffer_size)-1 );
--
1.7.2.3