public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom•net>
To: Julia Lawall <julia@diku•dk>
Cc: kernel-janitors@vger•kernel.org, linux-kernel@vger•kernel.org,
	linux-i2c@vger•kernel.org,
	"Ben Dooks \(embedded platforms\)" <ben-linux@fluff•org>,
	"Jean Delvare \(PC drivers, core\)" <khali@linux-fr•org>,
	linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH 4/8] drivers/i2c/busses/i2c-pasemi.c: Fix unsigned return type
Date: Mon, 6 Sep 2010 11:30:44 -0500	[thread overview]
Message-ID: <20100906163044.GA14188@lixom.net> (raw)
In-Reply-To: <1283713226-8429-5-git-send-email-julia@diku.dk>

On Sun, Sep 05, 2010 at 09:00:22PM +0200, Julia Lawall wrote:
> The function has an unsigned return type, but returns a negative constant
> to indicate an error condition.  The result of calling the function is
> always stored in a variable of type (signed) int, and thus unsigned can be
> dropped from the return type.
> 
> A sematic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @exists@
> identifier f;
> constant C;
> @@
> 
>  unsigned f(...)
>  { <+...
> *  return -C;
>  ...+> }
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku•dk>

Acked-by: Olof Johansson <olof@lixom•net>

      reply	other threads:[~2010-09-06 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1283713226-8429-1-git-send-email-julia@diku.dk>
2010-09-05 19:00 ` [PATCH 4/8] drivers/i2c/busses/i2c-pasemi.c: Fix unsigned return type Julia Lawall
2010-09-06 16:30   ` Olof Johansson [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=20100906163044.GA14188@lixom.net \
    --to=olof@lixom$(echo .)net \
    --cc=ben-linux@fluff$(echo .)org \
    --cc=julia@diku$(echo .)dk \
    --cc=kernel-janitors@vger$(echo .)kernel.org \
    --cc=khali@linux-fr$(echo .)org \
    --cc=linux-i2c@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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