more gcc34 lvalue fixes
Subsystems (4)
PATCH 1/1 more gcc34 lvalue fixes
Marcelo,
Here are some more fixes for broken lvalues in 2.4.28-pre2.
- drivers/net/ne2k-pci.c: cast-as-lvalue, fixes from 2.6
- drivers/scsi/53c7,8xx.c: cast-as-lvalue, new 2.4 fix since 2.6 doesn't seem to have this code any more
- drivers/scsi/advansys.c: cast-as-lvalue, fixes from 2.6
- drivers/scsi/dpt_i2o.c: cast-as-lvalue, fixes from 2.6
- drivers/scsi/seagate.c: cast-as-lvalue, fix from 2.6
- fs/affs/super.c: conditional-as-lvalue, new 2.4 fix since the 2.6 code is completely different
There is a half-broken asm() in drivers/scsi/ultrastor.c, but that problem is also not fixed in 2.6 so I'm ignoring it.
drivers/net/e100/e100.h has broken usage of __attribute__((packed)) together with typedef, but this is not a regression from previous gcc:s (gcc-3.4 just warns). I have a patch if you want it.
/Mikael
drivers/net/ne2k-pci.c +12 -4
@@ -505,8 +505,12 @@insl (NE_BASE +NE_DATAPORT , buf, count>>2 );if (count &3 ) { buf += count & ~3 ; -if (count &2 ) - *((u16 *)buf)++ =le16_to_cpu (inw (NE_BASE +NE_DATAPORT )); +if (count &2 ) { +u16 *b = (u16 *)buf; + + *b++ =le16_to_cpu (inw (NE_BASE +NE_DATAPORT )); + buf = (char *)b; + }if (count &1 ) *buf =inb (NE_BASE +NE_DATAPORT ); }
@@ -566,8 +570,12 @@outsl (NE_BASE +NE_DATAPORT , buf, count>>2 );if (count &3 ) { buf += count & ~3 ; -if (count &2 ) -outw (cpu_to_le16 (*((u16 *)buf)++),NE_BASE +NE_DATAPORT ); +if (count &2 ) { +u16 *b = (u16 *)buf; + +outw (cpu_to_le16 (*b++),NE_BASE +NE_DATAPORT ); + buf = (char *)b; + } } }
drivers/scsi/53c7,8xx.c +1 -1
@@ -3926,7 +3926,7 @@restore_flags (flags); cmd->result =le32_to_cpu (0xffff );/* The NCR will overwrite message and status with valid data */ - cmd->host_scribble = (unsigned char *) tmp =create_cmd (cmd); + cmd->host_scribble = (unsigned char *)create_cmd (cmd); }cli ();/*
drivers/scsi/advansys.c +13 -13
@@ -6118,8 +6118,8 @@ }else {/* Append to 'done_scp' at the end with 'last_scp'. */ ASC_ASSERT (last_scp !=NULL ); -REQPNEXT (last_scp) =asc_dequeue_list (&boardp->active, - &new_last_scp,ASC_TID_ALL ); + last_scp->host_scribble = (unsigned char *)asc_dequeue_list ( + &boardp->active, &new_last_scp,ASC_TID_ALL );if (new_last_scp !=NULL ) {ASC_ASSERT (REQPNEXT (last_scp) !=NULL );for (tscp =REQPNEXT (last_scp); tscp; tscp =REQPNEXT (tscp)) {
@@ -6141,8 +6141,8 @@ }else {/* Append to 'done_scp' at the end with 'last_scp'. */ ASC_ASSERT (last_scp !=NULL ); -REQPNEXT (last_scp) =asc_dequeue_list (&boardp->waiting, - &new_last_scp,ASC_TID_ALL ); + last_scp->host_scribble = (unsigned char *)asc_dequeue_list ( + &boardp->waiting, &new_last_scp,ASC_TID_ALL );if (new_last_scp !=NULL ) {ASC_ASSERT (REQPNEXT (last_scp) !=NULL );for (tscp =REQPNEXT (last_scp); tscp; tscp =REQPNEXT (tscp)) {
@@ -6394,8 +6394,8 @@ ASC_TID_ALL); }else {ASC_ASSERT (last_scp !=NULL ); -REQPNEXT (last_scp) =asc_dequeue_list (&boardp->done, - &new_last_scp,ASC_TID_ALL ); + last_scp->host_scribble = (unsigned char *)asc_dequeue_list ( + &boardp->done, &new_last_scp,ASC_TID_ALL );if (new_last_scp !=NULL ) {ASC_ASSERT (REQPNEXT (last_scp) !=NULL ); last_scp = new_last_scp;
@@ -6466,7 +6466,7 @@while (scp !=NULL ) {ASC_DBG1 (3 ,"asc_scsi_done_list: scp 0x%lx\n" , (ulong ) scp); tscp =REQPNEXT (scp); -REQPNEXT (scp) =NULL ; + scp->host_scribble =NULL ;ASC_STATS (scp->host, done);ASC_ASSERT (scp->scsi_done !=NULL ); scp->scsi_done (scp);
@@ -7511,7 +7511,7 @@ tid =REQPTID (reqp);ASC_ASSERT (tid >=0 && tid <=ADV_MAX_TID );if (flag ==ASC_FRONT ) { -REQPNEXT (reqp) = ascq->q_first[tid]; + reqp->host_scribble = (unsigned char *)ascq->q_first[tid]; ascq->q_first[tid] = reqp;/* If the queue was empty, set the last pointer. */ if (ascq->q_last[tid] ==NULL ) {
@@ -7519,10 +7519,10 @@ } }else {/* ASC_BACK */ if (ascq->q_last[tid] !=NULL ) { -REQPNEXT (ascq->q_last[tid]) = reqp; + ascq->q_last[tid]->host_scribble = (unsigned char *)reqp; } ascq->q_last[tid] = reqp; -REQPNEXT (reqp) =NULL ; + reqp->host_scribble =NULL ;/* If the queue was empty, set the first pointer. */ if (ascq->q_first[tid] ==NULL ) { ascq->q_first[tid] = reqp;
@@ -7643,7 +7643,7 @@ lastp = ascq->q_last[i]; }else {ASC_ASSERT (lastp !=NULL ); -REQPNEXT (lastp) = ascq->q_first[i]; + lastp->host_scribble = (unsigned char *)ascq->q_first[i]; lastp = ascq->q_last[i]; } ascq->q_first[i] = ascq->q_last[i] =NULL ;
@@ -7721,8 +7721,8 @@ currp; prevp = currp, currp = REQPNEXT(currp)) {if (currp == reqp) { ret =ASC_TRUE ; -REQPNEXT (prevp) =REQPNEXT (currp); -REQPNEXT (reqp) =NULL ; + prevp->host_scribble = (unsigned char *)REQPNEXT (currp); + reqp->host_scribble =NULL ;if (ascq->q_last[tid] == reqp) { ascq->q_last[tid] = prevp; }
drivers/scsi/dpt_i2o.c +2 -2
@@ -434,7 +434,7 @@ cmd->scsi_done (cmd);return 0 ; } - (struct adpt_device *)(cmd->device->hostdata) = pDev; + cmd->device->hostdata = pDev; } pDev->pScsi_dev = cmd->device;
@@ -2194,7 +2194,7 @@printk ("%s: scsi_register returned NULL\n" ,pHba->name);return -1 ; } - (adpt_hba *)(host->hostdata[0 ]) = pHba; + host->hostdata[0 ] = (unsigned long )pHba; pHba->host = host; host->irq = pHba->pDev->irq;;
drivers/scsi/seagate.c +1 -1
@@ -698,7 +698,7 @@ done_fn = done; current_target = SCpnt->target; current_lun = SCpnt->lun; - (const void *) current_cmnd = SCpnt->cmnd; + current_cmnd = SCpnt->cmnd; current_data = (unsigned char *) SCpnt->request_buffer; current_bufflen = SCpnt->request_bufflen; SCint = SCpnt;
fs/affs/super.c +1 -1
@@ -130,7 +130,7 @@printk ("AFFS: Argument for set[ug]id option missing\n" );return 0 ; }else { - (f ? *uid : *gid) =simple_strtoul (value,&value,0 ); + *(f ? uid : gid) =simple_strtoul (value,&value,0 );if (*value) {printk ("AFFS: Bad set[ug]id argument\n" );return 0 ;