]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
drivers/staging/telephony/ixj.c: fix warning about sequence points
authorUwe Kleine-König <uwe@kleine-koenig.org>
Fri, 23 Mar 2012 22:01:53 +0000 (15:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 23 Mar 2012 23:58:31 +0000 (16:58 -0700)
commit953326cb60c1dff1bd3458d6468d16d75f2bcd61
tree4cf6ed03aeff38847da138f191eea898297a6365
parent9710a78e55fe29fa2d2f1a9cbd1d399797585fd9
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>
drivers/staging/telephony/ixj.c