From: Julia Lawall <julia.lawall@lip6.fr>
To: HighPoint Linux Team <linux@highpoint-tech.com>
Cc: joe@perches.com, kernel-janitors@vger.kernel.org,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 12/26] [SCSI] hptiop: constify local structures
Date: Mon, 12 Sep 2016 14:35:12 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1609121434020.3049@hadrien> (raw)
In-Reply-To: <1473599168-30561-13-git-send-email-Julia.Lawall@lip6.fr>
On Sun, 11 Sep 2016, Julia Lawall wrote:
> For structure types defined in the same file or local header files, find
> top-level static structure declarations that have the following
> properties:
> 1. Never reassigned.
> 2. Address never taken
> 3. Not passed to a top-level macro call
> 4. No pointer or array-typed field passed to a function or stored in a
> variable.
> Declare structures having all of these properties as const.
Actually, this patch should be dropped. Coccinelle did not recognize
kernel_ulong_t as a type, so it considered eg
(kernel_ulong_t)&hptiop_itl_ops
as a bit and operation.
julia
> Done using Coccinelle.
> Based on a suggestion by Joe Perches <joe@perches.com>.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> The semantic patch seems too long for a commit log, but is in the cover
> letter.
>
> drivers/scsi/hptiop.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
> index a83f705..358732d 100644
> --- a/drivers/scsi/hptiop.c
> +++ b/drivers/scsi/hptiop.c
> @@ -1590,7 +1590,7 @@ static void hptiop_remove(struct pci_dev *pcidev)
> scsi_host_put(host);
> }
>
> -static struct hptiop_adapter_ops hptiop_itl_ops = {
> +static const struct hptiop_adapter_ops hptiop_itl_ops = {
> .family = INTEL_BASED_IOP,
> .iop_wait_ready = iop_wait_ready_itl,
> .internal_memalloc = hptiop_internal_memalloc_itl,
> @@ -1609,7 +1609,7 @@ static struct hptiop_adapter_ops hptiop_itl_ops = {
> .host_phy_flag = cpu_to_le64(0),
> };
>
> -static struct hptiop_adapter_ops hptiop_mv_ops = {
> +static const struct hptiop_adapter_ops hptiop_mv_ops = {
> .family = MV_BASED_IOP,
> .iop_wait_ready = iop_wait_ready_mv,
> .internal_memalloc = hptiop_internal_memalloc_mv,
> @@ -1628,7 +1628,7 @@ static struct hptiop_adapter_ops hptiop_mv_ops = {
> .host_phy_flag = cpu_to_le64(0),
> };
>
> -static struct hptiop_adapter_ops hptiop_mvfrey_ops = {
> +static const struct hptiop_adapter_ops hptiop_mvfrey_ops = {
> .family = MVFREY_BASED_IOP,
> .iop_wait_ready = iop_wait_ready_mvfrey,
> .internal_memalloc = hptiop_internal_memalloc_mvfrey,
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2016-09-12 12:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-11 13:05 [PATCH 00/26] constify local structures Julia Lawall
2016-09-11 13:05 ` [PATCH 12/26] [SCSI] hptiop: " Julia Lawall
2016-09-12 12:35 ` Julia Lawall [this message]
2016-09-11 13:06 ` [PATCH 22/26] esas2r: " Julia Lawall
[not found] ` <1473599168-30561-1-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
2016-09-11 17:21 ` [PATCH 00/26] " Jarkko Sakkinen
2016-09-12 8:54 ` Julia Lawall
2016-09-12 13:16 ` Jarkko Sakkinen
2016-09-12 13:23 ` Julia Lawall
2016-09-12 13:43 ` Felipe Balbi
2016-09-12 13:52 ` Julia Lawall
2016-09-12 18:50 ` Jarkko Sakkinen
2016-09-12 13:57 ` Geert Uytterhoeven
2016-09-12 20:14 ` Jarkko Sakkinen
2016-09-12 21:11 ` Julia Lawall
2016-09-11 17:56 ` Joe Perches
2016-09-11 19:11 ` Julia Lawall
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=alpine.DEB.2.10.1609121434020.3049@hadrien \
--to=julia.lawall@lip6.fr \
--cc=jejb@linux.vnet.ibm.com \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@highpoint-tech.com \
--cc=martin.petersen@oracle.com \
/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