Skip to content

Commit

Permalink
drivers/telephony/ixj: cleanup and fix gcc warning
Browse files Browse the repository at this point in the history
1) Fix gcc uninit'd var warnings by adding 'default' switch stmt labels
in two cases.  It was lightning-strikes unlikely that a problem would
ever arise, but not impossible.

2) Tighten the scope of 'blankword' in two cases.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Jeff Garzik committed Jul 17, 2007
1 parent 79c63e1 commit 0d480db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/telephony/ixj.c
Original file line number Diff line number Diff line change
Expand Up @@ -3453,7 +3453,6 @@ static void ixj_write_frame(IXJ *j)
{
int cnt, frame_count, dly;
IXJ_WORD dat;
BYTES blankword;

frame_count = 0;
if(j->flags.cidplay) {
Expand Down Expand Up @@ -3501,13 +3500,16 @@ static void ixj_write_frame(IXJ *j)
}
if (frame_count >= 1) {
if (j->ver.low == 0x12 && j->play_mode && j->flags.play_first_frame) {
BYTES blankword;

switch (j->play_mode) {
case PLAYBACK_MODE_ULAW:
case PLAYBACK_MODE_ALAW:
blankword.low = blankword.high = 0xFF;
break;
case PLAYBACK_MODE_8LINEAR:
case PLAYBACK_MODE_16LINEAR:
default:
blankword.low = blankword.high = 0x00;
break;
case PLAYBACK_MODE_8LINEAR_WSS:
Expand All @@ -3531,6 +3533,8 @@ static void ixj_write_frame(IXJ *j)
j->flags.play_first_frame = 0;
} else if (j->play_codec == G723_63 && j->flags.play_first_frame) {
for (cnt = 0; cnt < 24; cnt++) {
BYTES blankword;

if(cnt == 12) {
blankword.low = 0x02;
blankword.high = 0x00;
Expand Down Expand Up @@ -4868,6 +4872,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;
}
Expand Down

0 comments on commit 0d480db

Please sign in to comment.