Re: [PATCH 12/15] ixj: fix Wsequence-point compiler warnings

From: Joe Perches
Date: Mon Jan 30 2012 - 11:02:10 EST


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@xxxxxxxxx>
> ---
> 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++;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/