ixj gcc 4.1 warning fix
PATCH 1/1 ixj gcc 4.1 warning fix
Fixes the following warnings,
drivers/telephony/ixj.c: In function 'ixj_pstn_state':drivers/telephony/ixj.c:4847: warning: 'bytes.high' may be used uninitialized in this function drivers/telephony/ixj.c: In function 'ixj_write_frame':drivers/telephony/ixj.c:3448: warning: 'blankword.high' may be used uninitialized in this function drivers/telephony/ixj.c:3448: warning: 'blankword.low' may be used uninitialized in this function
drivers/telephony/ixj.c +4 -2
@@ -3445,7 +3445,7 @@ static void ixj_write_frame(IXJ *j) {int cnt, frame_count, dly;IXJ_WORD dat; -BYTES blankword; +BYTES blankword = { .high =0 , .low =0 }; frame_count =0 ;if (j->flags.cidplay) {
@@ -3503,6 +3503,7 @@ static void ixj_write_frame(IXJ *j) blankword.low = blankword.high =0x00 ;break ;case PLAYBACK_MODE_8LINEAR_WSS : +default : blankword.low = blankword.high =0x80 ;break ; }
@@ -4844,7 +4845,7 @@ static char daa_int_read(IXJ *j)static char daa_CR_read (IXJ *j,int cr) {IXJ_WORD wdata; -BYTES bytes; +BYTES bytes = { .high =0 , .low =0 };if (!SCI_Prepare (j))return 0 ;
@@ -4860,6 +4861,7 @@ static char daa_CR_read(IXJ *j, int cr) bytes.high =0xB0 + cr;break ;case SOP_PU_PULSEDIALING : +default : bytes.high =0xF0 + cr;break ; }
Quoted 9 lines · Daniel Walker
Fixes the following warnings,
drivers/telephony/ixj.c: In function 'ixj_pstn_state':drivers/telephony/ixj.c:4847: warning: 'bytes.high' may be used uninitialized in this functiondrivers/telephony/ixj.c: In function 'ixj_write_frame':drivers/telephony/ixj.c:3448: warning: 'blankword.high' may be used uninitialized in this functiondrivers/telephony/ixj.c:3448: warning: 'blankword.low' may be used uninitialized in this functionSigned-off-by Daniel Walker <[email protected]>
No this is not a good idea either. The missing default case stuff is as far as I can see from inspection not neccessary. If anything you want to add
default: BUG();
since those are impossible cases.
The unusued variables also appear to be just compiler confusion.