patch: signed char issues

From: Philip Blundell (Philip.Blundell@pobox.com)
Date: Sun Apr 23 2000 - 17:21:55 EST


Here's a handful of patches for areas of the kernel that assume `char' is
a signed type. It was generated against 2.3.99-pre3 but it seems to apply
cleanly against -pre5 as well.

p.

--- linux/drivers/sound/mad16.c Sat Mar 18 11:58:47 2000
+++ linux/drivers/sound/mad16.c Sat Mar 18 12:56:42 2000
@@ -643,10 +643,10 @@ static int __init probe_mad16(struct add
 static void __init attach_mad16(struct address_info *hw_config)
 {
 
- static char interrupt_bits[12] = {
+ static signed char interrupt_bits[12] = {
                 -1, -1, -1, -1, -1, -1, -1, 0x08, -1, 0x10, 0x18, 0x20
         };
- char bits;
+ signed char bits;
 
         static char dma_bits[4] = {
                 1, 2, 0, 3

--- linux/drivers/sound/trix.c Sat Mar 18 11:58:22 2000
+++ linux/drivers/sound/trix.c Sat Mar 18 12:56:43 2000
@@ -276,7 +276,7 @@ static int __init probe_trix_sb(struct a
 
         int tmp;
         unsigned char conf;
- static char irq_translate[] = {
+ static signed char irq_translate[] = {
                 -1, -1, -1, 0, 1, 2, -1, 3
         };
 
@@ -346,7 +346,7 @@ static void __init attach_trix_mpu(struc
 static int __init probe_trix_mpu(struct address_info *hw_config)
 {
         unsigned char conf;
- static char irq_bits[] = {
+ static int irq_bits[] = {
                 -1, -1, -1, 1, 2, 3, -1, 4, -1, 5
         };
 

--- linux/drivers/char/isicom.c Sun Feb 20 14:11:04 2000
+++ linux/drivers/char/isicom.c Sun Apr 23 18:13:32 2000
@@ -98,7 +98,7 @@ static DECLARE_MUTEX(tmp_buf_sem);
 
 /* baud index mappings from linux defns to isi */
 
-static char linuxb_to_isib[] = {
+static signed char linuxb_to_isib[] = {
         -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17,
         18, 19
 };

--- linux/drivers/net/de4x5.c Sun Feb 27 12:43:11 2000
+++ linux/drivers/net/de4x5.c Sun Apr 23 18:07:22 2000
@@ -4356,12 +4356,11 @@ srom_command(u_int command, u_long addr)
 static void
 srom_address(u_int command, u_long addr, u_char offset)
 {
- int i;
- char a;
+ int i, a;
     
- a = (char)(offset << 2);
+ a = offset << 2;
     for (i=0; i<6; i++, a <<= 1) {
- srom_latch(command | ((a < 0) ? DT_IN : 0), addr);
+ srom_latch(command | ((a & 0x80) ? DT_IN : 0), addr);
     }
     de4x5_us_delay(1);
     
--- linux/drivers/usb/dc2xx.c Sat Apr 1 12:39:31 2000
+++ linux/drivers/usb/dc2xx.c Sat Apr 1 12:59:05 2000
@@ -109,8 +109,8 @@ static const struct camera {
 
 struct camera_state {
         struct usb_device *dev; /* USB device handle */
- char inEP; /* read endpoint */
- char outEP; /* write endpoint */
+ int inEP; /* read endpoint */
+ int outEP; /* write endpoint */
         const struct camera *info; /* DC-240, etc */
         int subminor; /* which minor dev #? */
         int isActive; /* I/O taking place? */

--- linux/fs/udf/inode.c Sat Apr 1 12:40:15 2000
+++ linux/fs/udf/inode.c Sat Apr 1 12:59:17 2000
@@ -394,7 +394,7 @@ static struct buffer_head * inode_getblk
         int c = 1;
         int lbcount = 0, b_off = 0, offset = 0;
         Uint32 newblocknum, newblock;
- char etype;
+ int etype;
         int goal = 0, pgoal = UDF_I_LOCATION(inode).logicalBlockNum;
         char lastblock = 0;
 
@@ -1886,7 +1886,7 @@ int udf_delete_aext(struct inode *inode,
         struct buffer_head *obh;
         lb_addr obloc;
         int oextoffset, adsize;
- char type;
+ int type;
         struct AllocExtDesc *aed;
 
         if (!(nbh))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:22 EST