diff options
author | Uwe Kleine-König <uwe@kleine-koenig.org> | 2012-03-23 18:01:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:31 -0400 |
commit | 953326cb60c1dff1bd3458d6468d16d75f2bcd61 (patch) | |
tree | 4cf6ed03aeff38847da138f191eea898297a6365 /drivers/staging | |
parent | 9710a78e55fe29fa2d2f1a9cbd1d399797585fd9 (diff) |
drivers/staging/telephony/ixj.c: fix warning about sequence points
In the statement
j->caplist[j->caps].handle = j->caps++;
there is no sequence point between the usage of j->caps on the LHS of
the assignment and the incrementation on its RHS. So it's not defined
in Standard C if j->caps is already incremented when used on the LHS
even though the postfix ++ operator is used. To properly fix that the
incrementation has to be done in a separate expression.
This fixes:
drivers/telephony/ixj.c: In function `add_caps':
drivers/telephony/ixj.c:5930:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:5950:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:5954:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:5965:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:5976:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:5988:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:5998:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6003:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6008:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6013:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6019:38: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6026:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6031:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6036:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6041:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6049:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6057:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6065:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
drivers/telephony/ixj.c:6071:39: warning: operation on `j->caps' may be undefined [-Wsequence-point]
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/telephony/ixj.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/drivers/staging/telephony/ixj.c b/drivers/staging/telephony/ixj.c index d5f923bcdffe..f96027921f60 100644 --- a/drivers/staging/telephony/ixj.c +++ b/drivers/staging/telephony/ixj.c | |||
@@ -5927,7 +5927,8 @@ static void add_caps(IXJ *j) | |||
5927 | j->caplist[j->caps].cap = PHONE_VENDOR_QUICKNET; | 5927 | j->caplist[j->caps].cap = PHONE_VENDOR_QUICKNET; |
5928 | strcpy(j->caplist[j->caps].desc, "Quicknet Technologies, Inc. (www.quicknet.net)"); | 5928 | strcpy(j->caplist[j->caps].desc, "Quicknet Technologies, Inc. (www.quicknet.net)"); |
5929 | j->caplist[j->caps].captype = vendor; | 5929 | j->caplist[j->caps].captype = vendor; |
5930 | j->caplist[j->caps].handle = j->caps++; | 5930 | j->caplist[j->caps].handle = j->caps; |
5931 | j->caps++; | ||
5931 | j->caplist[j->caps].captype = device; | 5932 | j->caplist[j->caps].captype = device; |
5932 | switch (j->cardtype) { | 5933 | switch (j->cardtype) { |
5933 | case QTI_PHONEJACK: | 5934 | case QTI_PHONEJACK: |
@@ -5947,11 +5948,13 @@ static void add_caps(IXJ *j) | |||
5947 | break; | 5948 | break; |
5948 | } | 5949 | } |
5949 | j->caplist[j->caps].cap = j->cardtype; | 5950 | j->caplist[j->caps].cap = j->cardtype; |
5950 | j->caplist[j->caps].handle = j->caps++; | 5951 | j->caplist[j->caps].handle = j->caps; |
5952 | j->caps++; | ||
5951 | strcpy(j->caplist[j->caps].desc, "POTS"); | 5953 | strcpy(j->caplist[j->caps].desc, "POTS"); |
5952 | j->caplist[j->caps].captype = port; | 5954 | j->caplist[j->caps].captype = port; |
5953 | j->caplist[j->caps].cap = pots; | 5955 | j->caplist[j->caps].cap = pots; |
5954 | j->caplist[j->caps].handle = j->caps++; | 5956 | j->caplist[j->caps].handle = j->caps; |
5957 | j->caps++; | ||
5955 | 5958 | ||
5956 | /* add devices that can do speaker/mic */ | 5959 | /* add devices that can do speaker/mic */ |
5957 | switch (j->cardtype) { | 5960 | switch (j->cardtype) { |
@@ -5962,7 +5965,8 @@ static void add_caps(IXJ *j) | |||
5962 | strcpy(j->caplist[j->caps].desc, "SPEAKER"); | 5965 | strcpy(j->caplist[j->caps].desc, "SPEAKER"); |
5963 | j->caplist[j->caps].captype = port; | 5966 | j->caplist[j->caps].captype = port; |
5964 | j->caplist[j->caps].cap = speaker; | 5967 | j->caplist[j->caps].cap = speaker; |
5965 | j->caplist[j->caps].handle = j->caps++; | 5968 | j->caplist[j->caps].handle = j->caps; |
5969 | j->caps++; | ||
5966 | default: | 5970 | default: |
5967 | break; | 5971 | break; |
5968 | } | 5972 | } |
@@ -5973,7 +5977,8 @@ static void add_caps(IXJ *j) | |||
5973 | strcpy(j->caplist[j->caps].desc, "HANDSET"); | 5977 | strcpy(j->caplist[j->caps].desc, "HANDSET"); |
5974 | j->caplist[j->caps].captype = port; | 5978 | j->caplist[j->caps].captype = port; |
5975 | j->caplist[j->caps].cap = handset; | 5979 | j->caplist[j->caps].cap = handset; |
5976 | j->caplist[j->caps].handle = j->caps++; | 5980 | j->caplist[j->caps].handle = j->caps; |
5981 | j->caps++; | ||
5977 | break; | 5982 | break; |
5978 | default: | 5983 | default: |
5979 | break; | 5984 | break; |
@@ -5985,7 +5990,8 @@ static void add_caps(IXJ *j) | |||
5985 | strcpy(j->caplist[j->caps].desc, "PSTN"); | 5990 | strcpy(j->caplist[j->caps].desc, "PSTN"); |
5986 | j->caplist[j->caps].captype = port; | 5991 | j->caplist[j->caps].captype = port; |
5987 | j->caplist[j->caps].cap = pstn; | 5992 | j->caplist[j->caps].cap = pstn; |
5988 | j->caplist[j->caps].handle = j->caps++; | 5993 | j->caplist[j->caps].handle = j->caps; |
5994 | j->caps++; | ||
5989 | break; | 5995 | break; |
5990 | default: | 5996 | default: |
5991 | break; | 5997 | break; |
@@ -5995,50 +6001,59 @@ static void add_caps(IXJ *j) | |||
5995 | strcpy(j->caplist[j->caps].desc, "ULAW"); | 6001 | strcpy(j->caplist[j->caps].desc, "ULAW"); |
5996 | j->caplist[j->caps].captype = codec; | 6002 | j->caplist[j->caps].captype = codec; |
5997 | j->caplist[j->caps].cap = ULAW; | 6003 | j->caplist[j->caps].cap = ULAW; |
5998 | j->caplist[j->caps].handle = j->caps++; | 6004 | j->caplist[j->caps].handle = j->caps; |
6005 | j->caps++; | ||
5999 | 6006 | ||
6000 | strcpy(j->caplist[j->caps].desc, "LINEAR 16 bit"); | 6007 | strcpy(j->caplist[j->caps].desc, "LINEAR 16 bit"); |
6001 | j->caplist[j->caps].captype = codec; | 6008 | j->caplist[j->caps].captype = codec; |
6002 | j->caplist[j->caps].cap = LINEAR16; | 6009 | j->caplist[j->caps].cap = LINEAR16; |
6003 | j->caplist[j->caps].handle = j->caps++; | 6010 | j->caplist[j->caps].handle = j->caps; |
6011 | j->caps++; | ||
6004 | 6012 | ||
6005 | strcpy(j->caplist[j->caps].desc, "LINEAR 8 bit"); | 6013 | strcpy(j->caplist[j->caps].desc, "LINEAR 8 bit"); |
6006 | j->caplist[j->caps].captype = codec; | 6014 | j->caplist[j->caps].captype = codec; |
6007 | j->caplist[j->caps].cap = LINEAR8; | 6015 | j->caplist[j->caps].cap = LINEAR8; |
6008 | j->caplist[j->caps].handle = j->caps++; | 6016 | j->caplist[j->caps].handle = j->caps; |
6017 | j->caps++; | ||
6009 | 6018 | ||
6010 | strcpy(j->caplist[j->caps].desc, "Windows Sound System"); | 6019 | strcpy(j->caplist[j->caps].desc, "Windows Sound System"); |
6011 | j->caplist[j->caps].captype = codec; | 6020 | j->caplist[j->caps].captype = codec; |
6012 | j->caplist[j->caps].cap = WSS; | 6021 | j->caplist[j->caps].cap = WSS; |
6013 | j->caplist[j->caps].handle = j->caps++; | 6022 | j->caplist[j->caps].handle = j->caps; |
6023 | j->caps++; | ||
6014 | 6024 | ||
6015 | /* software ALAW codec, made from ULAW */ | 6025 | /* software ALAW codec, made from ULAW */ |
6016 | strcpy(j->caplist[j->caps].desc, "ALAW"); | 6026 | strcpy(j->caplist[j->caps].desc, "ALAW"); |
6017 | j->caplist[j->caps].captype = codec; | 6027 | j->caplist[j->caps].captype = codec; |
6018 | j->caplist[j->caps].cap = ALAW; | 6028 | j->caplist[j->caps].cap = ALAW; |
6019 | j->caplist[j->caps].handle = j->caps++; | 6029 | j->caplist[j->caps].handle = j->caps; |
6030 | j->caps++; | ||
6020 | 6031 | ||
6021 | /* version 12 of the 8020 does the following codecs in a broken way */ | 6032 | /* version 12 of the 8020 does the following codecs in a broken way */ |
6022 | if (j->dsp.low != 0x20 || j->ver.low != 0x12) { | 6033 | if (j->dsp.low != 0x20 || j->ver.low != 0x12) { |
6023 | strcpy(j->caplist[j->caps].desc, "G.723.1 6.3kbps"); | 6034 | strcpy(j->caplist[j->caps].desc, "G.723.1 6.3kbps"); |
6024 | j->caplist[j->caps].captype = codec; | 6035 | j->caplist[j->caps].captype = codec; |
6025 | j->caplist[j->caps].cap = G723_63; | 6036 | j->caplist[j->caps].cap = G723_63; |
6026 | j->caplist[j->caps].handle = j->caps++; | 6037 | j->caplist[j->caps].handle = j->caps; |
6038 | j->caps++; | ||
6027 | 6039 | ||
6028 | strcpy(j->caplist[j->caps].desc, "G.723.1 5.3kbps"); | 6040 | strcpy(j->caplist[j->caps].desc, "G.723.1 5.3kbps"); |
6029 | j->caplist[j->caps].captype = codec; | 6041 | j->caplist[j->caps].captype = codec; |
6030 | j->caplist[j->caps].cap = G723_53; | 6042 | j->caplist[j->caps].cap = G723_53; |
6031 | j->caplist[j->caps].handle = j->caps++; | 6043 | j->caplist[j->caps].handle = j->caps; |
6044 | j->caps++; | ||
6032 | 6045 | ||
6033 | strcpy(j->caplist[j->caps].desc, "TrueSpeech 4.8kbps"); | 6046 | strcpy(j->caplist[j->caps].desc, "TrueSpeech 4.8kbps"); |
6034 | j->caplist[j->caps].captype = codec; | 6047 | j->caplist[j->caps].captype = codec; |
6035 | j->caplist[j->caps].cap = TS48; | 6048 | j->caplist[j->caps].cap = TS48; |
6036 | j->caplist[j->caps].handle = j->caps++; | 6049 | j->caplist[j->caps].handle = j->caps; |
6050 | j->caps++; | ||
6037 | 6051 | ||
6038 | strcpy(j->caplist[j->caps].desc, "TrueSpeech 4.1kbps"); | 6052 | strcpy(j->caplist[j->caps].desc, "TrueSpeech 4.1kbps"); |
6039 | j->caplist[j->caps].captype = codec; | 6053 | j->caplist[j->caps].captype = codec; |
6040 | j->caplist[j->caps].cap = TS41; | 6054 | j->caplist[j->caps].cap = TS41; |
6041 | j->caplist[j->caps].handle = j->caps++; | 6055 | j->caplist[j->caps].handle = j->caps; |
6056 | j->caps++; | ||
6042 | } | 6057 | } |
6043 | 6058 | ||
6044 | /* 8020 chips can do TS8.5 native, and 8021/8022 can load it */ | 6059 | /* 8020 chips can do TS8.5 native, and 8021/8022 can load it */ |
@@ -6046,7 +6061,8 @@ static void add_caps(IXJ *j) | |||
6046 | strcpy(j->caplist[j->caps].desc, "TrueSpeech 8.5kbps"); | 6061 | strcpy(j->caplist[j->caps].desc, "TrueSpeech 8.5kbps"); |
6047 | j->caplist[j->caps].captype = codec; | 6062 | j->caplist[j->caps].captype = codec; |
6048 | j->caplist[j->caps].cap = TS85; | 6063 | j->caplist[j->caps].cap = TS85; |
6049 | j->caplist[j->caps].handle = j->caps++; | 6064 | j->caplist[j->caps].handle = j->caps; |
6065 | j->caps++; | ||
6050 | } | 6066 | } |
6051 | 6067 | ||
6052 | /* 8021 chips can do G728 */ | 6068 | /* 8021 chips can do G728 */ |
@@ -6054,7 +6070,8 @@ static void add_caps(IXJ *j) | |||
6054 | strcpy(j->caplist[j->caps].desc, "G.728 16kbps"); | 6070 | strcpy(j->caplist[j->caps].desc, "G.728 16kbps"); |
6055 | j->caplist[j->caps].captype = codec; | 6071 | j->caplist[j->caps].captype = codec; |
6056 | j->caplist[j->caps].cap = G728; | 6072 | j->caplist[j->caps].cap = G728; |
6057 | j->caplist[j->caps].handle = j->caps++; | 6073 | j->caplist[j->caps].handle = j->caps; |
6074 | j->caps++; | ||
6058 | } | 6075 | } |
6059 | 6076 | ||
6060 | /* 8021/8022 chips can do G729 if loaded */ | 6077 | /* 8021/8022 chips can do G729 if loaded */ |
@@ -6062,13 +6079,15 @@ static void add_caps(IXJ *j) | |||
6062 | strcpy(j->caplist[j->caps].desc, "G.729A 8kbps"); | 6079 | strcpy(j->caplist[j->caps].desc, "G.729A 8kbps"); |
6063 | j->caplist[j->caps].captype = codec; | 6080 | j->caplist[j->caps].captype = codec; |
6064 | j->caplist[j->caps].cap = G729; | 6081 | j->caplist[j->caps].cap = G729; |
6065 | j->caplist[j->caps].handle = j->caps++; | 6082 | j->caplist[j->caps].handle = j->caps; |
6083 | j->caps++; | ||
6066 | } | 6084 | } |
6067 | if (j->dsp.low != 0x20 && j->flags.g729_loaded) { | 6085 | if (j->dsp.low != 0x20 && j->flags.g729_loaded) { |
6068 | strcpy(j->caplist[j->caps].desc, "G.729B 8kbps"); | 6086 | strcpy(j->caplist[j->caps].desc, "G.729B 8kbps"); |
6069 | j->caplist[j->caps].captype = codec; | 6087 | j->caplist[j->caps].captype = codec; |
6070 | j->caplist[j->caps].cap = G729B; | 6088 | j->caplist[j->caps].cap = G729B; |
6071 | j->caplist[j->caps].handle = j->caps++; | 6089 | j->caplist[j->caps].handle = j->caps; |
6090 | j->caps++; | ||
6072 | } | 6091 | } |
6073 | } | 6092 | } |
6074 | 6093 | ||