linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Danny Kukawka <danny.kukawka@bisect.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 12/15] ixj: fix Wsequence-point compiler warnings
Date: Mon, 30 Jan 2012 08:01:51 -0800	[thread overview]
Message-ID: <1327939311.25132.9.camel@joe2Laptop> (raw)
In-Reply-To: <1327934418-12674-13-git-send-email-danny.kukawka@bisect.de>

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



      reply	other threads:[~2012-01-30 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 14:40 [PATCH 00/15] several compiler warning fixes Danny Kukawka
2012-01-30 14:40 ` [PATCH 12/15] ixj: fix Wsequence-point compiler warnings Danny Kukawka
2012-01-30 16:01   ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327939311.25132.9.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=danny.kukawka@bisect.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).