Messages in this thread | | | Subject | Re: [PATCH 12/15] ixj: fix Wsequence-point compiler warnings | From | Joe Perches <> | Date | Mon, 30 Jan 2012 08:01:51 -0800 |
| |
On Mon, 2012-01-30 at 15:40 +0100, Danny Kukawka wrote: > Fix some Wsequence-point compiler warnings in ixj. > > Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> > --- > drivers/telephony/ixj.c | 194 ++++++++++++++++++++++++++--------------------- > 1 files changed, 107 insertions(+), 87 deletions(-) > > diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c > index d5f923b..7d02cae 100644 > --- a/drivers/telephony/ixj.c > +++ b/drivers/telephony/ixj.c > @@ -5923,35 +5923,38 @@ static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE __user * cp) > > static void add_caps(IXJ *j) > { > - j->caps = 0; > - j->caplist[j->caps].cap = PHONE_VENDOR_QUICKNET; > - strcpy(j->caplist[j->caps].desc, "Quicknet Technologies, Inc. (www.quicknet.net)"); > - j->caplist[j->caps].captype = vendor; > - j->caplist[j->caps].handle = j->caps++; > - j->caplist[j->caps].captype = device; > + int i = 0; > + j->caplist[i].cap = PHONE_VENDOR_QUICKNET;
I think this would be much simpler with a pointer use for j->caplist[i]
struct whatever_typeof caplist *p = j->caplist;
p->cap = PHONE_VENDOR_QUICKNET; strlcpy(p->desc, "Quicknet etc...", sizeof(p->desc)); p->captype = vendor; ... p++;
| |