summaryrefslogtreecommitdiff
path: root/extras/scsi_id
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-08-01 01:33:36 +0200
committerKay Sievers <kay.sievers@suse.de>2005-08-01 01:33:36 +0200
commit70721db6d7ba0d4f3ac5c17f2cedac056065ad8a (patch)
treef029523e975639453dcd027ee43a7bc742d0845c /extras/scsi_id
parent62a22c8d75550d5720019468c7a881a573bff22b (diff)
fix GGC signed pointer warnings and switch volume_id to stdint
Solaris uses volume_id now and they fiddled around with configure scripts to map the linux kernel int types. Adding the types locally to volume_id breaks the klibc build, so just switch to these ugly types and forget it. :) Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'extras/scsi_id')
-rw-r--r--extras/scsi_id/Makefile3
-rw-r--r--extras/scsi_id/scsi_id.c5
-rw-r--r--extras/scsi_id/scsi_serial.c15
3 files changed, 12 insertions, 11 deletions
diff --git a/extras/scsi_id/Makefile b/extras/scsi_id/Makefile
index 7aa3e83470..24c1b32128 100644
--- a/extras/scsi_id/Makefile
+++ b/extras/scsi_id/Makefile
@@ -28,7 +28,7 @@ INSTALL_DATA = ${INSTALL} -m 644
# Note some of the variables used here are set when built under udev, and
# otherwise might not be set.
-override CFLAGS+=-Wall -fno-builtin
+CFLAGS+=-Wall -fno-builtin
PROG=scsi_id
SYSFS=-lsysfs
@@ -77,3 +77,4 @@ spotless: clean
$(PROG): $(OBJS)
$(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
+
diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c
index 1b4234a40e..8e5172f93c 100644
--- a/extras/scsi_id/scsi_id.c
+++ b/extras/scsi_id/scsi_id.c
@@ -101,10 +101,9 @@ void log_message (int level, const char *format, ...)
return;
}
-static void set_str(char *to, const unsigned char *from, int count)
+static void set_str(char *to, const char *from, size_t count)
{
- int i, j;
- int len;
+ size_t i, j, len;
/* strip trailing whitespace */
len = strnlen(from, count);
diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c
index 7bfa9d1812..73d66ee615 100644
--- a/extras/scsi_id/scsi_serial.c
+++ b/extras/scsi_id/scsi_serial.c
@@ -294,9 +294,9 @@ static int scsi_dump(struct sysfs_device *scsi_dev, struct sg_io_hdr *io)
return -1;
}
-static int scsi_inquiry(struct sysfs_device *scsi_dev, int fd, unsigned
- char evpd, unsigned char page, unsigned char *buf,
- unsigned int buflen)
+static int scsi_inquiry(struct sysfs_device *scsi_dev, int fd,
+ unsigned char evpd, unsigned char page,
+ unsigned char *buf, unsigned int buflen)
{
unsigned char inq_cmd[INQUIRY_CMDLEN] =
{ INQUIRY_CMD, evpd, page, 0, buflen, 0 };
@@ -367,7 +367,7 @@ error:
/* Get list of supported EVPD pages */
static int do_scsi_page0_inquiry(struct sysfs_device *scsi_dev, int fd,
- char *buffer, int len)
+ unsigned char *buffer, unsigned int len)
{
int retval;
struct sysfs_attribute *vendor;
@@ -407,7 +407,7 @@ static int do_scsi_page0_inquiry(struct sysfs_device *scsi_dev, int fd,
scsi_dev->name);
return 1;
}
- if (!strncmp(&buffer[VENDOR_LENGTH], vendor->value,
+ if (!strncmp((char *)&buffer[VENDOR_LENGTH], vendor->value,
VENDOR_LENGTH)) {
log_message(LOG_WARNING, "%s: invalid page0 data\n",
scsi_dev->name);
@@ -470,8 +470,9 @@ static int prepend_vendor_model(struct sysfs_device *scsi_dev, char *serial)
* check_fill_0x83_id - check the page 0x83 id, if OK allocate and fill
* serial number.
**/
-static int check_fill_0x83_id(struct sysfs_device *scsi_dev, char
- *page_83, const struct scsi_id_search_values
+static int check_fill_0x83_id(struct sysfs_device *scsi_dev,
+ unsigned char *page_83,
+ const struct scsi_id_search_values
*id_search, char *serial, int max_len)
{
int i, j, len;