All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] block, sx8: fix pointer math issue getting fw version
Date: Sat, 03 Mar 2012 08:04:49 +0000	[thread overview]
Message-ID: <20120303080449.GK22598@mwanda> (raw)
In-Reply-To: <4F51C18C.5080903@kernel.dk>

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Sat, Mar 03, 2012 at 08:00:28AM +0100, Jens Axboe wrote:
> On 2012-03-03 07:58, Jens Axboe wrote:
> > On 2012-03-02 20:00, Dan Carpenter wrote:
> >> "mem" is type u8.  We need parenthesis here or it screws up the pointer
> >> math probably leading to an oops.
> > 
> > Applied, thanks Dan. I have marked it stable, too.
> 
> Hmm wait Dan, seems to me that u8 pointer math should be equiv to char *
> pointer math and hence it'd work just fine. Are you sure this is a bug?

It's the cast on the line before is what breaks it.  We need the
parentheses so we add first then cast the result.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] block, sx8: fix pointer math issue getting fw version
Date: Sat, 3 Mar 2012 11:04:49 +0300	[thread overview]
Message-ID: <20120303080449.GK22598@mwanda> (raw)
In-Reply-To: <4F51C18C.5080903@kernel.dk>

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Sat, Mar 03, 2012 at 08:00:28AM +0100, Jens Axboe wrote:
> On 2012-03-03 07:58, Jens Axboe wrote:
> > On 2012-03-02 20:00, Dan Carpenter wrote:
> >> "mem" is type u8.  We need parenthesis here or it screws up the pointer
> >> math probably leading to an oops.
> > 
> > Applied, thanks Dan. I have marked it stable, too.
> 
> Hmm wait Dan, seems to me that u8 pointer math should be equiv to char *
> pointer math and hence it'd work just fine. Are you sure this is a bug?

It's the cast on the line before is what breaks it.  We need the
parentheses so we add first then cast the result.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-03-03  8:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 19:00 [patch] block, sx8: fix pointer math issue getting fw version Dan Carpenter
2012-03-02 19:00 ` Dan Carpenter
2012-03-03  6:58 ` Jens Axboe
2012-03-03  6:58   ` Jens Axboe
2012-03-03  7:00   ` Jens Axboe
2012-03-03  7:00     ` Jens Axboe
2012-03-03  8:04     ` Dan Carpenter [this message]
2012-03-03  8:04       ` Dan Carpenter
2012-03-03 11:08       ` Jens Axboe
2012-03-03 11:08         ` Jens Axboe
2012-03-03 17:10   ` Jeff Garzik
2012-03-03 17:10     ` Jeff Garzik
2012-03-03 18:44     ` Jens Axboe
2012-03-03 18:44       ` Jens Axboe

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=20120303080449.GK22598@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=jgarzik@pobox.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.