All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Miller <mike.miller@hp.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: "kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	ISS StorageDev <iss_storagedev@hp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers/block/cciss.c: correct size computation
Date: Mon, 23 Apr 2012 15:08:21 +0000	[thread overview]
Message-ID: <4F957065.60308@hp.com> (raw)
In-Reply-To: <1335017299-30356-1-git-send-email-Julia.Lawall@lip6.fr>

On 04/21/2012 09:08 AM, Julia Lawall wrote:
> From: Julia Lawall<Julia.Lawall@lip6.fr>
>
> The size argument to remap_pci_mem should be the size of desired structure,
> not the pointer to it.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> //<smpl>
> @expression@
> expression *x;
> @@
>
> x >   <+...
> -sizeof(x)
> +sizeof(*x)
> ...+>
> //</smpl>
>
> Signed-off-by: Julia Lawall<Julia.Lawall@lip6.fr>
Acked-by: Mike Miller <mike.miller@hp.com>
>
> ---
>   drivers/block/cciss.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index b0f553b..9f50d7d 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -4209,7 +4209,7 @@ static int __devinit cciss_find_cfgtables(ctlr_info_t *h)
>   	if (rc)
>   		return rc;
>   	h->cfgtable = remap_pci_mem(pci_resource_start(h->pdev,
> -		cfg_base_addr_index) + cfg_offset, sizeof(h->cfgtable));
> +		cfg_base_addr_index) + cfg_offset, sizeof(*h->cfgtable));
>   	if (!h->cfgtable)
>   		return -ENOMEM;
>   	rc = write_driver_ver_to_cfgtable(h->cfgtable);
>


WARNING: multiple messages have this Message-ID (diff)
From: Mike Miller <mike.miller@hp.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: "kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	ISS StorageDev <iss_storagedev@hp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers/block/cciss.c: correct size computation
Date: Mon, 23 Apr 2012 10:08:21 -0500	[thread overview]
Message-ID: <4F957065.60308@hp.com> (raw)
In-Reply-To: <1335017299-30356-1-git-send-email-Julia.Lawall@lip6.fr>

On 04/21/2012 09:08 AM, Julia Lawall wrote:
> From: Julia Lawall<Julia.Lawall@lip6.fr>
>
> The size argument to remap_pci_mem should be the size of desired structure,
> not the pointer to it.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> //<smpl>
> @expression@
> expression *x;
> @@
>
> x =
>   <+...
> -sizeof(x)
> +sizeof(*x)
> ...+>
> //</smpl>
>
> Signed-off-by: Julia Lawall<Julia.Lawall@lip6.fr>
Acked-by: Mike Miller <mike.miller@hp.com>
>
> ---
>   drivers/block/cciss.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index b0f553b..9f50d7d 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -4209,7 +4209,7 @@ static int __devinit cciss_find_cfgtables(ctlr_info_t *h)
>   	if (rc)
>   		return rc;
>   	h->cfgtable = remap_pci_mem(pci_resource_start(h->pdev,
> -		cfg_base_addr_index) + cfg_offset, sizeof(h->cfgtable));
> +		cfg_base_addr_index) + cfg_offset, sizeof(*h->cfgtable));
>   	if (!h->cfgtable)
>   		return -ENOMEM;
>   	rc = write_driver_ver_to_cfgtable(h->cfgtable);
>


  reply	other threads:[~2012-04-23 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21 14:08 [PATCH] drivers/block/cciss.c: correct size computation Julia Lawall
2012-04-21 14:08 ` Julia Lawall
2012-04-23 15:08 ` Mike Miller [this message]
2012-04-23 15:08   ` Mike Miller

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=4F957065.60308@hp.com \
    --to=mike.miller@hp.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=iss_storagedev@hp.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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 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.