Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1480788 > unrolled thread

[PATCH 00/26] constify local structures

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2016-09-11 15:30 +0200
Last post2016-09-11 21:20 +0200
Articles 20 on this page of 49 — 12 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/26] constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
    [PATCH 02/26] lib: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
    [PATCH 13/26] [media]: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
    [PATCH 01/26] ALSA: pci: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
      Re: [PATCH 01/26] ALSA: pci: constify local structures Takashi Iwai <tiwai@suse.de> - 2016-09-12 08:20 +0200
    [PATCH 24/26] ACPI / APD: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
      Re: [PATCH 24/26] ACPI / APD: constify local structures "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-09-14 02:50 +0200
    [PATCH 25/26] pch_gbe: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
      Re: [PATCH 25/26] pch_gbe: constify local structures David Miller <davem@davemloft.net> - 2016-09-12 04:50 +0200
        Re: [PATCH 25/26] pch_gbe: constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 11:10 +0200
          Re: [PATCH 25/26] pch_gbe: constify local structures David Miller <davem@davemloft.net> - 2016-09-12 18:40 +0200
      Re: [PATCH 25/26] pch_gbe: constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 14:30 +0200
    [PATCH 22/26] esas2r: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
    [PATCH 21/26] rtlwifi: rtl818x: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:30 +0200
    [PATCH 15/26] platform/chrome: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
    [PATCH 07/26] net/mlx4_core: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
      Re: [PATCH 07/26] net/mlx4_core: constify local structures Leon Romanovsky <leon@kernel.org> - 2016-09-12 07:10 +0200
    [PATCH 05/26] ARCNET: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
      Re: [PATCH 05/26] ARCNET: constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 14:40 +0200
    [PATCH 04/26] matroxfb: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
    [PATCH 18/26] intel_scu_ipc: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
      Re: [PATCH 18/26] intel_scu_ipc: constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 14:40 +0200
    [PATCH 03/26] staging: rtl8192e: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
    [PATCH 11/26] can: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
      Re: [PATCH 11/26] can: constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 14:40 +0200
    [PATCH 08/26] iwlegacy: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
      Re: [PATCH 08/26] iwlegacy: constify local structures Stanislaw Gruszka <sgruszka@redhat.com> - 2016-09-12 13:30 +0200
    [PATCH 17/26] intel_telemetry_debugfs: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
    [PATCH 19/26] intel_pstate: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
      Re: [PATCH 19/26] intel_pstate: constify local structures Viresh Kumar <viresh.kumar@linaro.org> - 2016-09-12 08:50 +0200
        Re: [PATCH 19/26] intel_pstate: constify local structures "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-09-14 03:00 +0200
    [PATCH 10/26] tpm: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
      Re: [PATCH 10/26] tpm: constify local structures Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-11 19:20 +0200
        Re: [PATCH 10/26] tpm: constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 10:50 +0200
      Re: [PATCH 10/26] tpm: constify local structures Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-12 21:30 +0200
    [PATCH 09/26] i40iw: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
    [PATCH 16/26] ezusb: constify local structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-11 15:40 +0200
    Re: [PATCH 00/26] constify local structures Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-11 19:30 +0200
      Re: [PATCH 00/26] constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 11:00 +0200
        Re: [PATCH 00/26] constify local structures Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-12 15:20 +0200
          Re: [PATCH 00/26] constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 15:30 +0200
          Re: [PATCH 00/26] constify local structures Felipe Balbi <felipe.balbi@linux.intel.com> - 2016-09-12 15:50 +0200
            Re: [PATCH 00/26] constify local structures Geert Uytterhoeven <geert@linux-m68k.org> - 2016-09-12 16:00 +0200
            Re: [PATCH 00/26] constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 16:00 +0200
              Re: [PATCH 00/26] constify local structures Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-12 21:00 +0200
            Re: [PATCH 00/26] constify local structures Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-09-12 22:20 +0200
              Re: [PATCH 00/26] constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-12 23:20 +0200
    Re: [PATCH 00/26] constify local structures Joe Perches <joe@perches.com> - 2016-09-11 20:00 +0200
      Re: [PATCH 00/26] constify local structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-11 21:20 +0200

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#1480805 — [PATCH 18/26] intel_scu_ipc: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 18/26] intel_scu_ipc: constify local structures
Message-ID<sgd9g-6Ig-27@gated-at.bofh.it>
In reply to#1480788
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.

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/platform/x86/intel_scu_ipc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index e81daff..257837f 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -72,20 +72,20 @@ struct intel_scu_ipc_pdata_t {
 	u8 irq_mode;
 };
 
-static struct intel_scu_ipc_pdata_t intel_scu_ipc_lincroft_pdata = {
+static const struct intel_scu_ipc_pdata_t intel_scu_ipc_lincroft_pdata = {
 	.i2c_base = 0xff12b000,
 	.i2c_len = 0x10,
 	.irq_mode = 0,
 };
 
 /* Penwell and Cloverview */
-static struct intel_scu_ipc_pdata_t intel_scu_ipc_penwell_pdata = {
+static const struct intel_scu_ipc_pdata_t intel_scu_ipc_penwell_pdata = {
 	.i2c_base = 0xff12b000,
 	.i2c_len = 0x10,
 	.irq_mode = 1,
 };
 
-static struct intel_scu_ipc_pdata_t intel_scu_ipc_tangier_pdata = {
+static const struct intel_scu_ipc_pdata_t intel_scu_ipc_tangier_pdata = {
 	.i2c_base  = 0xff00d000,
 	.i2c_len = 0x10,
 	.irq_mode = 0,

[toc] | [prev] | [next] | [standalone]


#1481224 — Re: [PATCH 18/26] intel_scu_ipc: constify local structures

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-09-12 14:40 +0200
SubjectRe: [PATCH 18/26] intel_scu_ipc: constify local structures
Message-ID<sgyGL-3jx-45@gated-at.bofh.it>
In reply to#1480805

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 didn't recognize
kernel_ulong_t as a type, so it considered that eg

(kernel_ulong_t)&intel_scu_ipc_lincroft_pdata

was 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/platform/x86/intel_scu_ipc.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
> index e81daff..257837f 100644
> --- a/drivers/platform/x86/intel_scu_ipc.c
> +++ b/drivers/platform/x86/intel_scu_ipc.c
> @@ -72,20 +72,20 @@ struct intel_scu_ipc_pdata_t {
>  	u8 irq_mode;
>  };
>
> -static struct intel_scu_ipc_pdata_t intel_scu_ipc_lincroft_pdata = {
> +static const struct intel_scu_ipc_pdata_t intel_scu_ipc_lincroft_pdata = {
>  	.i2c_base = 0xff12b000,
>  	.i2c_len = 0x10,
>  	.irq_mode = 0,
>  };
>
>  /* Penwell and Cloverview */
> -static struct intel_scu_ipc_pdata_t intel_scu_ipc_penwell_pdata = {
> +static const struct intel_scu_ipc_pdata_t intel_scu_ipc_penwell_pdata = {
>  	.i2c_base = 0xff12b000,
>  	.i2c_len = 0x10,
>  	.irq_mode = 1,
>  };
>
> -static struct intel_scu_ipc_pdata_t intel_scu_ipc_tangier_pdata = {
> +static const struct intel_scu_ipc_pdata_t intel_scu_ipc_tangier_pdata = {
>  	.i2c_base  = 0xff00d000,
>  	.i2c_len = 0x10,
>  	.irq_mode = 0,
>
> --
> 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
>

[toc] | [prev] | [next] | [standalone]


#1480806 — [PATCH 03/26] staging: rtl8192e: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 03/26] staging: rtl8192e: constify local structures
Message-ID<sgd9g-6Ig-23@gated-at.bofh.it>
In reply to#1480788
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.

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/staging/rtl8192e/rtl8192e/rtl_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index e01fff0..4c30eea 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -38,7 +38,7 @@ static int channels = 0x3fff;
 static char *ifname = "wlan%d";
 
 
-static struct rtl819x_ops rtl819xp_ops = {
+static const struct rtl819x_ops rtl819xp_ops = {
 	.nic_type			= NIC_8192E,
 	.get_eeprom_size		= rtl92e_get_eeprom_size,
 	.init_adapter_variable		= rtl92e_init_variables,

[toc] | [prev] | [next] | [standalone]


#1480807 — [PATCH 11/26] can: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 11/26] can: constify local structures
Message-ID<sgd9g-6Ig-25@gated-at.bofh.it>
In reply to#1480788
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.

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/net/can/c_can/c_can_pci.c |    4 ++--
 drivers/net/can/sja1000/plx_pci.c |   20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
index 7be393c..4bc345d 100644
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -251,14 +251,14 @@ static void c_can_pci_remove(struct pci_dev *pdev)
 	pci_disable_device(pdev);
 }
 
-static struct c_can_pci_data c_can_sta2x11= {
+static const struct c_can_pci_data c_can_sta2x11 = {
 	.type = BOSCH_C_CAN,
 	.reg_align = C_CAN_REG_ALIGN_32,
 	.freq = 52000000, /* 52 Mhz */
 	.bar = 0,
 };
 
-static struct c_can_pci_data c_can_pch = {
+static const struct c_can_pci_data c_can_pch = {
 	.type = BOSCH_C_CAN,
 	.reg_align = C_CAN_REG_32,
 	.freq = 50000000, /* 50 MHz */
diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c
index 3eb7430..59bc378 100644
--- a/drivers/net/can/sja1000/plx_pci.c
+++ b/drivers/net/can/sja1000/plx_pci.c
@@ -170,7 +170,7 @@ struct plx_pci_card_info {
 	void (*reset_func)(struct pci_dev *pdev);
 };
 
-static struct plx_pci_card_info plx_pci_card_info_adlink = {
+static const struct plx_pci_card_info plx_pci_card_info_adlink = {
 	"Adlink PCI-7841/cPCI-7841", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{1, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },
@@ -178,7 +178,7 @@ static struct plx_pci_card_info plx_pci_card_info_adlink = {
 	/* based on PLX9052 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_adlink_se = {
+static const struct plx_pci_card_info plx_pci_card_info_adlink_se = {
 	"Adlink PCI-7841/cPCI-7841 SE", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },
@@ -186,7 +186,7 @@ static struct plx_pci_card_info plx_pci_card_info_adlink_se = {
 	/* based on PLX9052 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_esd200 = {
+static const struct plx_pci_card_info plx_pci_card_info_esd200 = {
 	"esd CAN-PCI/CPCI/PCI104/200", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
@@ -194,7 +194,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd200 = {
 	/* based on PLX9030/9050 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_esd266 = {
+static const struct plx_pci_card_info plx_pci_card_info_esd266 = {
 	"esd CAN-PCI/PMC/266", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
@@ -202,7 +202,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd266 = {
 	/* based on PLX9056 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_esd2000 = {
+static const struct plx_pci_card_info plx_pci_card_info_esd2000 = {
 	"esd CAN-PCIe/2000", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
@@ -210,7 +210,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd2000 = {
 	/* based on PEX8311 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_ixxat = {
+static const struct plx_pci_card_info plx_pci_card_info_ixxat = {
 	"IXXAT PC-I 04/PCI", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x200, 0x80} },
@@ -218,7 +218,7 @@ static struct plx_pci_card_info plx_pci_card_info_ixxat = {
 	/* based on PLX9050 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_marathon_pci = {
+static const struct plx_pci_card_info plx_pci_card_info_marathon_pci = {
 	"Marathon CAN-bus-PCI", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x00, 0x00}, {4, 0x00, 0x00} },
@@ -234,7 +234,7 @@ static struct plx_pci_card_info plx_pci_card_info_marathon_pcie = {
 	/* based on PEX8311 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_tews = {
+static const struct plx_pci_card_info plx_pci_card_info_tews = {
 	"TEWS TECHNOLOGIES TPMC810", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x000, 0x80}, {2, 0x100, 0x80} },
@@ -242,7 +242,7 @@ static struct plx_pci_card_info plx_pci_card_info_tews = {
 	/* based on PLX9030 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_cti = {
+static const struct plx_pci_card_info plx_pci_card_info_cti = {
 	"Connect Tech Inc. CANpro/104-Plus Opto (CRG001)", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{0, 0x00, 0x00}, { {2, 0x000, 0x80}, {2, 0x100, 0x80} },
@@ -250,7 +250,7 @@ static struct plx_pci_card_info plx_pci_card_info_cti = {
 	/* based on PLX9030 */
 };
 
-static struct plx_pci_card_info plx_pci_card_info_elcus = {
+static const struct plx_pci_card_info plx_pci_card_info_elcus = {
 	"Eclus CAN-200-PCI", 2,
 	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
 	{1, 0x00, 0x00}, { {2, 0x00, 0x80}, {3, 0x00, 0x80} },

[toc] | [prev] | [next] | [standalone]


#1481214 — Re: [PATCH 11/26] can: constify local structures

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-09-12 14:40 +0200
SubjectRe: [PATCH 11/26] can: constify local structures
Message-ID<sgyGK-3jx-33@gated-at.bofh.it>
In reply to#1480807

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 interpreted eg

(kernel_ulong_t)&plx_pci_card_info_adlink

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/net/can/c_can/c_can_pci.c |    4 ++--
>  drivers/net/can/sja1000/plx_pci.c |   20 ++++++++++----------
>  2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
> index 7be393c..4bc345d 100644
> --- a/drivers/net/can/c_can/c_can_pci.c
> +++ b/drivers/net/can/c_can/c_can_pci.c
> @@ -251,14 +251,14 @@ static void c_can_pci_remove(struct pci_dev *pdev)
>  	pci_disable_device(pdev);
>  }
>
> -static struct c_can_pci_data c_can_sta2x11= {
> +static const struct c_can_pci_data c_can_sta2x11 = {
>  	.type = BOSCH_C_CAN,
>  	.reg_align = C_CAN_REG_ALIGN_32,
>  	.freq = 52000000, /* 52 Mhz */
>  	.bar = 0,
>  };
>
> -static struct c_can_pci_data c_can_pch = {
> +static const struct c_can_pci_data c_can_pch = {
>  	.type = BOSCH_C_CAN,
>  	.reg_align = C_CAN_REG_32,
>  	.freq = 50000000, /* 50 MHz */
> diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c
> index 3eb7430..59bc378 100644
> --- a/drivers/net/can/sja1000/plx_pci.c
> +++ b/drivers/net/can/sja1000/plx_pci.c
> @@ -170,7 +170,7 @@ struct plx_pci_card_info {
>  	void (*reset_func)(struct pci_dev *pdev);
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_adlink = {
> +static const struct plx_pci_card_info plx_pci_card_info_adlink = {
>  	"Adlink PCI-7841/cPCI-7841", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{1, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },
> @@ -178,7 +178,7 @@ static struct plx_pci_card_info plx_pci_card_info_adlink = {
>  	/* based on PLX9052 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_adlink_se = {
> +static const struct plx_pci_card_info plx_pci_card_info_adlink_se = {
>  	"Adlink PCI-7841/cPCI-7841 SE", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },
> @@ -186,7 +186,7 @@ static struct plx_pci_card_info plx_pci_card_info_adlink_se = {
>  	/* based on PLX9052 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_esd200 = {
> +static const struct plx_pci_card_info plx_pci_card_info_esd200 = {
>  	"esd CAN-PCI/CPCI/PCI104/200", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
> @@ -194,7 +194,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd200 = {
>  	/* based on PLX9030/9050 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_esd266 = {
> +static const struct plx_pci_card_info plx_pci_card_info_esd266 = {
>  	"esd CAN-PCI/PMC/266", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
> @@ -202,7 +202,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd266 = {
>  	/* based on PLX9056 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_esd2000 = {
> +static const struct plx_pci_card_info plx_pci_card_info_esd2000 = {
>  	"esd CAN-PCIe/2000", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
> @@ -210,7 +210,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd2000 = {
>  	/* based on PEX8311 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_ixxat = {
> +static const struct plx_pci_card_info plx_pci_card_info_ixxat = {
>  	"IXXAT PC-I 04/PCI", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x200, 0x80} },
> @@ -218,7 +218,7 @@ static struct plx_pci_card_info plx_pci_card_info_ixxat = {
>  	/* based on PLX9050 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_marathon_pci = {
> +static const struct plx_pci_card_info plx_pci_card_info_marathon_pci = {
>  	"Marathon CAN-bus-PCI", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x00, 0x00}, {4, 0x00, 0x00} },
> @@ -234,7 +234,7 @@ static struct plx_pci_card_info plx_pci_card_info_marathon_pcie = {
>  	/* based on PEX8311 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_tews = {
> +static const struct plx_pci_card_info plx_pci_card_info_tews = {
>  	"TEWS TECHNOLOGIES TPMC810", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x000, 0x80}, {2, 0x100, 0x80} },
> @@ -242,7 +242,7 @@ static struct plx_pci_card_info plx_pci_card_info_tews = {
>  	/* based on PLX9030 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_cti = {
> +static const struct plx_pci_card_info plx_pci_card_info_cti = {
>  	"Connect Tech Inc. CANpro/104-Plus Opto (CRG001)", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{0, 0x00, 0x00}, { {2, 0x000, 0x80}, {2, 0x100, 0x80} },
> @@ -250,7 +250,7 @@ static struct plx_pci_card_info plx_pci_card_info_cti = {
>  	/* based on PLX9030 */
>  };
>
> -static struct plx_pci_card_info plx_pci_card_info_elcus = {
> +static const struct plx_pci_card_info plx_pci_card_info_elcus = {
>  	"Eclus CAN-200-PCI", 2,
>  	PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
>  	{1, 0x00, 0x00}, { {2, 0x00, 0x80}, {3, 0x00, 0x80} },
>
> --
> 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
>

[toc] | [prev] | [next] | [standalone]


#1480808 — [PATCH 08/26] iwlegacy: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 08/26] iwlegacy: constify local structures
Message-ID<sgd9g-6Ig-29@gated-at.bofh.it>
In reply to#1480788
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.

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/net/wireless/intel/iwlegacy/3945.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlegacy/3945.c b/drivers/net/wireless/intel/iwlegacy/3945.c
index 209dc99..4db327a 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945.c
@@ -2671,7 +2671,7 @@ const struct il_ops il3945_ops = {
 	.send_led_cmd = il3945_send_led_cmd,
 };
 
-static struct il_cfg il3945_bg_cfg = {
+static const struct il_cfg il3945_bg_cfg = {
 	.name = "3945BG",
 	.fw_name_pre = IL3945_FW_PRE,
 	.ucode_api_max = IL3945_UCODE_API_MAX,
@@ -2700,7 +2700,7 @@ static struct il_cfg il3945_bg_cfg = {
 	},
 };
 
-static struct il_cfg il3945_abg_cfg = {
+static const struct il_cfg il3945_abg_cfg = {
 	.name = "3945ABG",
 	.fw_name_pre = IL3945_FW_PRE,
 	.ucode_api_max = IL3945_UCODE_API_MAX,

[toc] | [prev] | [next] | [standalone]


#1481157 — Re: [PATCH 08/26] iwlegacy: constify local structures

FromStanislaw Gruszka <sgruszka@redhat.com>
Date2016-09-12 13:30 +0200
SubjectRe: [PATCH 08/26] iwlegacy: constify local structures
Message-ID<sgxAZ-2z9-7@gated-at.bofh.it>
In reply to#1480808
On Sun, Sep 11, 2016 at 03:05:50PM +0200, 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.
> 
> Done using Coccinelle.
> Based on a suggestion by Joe Perches <joe@perches.com>.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>

[toc] | [prev] | [next] | [standalone]


#1480809 — [PATCH 17/26] intel_telemetry_debugfs: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 17/26] intel_telemetry_debugfs: constify local structures
Message-ID<sgd9g-6Ig-31@gated-at.bofh.it>
In reply to#1480788
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.

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/platform/x86/intel_telemetry_debugfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c
index ef29f18..d0761f3 100644
--- a/drivers/platform/x86/intel_telemetry_debugfs.c
+++ b/drivers/platform/x86/intel_telemetry_debugfs.c
@@ -297,7 +297,7 @@ struct telemetry_debugfs_conf {
 
 static struct telemetry_debugfs_conf *debugfs_conf;
 
-static struct telemetry_debugfs_conf telem_apl_debugfs_conf = {
+static const struct telemetry_debugfs_conf telem_apl_debugfs_conf = {
 	.pss_idle_data = telem_apl_pss_idle_data,
 	.pcs_idle_blkd_data = telem_apl_pcs_idle_blkd_data,
 	.pcs_s0ix_blkd_data = telem_apl_pcs_s0ix_blkd_data,

[toc] | [prev] | [next] | [standalone]


#1480810 — [PATCH 19/26] intel_pstate: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 19/26] intel_pstate: constify local structures
Message-ID<sgd9g-6Ig-33@gated-at.bofh.it>
In reply to#1480788
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.

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/cpufreq/intel_pstate.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index bdbe936..4b5f8c3 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1029,7 +1029,7 @@ static struct cpu_defaults core_params = {
 	},
 };
 
-static struct cpu_defaults silvermont_params = {
+static const struct cpu_defaults silvermont_params = {
 	.pid_policy = {
 		.sample_rate_ms = 10,
 		.deadband = 0,
@@ -1050,7 +1050,7 @@ static struct cpu_defaults silvermont_params = {
 	},
 };
 
-static struct cpu_defaults airmont_params = {
+static const struct cpu_defaults airmont_params = {
 	.pid_policy = {
 		.sample_rate_ms = 10,
 		.deadband = 0,
@@ -1071,7 +1071,7 @@ static struct cpu_defaults airmont_params = {
 	},
 };
 
-static struct cpu_defaults knl_params = {
+static const struct cpu_defaults knl_params = {
 	.pid_policy = {
 		.sample_rate_ms = 10,
 		.deadband = 0,
@@ -1091,7 +1091,7 @@ static struct cpu_defaults knl_params = {
 	},
 };
 
-static struct cpu_defaults bxt_params = {
+static const struct cpu_defaults bxt_params = {
 	.pid_policy = {
 		.sample_rate_ms = 10,
 		.deadband = 0,

[toc] | [prev] | [next] | [standalone]


#1480955 — Re: [PATCH 19/26] intel_pstate: constify local structures

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-09-12 08:50 +0200
SubjectRe: [PATCH 19/26] intel_pstate: constify local structures
Message-ID<sgte2-8bG-7@gated-at.bofh.it>
In reply to#1480810
On 11-09-16, 15:06, 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.
> 
> 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/cpufreq/intel_pstate.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index bdbe936..4b5f8c3 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1029,7 +1029,7 @@ static struct cpu_defaults core_params = {
>  	},
>  };
>  
> -static struct cpu_defaults silvermont_params = {
> +static const struct cpu_defaults silvermont_params = {
>  	.pid_policy = {
>  		.sample_rate_ms = 10,
>  		.deadband = 0,
> @@ -1050,7 +1050,7 @@ static struct cpu_defaults silvermont_params = {
>  	},
>  };
>  
> -static struct cpu_defaults airmont_params = {
> +static const struct cpu_defaults airmont_params = {
>  	.pid_policy = {
>  		.sample_rate_ms = 10,
>  		.deadband = 0,
> @@ -1071,7 +1071,7 @@ static struct cpu_defaults airmont_params = {
>  	},
>  };
>  
> -static struct cpu_defaults knl_params = {
> +static const struct cpu_defaults knl_params = {
>  	.pid_policy = {
>  		.sample_rate_ms = 10,
>  		.deadband = 0,
> @@ -1091,7 +1091,7 @@ static struct cpu_defaults knl_params = {
>  	},
>  };
>  
> -static struct cpu_defaults bxt_params = {
> +static const struct cpu_defaults bxt_params = {
>  	.pid_policy = {
>  		.sample_rate_ms = 10,
>  		.deadband = 0,

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

[toc] | [prev] | [next] | [standalone]


#1482860 — Re: [PATCH 19/26] intel_pstate: constify local structures

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-09-14 03:00 +0200
SubjectRe: [PATCH 19/26] intel_pstate: constify local structures
Message-ID<sh6Ip-17K-19@gated-at.bofh.it>
In reply to#1480955
On Monday, September 12, 2016 12:12:30 PM Viresh Kumar wrote:
> On 11-09-16, 15:06, 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.
> > 
> > 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/cpufreq/intel_pstate.c |    8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> > index bdbe936..4b5f8c3 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -1029,7 +1029,7 @@ static struct cpu_defaults core_params = {
> >  	},
> >  };
> >  
> > -static struct cpu_defaults silvermont_params = {
> > +static const struct cpu_defaults silvermont_params = {
> >  	.pid_policy = {
> >  		.sample_rate_ms = 10,
> >  		.deadband = 0,
> > @@ -1050,7 +1050,7 @@ static struct cpu_defaults silvermont_params = {
> >  	},
> >  };
> >  
> > -static struct cpu_defaults airmont_params = {
> > +static const struct cpu_defaults airmont_params = {
> >  	.pid_policy = {
> >  		.sample_rate_ms = 10,
> >  		.deadband = 0,
> > @@ -1071,7 +1071,7 @@ static struct cpu_defaults airmont_params = {
> >  	},
> >  };
> >  
> > -static struct cpu_defaults knl_params = {
> > +static const struct cpu_defaults knl_params = {
> >  	.pid_policy = {
> >  		.sample_rate_ms = 10,
> >  		.deadband = 0,
> > @@ -1091,7 +1091,7 @@ static struct cpu_defaults knl_params = {
> >  	},
> >  };
> >  
> > -static struct cpu_defaults bxt_params = {
> > +static const struct cpu_defaults bxt_params = {
> >  	.pid_policy = {
> >  		.sample_rate_ms = 10,
> >  		.deadband = 0,
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied.

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1480812 — [PATCH 10/26] tpm: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 10/26] tpm: constify local structures
Message-ID<sgd9h-6Ig-47@gated-at.bofh.it>
In reply to#1480788
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.

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/char/tpm/tpm-interface.c |   10 +++++-----
 drivers/char/tpm/tpm-sysfs.c     |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 1abe2d7..e84888f 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -633,7 +633,7 @@ EXPORT_SYMBOL_GPL(tpm_get_timeouts);
 #define TPM_ORD_CONTINUE_SELFTEST 83
 #define CONTINUE_SELFTEST_RESULT_SIZE 10
 
-static struct tpm_input_header continue_selftest_header = {
+static const struct tpm_input_header continue_selftest_header = {
 	.tag = TPM_TAG_RQU_COMMAND,
 	.length = cpu_to_be32(10),
 	.ordinal = cpu_to_be32(TPM_ORD_CONTINUE_SELFTEST),
@@ -659,7 +659,7 @@ static int tpm_continue_selftest(struct tpm_chip *chip)
 
 #define TPM_ORDINAL_PCRREAD cpu_to_be32(21)
 #define READ_PCR_RESULT_SIZE 30
-static struct tpm_input_header pcrread_header = {
+static const struct tpm_input_header pcrread_header = {
 	.tag = TPM_TAG_RQU_COMMAND,
 	.length = cpu_to_be32(14),
 	.ordinal = TPM_ORDINAL_PCRREAD
@@ -745,7 +745,7 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read);
  */
 #define TPM_ORD_PCR_EXTEND cpu_to_be32(20)
 #define EXTEND_PCR_RESULT_SIZE 34
-static struct tpm_input_header pcrextend_header = {
+static const struct tpm_input_header pcrextend_header = {
 	.tag = TPM_TAG_RQU_COMMAND,
 	.length = cpu_to_be32(34),
 	.ordinal = TPM_ORD_PCR_EXTEND
@@ -949,7 +949,7 @@ EXPORT_SYMBOL_GPL(wait_for_tpm_stat);
 #define TPM_ORD_SAVESTATE cpu_to_be32(152)
 #define SAVESTATE_RESULT_SIZE 10
 
-static struct tpm_input_header savestate_header = {
+static const struct tpm_input_header savestate_header = {
 	.tag = TPM_TAG_RQU_COMMAND,
 	.length = cpu_to_be32(10),
 	.ordinal = TPM_ORD_SAVESTATE
@@ -1032,7 +1032,7 @@ int tpm_pm_resume(struct device *dev)
 EXPORT_SYMBOL_GPL(tpm_pm_resume);
 
 #define TPM_GETRANDOM_RESULT_SIZE	18
-static struct tpm_input_header tpm_getrandom_header = {
+static const struct tpm_input_header tpm_getrandom_header = {
 	.tag = TPM_TAG_RQU_COMMAND,
 	.length = cpu_to_be32(14),
 	.ordinal = TPM_ORD_GET_RANDOM
diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
index b46cf70..26fccad 100644
--- a/drivers/char/tpm/tpm-sysfs.c
+++ b/drivers/char/tpm/tpm-sysfs.c
@@ -22,7 +22,7 @@
 
 #define READ_PUBEK_RESULT_SIZE 314
 #define TPM_ORD_READPUBEK cpu_to_be32(124)
-static struct tpm_input_header tpm_readpubek_header = {
+static const struct tpm_input_header tpm_readpubek_header = {
 	.tag = TPM_TAG_RQU_COMMAND,
 	.length = cpu_to_be32(30),
 	.ordinal = TPM_ORD_READPUBEK

[toc] | [prev] | [next] | [standalone]


#1480838 — Re: [PATCH 10/26] tpm: constify local structures

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-09-11 19:20 +0200
SubjectRe: [PATCH 10/26] tpm: constify local structures
Message-ID<sggA9-xs-7@gated-at.bofh.it>
In reply to#1480812
On Sun, Sep 11, 2016 at 03:05:52PM +0200, 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.
> 
> Done using Coccinelle.
> Based on a suggestion by Joe Perches <joe@perches.com>.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

To be frank I don't understand (at all) what you are trying to say in
the commit message but change is still for better :)

Can I rephrase the commit message: "Move TPM header structures to the
.rodata section"? It should be obvious why that is for better for
anyone.

Anyway, thanks for the effort.

Acked-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

> ---
> The semantic patch seems too long for a commit log, but is in the cover
> letter.
> 
>  drivers/char/tpm/tpm-interface.c |   10 +++++-----
>  drivers/char/tpm/tpm-sysfs.c     |    2 +-
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index 1abe2d7..e84888f 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -633,7 +633,7 @@ EXPORT_SYMBOL_GPL(tpm_get_timeouts);
>  #define TPM_ORD_CONTINUE_SELFTEST 83
>  #define CONTINUE_SELFTEST_RESULT_SIZE 10
>  
> -static struct tpm_input_header continue_selftest_header = {
> +static const struct tpm_input_header continue_selftest_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(10),
>  	.ordinal = cpu_to_be32(TPM_ORD_CONTINUE_SELFTEST),
> @@ -659,7 +659,7 @@ static int tpm_continue_selftest(struct tpm_chip *chip)
>  
>  #define TPM_ORDINAL_PCRREAD cpu_to_be32(21)
>  #define READ_PCR_RESULT_SIZE 30
> -static struct tpm_input_header pcrread_header = {
> +static const struct tpm_input_header pcrread_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(14),
>  	.ordinal = TPM_ORDINAL_PCRREAD
> @@ -745,7 +745,7 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read);
>   */
>  #define TPM_ORD_PCR_EXTEND cpu_to_be32(20)
>  #define EXTEND_PCR_RESULT_SIZE 34
> -static struct tpm_input_header pcrextend_header = {
> +static const struct tpm_input_header pcrextend_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(34),
>  	.ordinal = TPM_ORD_PCR_EXTEND
> @@ -949,7 +949,7 @@ EXPORT_SYMBOL_GPL(wait_for_tpm_stat);
>  #define TPM_ORD_SAVESTATE cpu_to_be32(152)
>  #define SAVESTATE_RESULT_SIZE 10
>  
> -static struct tpm_input_header savestate_header = {
> +static const struct tpm_input_header savestate_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(10),
>  	.ordinal = TPM_ORD_SAVESTATE
> @@ -1032,7 +1032,7 @@ int tpm_pm_resume(struct device *dev)
>  EXPORT_SYMBOL_GPL(tpm_pm_resume);
>  
>  #define TPM_GETRANDOM_RESULT_SIZE	18
> -static struct tpm_input_header tpm_getrandom_header = {
> +static const struct tpm_input_header tpm_getrandom_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(14),
>  	.ordinal = TPM_ORD_GET_RANDOM
> diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
> index b46cf70..26fccad 100644
> --- a/drivers/char/tpm/tpm-sysfs.c
> +++ b/drivers/char/tpm/tpm-sysfs.c
> @@ -22,7 +22,7 @@
>  
>  #define READ_PUBEK_RESULT_SIZE 314
>  #define TPM_ORD_READPUBEK cpu_to_be32(124)
> -static struct tpm_input_header tpm_readpubek_header = {
> +static const struct tpm_input_header tpm_readpubek_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(30),
>  	.ordinal = TPM_ORD_READPUBEK
> 

[toc] | [prev] | [next] | [standalone]


#1481048 — Re: [PATCH 10/26] tpm: constify local structures

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-09-12 10:50 +0200
SubjectRe: [PATCH 10/26] tpm: constify local structures
Message-ID<sgv6a-So-3@gated-at.bofh.it>
In reply to#1480838

On Sun, 11 Sep 2016, Jarkko Sakkinen wrote:

> On Sun, Sep 11, 2016 at 03:05:52PM +0200, 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.
> >
> > Done using Coccinelle.
> > Based on a suggestion by Joe Perches <joe@perches.com>.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> To be frank I don't understand (at all) what you are trying to say in
> the commit message but change is still for better :)
>
> Can I rephrase the commit message: "Move TPM header structures to the
> .rodata section"? It should be obvious why that is for better for
> anyone.

Sorry.  I tried to explain what strategy I used to ensure the change was
OK.  If you want to change the commit message, then no problem.

julia

>
> Anyway, thanks for the effort.
>
> Acked-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>
> /Jarkko
>
> > ---
> > The semantic patch seems too long for a commit log, but is in the cover
> > letter.
> >
> >  drivers/char/tpm/tpm-interface.c |   10 +++++-----
> >  drivers/char/tpm/tpm-sysfs.c     |    2 +-
> >  2 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> > index 1abe2d7..e84888f 100644
> > --- a/drivers/char/tpm/tpm-interface.c
> > +++ b/drivers/char/tpm/tpm-interface.c
> > @@ -633,7 +633,7 @@ EXPORT_SYMBOL_GPL(tpm_get_timeouts);
> >  #define TPM_ORD_CONTINUE_SELFTEST 83
> >  #define CONTINUE_SELFTEST_RESULT_SIZE 10
> >
> > -static struct tpm_input_header continue_selftest_header = {
> > +static const struct tpm_input_header continue_selftest_header = {
> >  	.tag = TPM_TAG_RQU_COMMAND,
> >  	.length = cpu_to_be32(10),
> >  	.ordinal = cpu_to_be32(TPM_ORD_CONTINUE_SELFTEST),
> > @@ -659,7 +659,7 @@ static int tpm_continue_selftest(struct tpm_chip *chip)
> >
> >  #define TPM_ORDINAL_PCRREAD cpu_to_be32(21)
> >  #define READ_PCR_RESULT_SIZE 30
> > -static struct tpm_input_header pcrread_header = {
> > +static const struct tpm_input_header pcrread_header = {
> >  	.tag = TPM_TAG_RQU_COMMAND,
> >  	.length = cpu_to_be32(14),
> >  	.ordinal = TPM_ORDINAL_PCRREAD
> > @@ -745,7 +745,7 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read);
> >   */
> >  #define TPM_ORD_PCR_EXTEND cpu_to_be32(20)
> >  #define EXTEND_PCR_RESULT_SIZE 34
> > -static struct tpm_input_header pcrextend_header = {
> > +static const struct tpm_input_header pcrextend_header = {
> >  	.tag = TPM_TAG_RQU_COMMAND,
> >  	.length = cpu_to_be32(34),
> >  	.ordinal = TPM_ORD_PCR_EXTEND
> > @@ -949,7 +949,7 @@ EXPORT_SYMBOL_GPL(wait_for_tpm_stat);
> >  #define TPM_ORD_SAVESTATE cpu_to_be32(152)
> >  #define SAVESTATE_RESULT_SIZE 10
> >
> > -static struct tpm_input_header savestate_header = {
> > +static const struct tpm_input_header savestate_header = {
> >  	.tag = TPM_TAG_RQU_COMMAND,
> >  	.length = cpu_to_be32(10),
> >  	.ordinal = TPM_ORD_SAVESTATE
> > @@ -1032,7 +1032,7 @@ int tpm_pm_resume(struct device *dev)
> >  EXPORT_SYMBOL_GPL(tpm_pm_resume);
> >
> >  #define TPM_GETRANDOM_RESULT_SIZE	18
> > -static struct tpm_input_header tpm_getrandom_header = {
> > +static const struct tpm_input_header tpm_getrandom_header = {
> >  	.tag = TPM_TAG_RQU_COMMAND,
> >  	.length = cpu_to_be32(14),
> >  	.ordinal = TPM_ORD_GET_RANDOM
> > diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
> > index b46cf70..26fccad 100644
> > --- a/drivers/char/tpm/tpm-sysfs.c
> > +++ b/drivers/char/tpm/tpm-sysfs.c
> > @@ -22,7 +22,7 @@
> >
> >  #define READ_PUBEK_RESULT_SIZE 314
> >  #define TPM_ORD_READPUBEK cpu_to_be32(124)
> > -static struct tpm_input_header tpm_readpubek_header = {
> > +static const struct tpm_input_header tpm_readpubek_header = {
> >  	.tag = TPM_TAG_RQU_COMMAND,
> >  	.length = cpu_to_be32(30),
> >  	.ordinal = TPM_ORD_READPUBEK
> >
>

[toc] | [prev] | [next] | [standalone]


#1481895 — Re: [PATCH 10/26] tpm: constify local structures

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-09-12 21:30 +0200
SubjectRe: [PATCH 10/26] tpm: constify local structures
Message-ID<sgF5w-7Bx-37@gated-at.bofh.it>
In reply to#1480812
On Sun, Sep 11, 2016 at 03:05:52PM +0200, 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.
> 
> Done using Coccinelle.
> Based on a suggestion by Joe Perches <joe@perches.com>.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied to the tip of my tree:

http://git.infradead.org/users/jjs/linux-tpmdd.git/log

Thanks for the good work!

/Jarkko

> 
> ---
> The semantic patch seems too long for a commit log, but is in the cover
> letter.
> 
>  drivers/char/tpm/tpm-interface.c |   10 +++++-----
>  drivers/char/tpm/tpm-sysfs.c     |    2 +-
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index 1abe2d7..e84888f 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -633,7 +633,7 @@ EXPORT_SYMBOL_GPL(tpm_get_timeouts);
>  #define TPM_ORD_CONTINUE_SELFTEST 83
>  #define CONTINUE_SELFTEST_RESULT_SIZE 10
>  
> -static struct tpm_input_header continue_selftest_header = {
> +static const struct tpm_input_header continue_selftest_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(10),
>  	.ordinal = cpu_to_be32(TPM_ORD_CONTINUE_SELFTEST),
> @@ -659,7 +659,7 @@ static int tpm_continue_selftest(struct tpm_chip *chip)
>  
>  #define TPM_ORDINAL_PCRREAD cpu_to_be32(21)
>  #define READ_PCR_RESULT_SIZE 30
> -static struct tpm_input_header pcrread_header = {
> +static const struct tpm_input_header pcrread_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(14),
>  	.ordinal = TPM_ORDINAL_PCRREAD
> @@ -745,7 +745,7 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read);
>   */
>  #define TPM_ORD_PCR_EXTEND cpu_to_be32(20)
>  #define EXTEND_PCR_RESULT_SIZE 34
> -static struct tpm_input_header pcrextend_header = {
> +static const struct tpm_input_header pcrextend_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(34),
>  	.ordinal = TPM_ORD_PCR_EXTEND
> @@ -949,7 +949,7 @@ EXPORT_SYMBOL_GPL(wait_for_tpm_stat);
>  #define TPM_ORD_SAVESTATE cpu_to_be32(152)
>  #define SAVESTATE_RESULT_SIZE 10
>  
> -static struct tpm_input_header savestate_header = {
> +static const struct tpm_input_header savestate_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(10),
>  	.ordinal = TPM_ORD_SAVESTATE
> @@ -1032,7 +1032,7 @@ int tpm_pm_resume(struct device *dev)
>  EXPORT_SYMBOL_GPL(tpm_pm_resume);
>  
>  #define TPM_GETRANDOM_RESULT_SIZE	18
> -static struct tpm_input_header tpm_getrandom_header = {
> +static const struct tpm_input_header tpm_getrandom_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(14),
>  	.ordinal = TPM_ORD_GET_RANDOM
> diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
> index b46cf70..26fccad 100644
> --- a/drivers/char/tpm/tpm-sysfs.c
> +++ b/drivers/char/tpm/tpm-sysfs.c
> @@ -22,7 +22,7 @@
>  
>  #define READ_PUBEK_RESULT_SIZE 314
>  #define TPM_ORD_READPUBEK cpu_to_be32(124)
> -static struct tpm_input_header tpm_readpubek_header = {
> +static const struct tpm_input_header tpm_readpubek_header = {
>  	.tag = TPM_TAG_RQU_COMMAND,
>  	.length = cpu_to_be32(30),
>  	.ordinal = TPM_ORD_READPUBEK
> 

[toc] | [prev] | [next] | [standalone]


#1480814 — [PATCH 09/26] i40iw: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 09/26] i40iw: constify local structures
Message-ID<sgd9h-6Ig-43@gated-at.bofh.it>
In reply to#1480788
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.

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/infiniband/hw/i40iw/i40iw_uk.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/i40iw/i40iw_uk.c b/drivers/infiniband/hw/i40iw/i40iw_uk.c
index 4d28c3c..eb94c03 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_uk.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_uk.c
@@ -918,7 +918,7 @@ enum i40iw_status_code i40iw_get_wqe_shift(u32 wqdepth, u32 sge, u32 inline_data
 	return 0;
 }
 
-static struct i40iw_qp_uk_ops iw_qp_uk_ops = {
+static const struct i40iw_qp_uk_ops iw_qp_uk_ops = {
 	i40iw_qp_post_wr,
 	i40iw_qp_ring_push_db,
 	i40iw_rdma_write,
@@ -932,14 +932,14 @@ static struct i40iw_qp_uk_ops iw_qp_uk_ops = {
 	i40iw_nop
 };
 
-static struct i40iw_cq_ops iw_cq_ops = {
+static const struct i40iw_cq_ops iw_cq_ops = {
 	i40iw_cq_request_notification,
 	i40iw_cq_poll_completion,
 	i40iw_cq_post_entries,
 	i40iw_clean_cq
 };
 
-static struct i40iw_device_uk_ops iw_device_uk_ops = {
+static const struct i40iw_device_uk_ops iw_device_uk_ops = {
 	i40iw_cq_uk_init,
 	i40iw_qp_uk_init,
 };

[toc] | [prev] | [next] | [standalone]


#1480818 — [PATCH 16/26] ezusb: constify local structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-09-11 15:40 +0200
Subject[PATCH 16/26] ezusb: constify local structures
Message-ID<sgd9h-6Ig-53@gated-at.bofh.it>
In reply to#1480788
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.

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/usb/misc/ezusb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/misc/ezusb.c b/drivers/usb/misc/ezusb.c
index 947811b..837208f 100644
--- a/drivers/usb/misc/ezusb.c
+++ b/drivers/usb/misc/ezusb.c
@@ -22,7 +22,7 @@ struct ezusb_fx_type {
 	unsigned short max_internal_adress;
 };
 
-static struct ezusb_fx_type ezusb_fx1 = {
+static const struct ezusb_fx_type ezusb_fx1 = {
 	.cpucs_reg = 0x7F92,
 	.max_internal_adress = 0x1B3F,
 };

[toc] | [prev] | [next] | [standalone]


#1480840

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-09-11 19:30 +0200
Message-ID<sggJP-AW-11@gated-at.bofh.it>
In reply to#1480788
On Sun, Sep 11, 2016 at 03:05:42PM +0200, Julia Lawall wrote:
> Constify local structures.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)

Just my two cents but:

1. You *can* use a static analysis too to find bugs or other issues.
2. However, you should manually do the commits and proper commit
   messages to subsystems based on your findings. And I generally think
   that if one contributes code one should also at least smoke test changes
   somehow.

I don't know if I'm alone with my opinion. I just think that one should
also do the analysis part and not blindly create and submit patches.

Anyway, I'll apply the TPM change at some point. As I said they were
for better. Thanks.

/Jarkko

> // <smpl>
> // The first rule ignores some cases that posed problems
> @r disable optional_qualifier@
> identifier s != {peri_clk_data,threshold_attr,tracer_flags,tracer};
> identifier i != {s5k5baf_cis_rect,smtcfb_fix};
> position p;
> @@
> static struct s i@p = { ... };
> 
> @lstruct@
> identifier r.s;
> @@
> struct s { ... };
> 
> @used depends on lstruct@
> identifier r.i;
> @@
> i
> 
> @bad1@
> expression e;
> identifier r.i;
> assignment operator a;
> @@
>  (<+...i...+>) a e
> 
> @bad2@
> identifier r.i;
> @@
>  &(<+...i...+>)
> 
> @bad3@
> identifier r.i;
> declarer d;
> @@
>  d(...,<+...i...+>,...);
> 
> @bad4@
> identifier r.i;
> type T;
> T[] e;
> identifier f;
> position p;
> @@
> 
> f@p(...,
> (
>   (<+...i...+>)
> &
>   e
> )
> ,...)
> 
> @bad4a@
> identifier r.i;
> type T;
> T *e;
> identifier f;
> position p;
> @@
> 
> f@p(...,
> (
>   (<+...i...+>)
> &
>   e
> )
> ,...)
> 
> @ok5@
> expression *e;
> identifier r.i;
> position p;
> @@
> e =@p i
> 
> @bad5@
> expression *e;
> identifier r.i;
> position p != ok5.p;
> @@
> e =@p (<+...i...+>)
> 
> @rr depends on used && !bad1 && !bad2 && !bad3 && !bad4 && !bad4a && !bad5@
> identifier s,r.i;
> position r.p;
> @@
> 
> static
> +const
>  struct s i@p = { ... };
> 
> @depends on used && !bad1 && !bad2 && !bad3 && !bad4 && !bad4a && !bad5
>  disable optional_qualifier@
> identifier rr.s,r.i;
> @@
> 
> static
> +const
>  struct s i;
> // </smpl>
> 
> ---
> 
>  drivers/acpi/acpi_apd.c                              |    8 +++---
>  drivers/char/tpm/tpm-interface.c                     |   10 ++++----
>  drivers/char/tpm/tpm-sysfs.c                         |    2 -
>  drivers/cpufreq/intel_pstate.c                       |    8 +++---
>  drivers/infiniband/hw/i40iw/i40iw_uk.c               |    6 ++---
>  drivers/media/i2c/tvp514x.c                          |    2 -
>  drivers/media/pci/ddbridge/ddbridge-core.c           |   18 +++++++--------
>  drivers/media/pci/ngene/ngene-cards.c                |   14 ++++++------
>  drivers/media/pci/smipcie/smipcie-main.c             |    8 +++---
>  drivers/misc/sgi-xp/xpc_uv.c                         |    2 -
>  drivers/net/arcnet/com20020-pci.c                    |   10 ++++----
>  drivers/net/can/c_can/c_can_pci.c                    |    4 +--
>  drivers/net/can/sja1000/plx_pci.c                    |   20 ++++++++---------
>  drivers/net/ethernet/mellanox/mlx4/main.c            |    4 +--
>  drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c |    2 -
>  drivers/net/ethernet/renesas/sh_eth.c                |   14 ++++++------
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c     |    2 -
>  drivers/net/wireless/ath/dfs_pattern_detector.c      |    2 -
>  drivers/net/wireless/intel/iwlegacy/3945.c           |    4 +--
>  drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c  |    2 -
>  drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c  |    2 -
>  drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c  |    2 -
>  drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c  |    2 -
>  drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c  |    2 -
>  drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c  |    2 -
>  drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c  |    2 -
>  drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c  |    2 -
>  drivers/platform/chrome/chromeos_laptop.c            |   22 +++++++++----------
>  drivers/platform/x86/intel_scu_ipc.c                 |    6 ++---
>  drivers/platform/x86/intel_telemetry_debugfs.c       |    2 -
>  drivers/scsi/esas2r/esas2r_flash.c                   |    2 -
>  drivers/scsi/hptiop.c                                |    6 ++---
>  drivers/spi/spi-dw-pci.c                             |    4 +--
>  drivers/staging/rtl8192e/rtl8192e/rtl_core.c         |    2 -
>  drivers/usb/misc/ezusb.c                             |    2 -
>  drivers/video/fbdev/matrox/matroxfb_g450.c           |    2 -
>  lib/crc64_ecma.c                                     |    2 -
>  sound/pci/ctxfi/ctatc.c                              |    2 -
>  sound/pci/hda/patch_ca0132.c                         |   10 ++++----
>  sound/pci/riptide/riptide.c                          |    2 -
>  40 files changed, 110 insertions(+), 110 deletions(-)

[toc] | [prev] | [next] | [standalone]


#1481054

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-09-12 11:00 +0200
Message-ID<sgvfP-VS-13@gated-at.bofh.it>
In reply to#1480840

On Sun, 11 Sep 2016, Jarkko Sakkinen wrote:

> On Sun, Sep 11, 2016 at 03:05:42PM +0200, Julia Lawall wrote:
> > Constify local structures.
> >
> > The semantic patch that makes this change is as follows:
> > (http://coccinelle.lip6.fr/)
>
> Just my two cents but:
>
> 1. You *can* use a static analysis too to find bugs or other issues.
> 2. However, you should manually do the commits and proper commit
>    messages to subsystems based on your findings. And I generally think
>    that if one contributes code one should also at least smoke test changes
>    somehow.
>
> I don't know if I'm alone with my opinion. I just think that one should
> also do the analysis part and not blindly create and submit patches.

All of the patches are compile tested.  And the individual patches are
submitted to the relevant maintainers.  The individual commit messages
give a more detailed explanation of the strategy used to decide that the
structure was constifiable.  It seemed redundant to put that in the cover
letter, which will not be committed anyway.

julia

>
> Anyway, I'll apply the TPM change at some point. As I said they were
> for better. Thanks.
>
> /Jarkko
>
> > // <smpl>
> > // The first rule ignores some cases that posed problems
> > @r disable optional_qualifier@
> > identifier s != {peri_clk_data,threshold_attr,tracer_flags,tracer};
> > identifier i != {s5k5baf_cis_rect,smtcfb_fix};
> > position p;
> > @@
> > static struct s i@p = { ... };
> >
> > @lstruct@
> > identifier r.s;
> > @@
> > struct s { ... };
> >
> > @used depends on lstruct@
> > identifier r.i;
> > @@
> > i
> >
> > @bad1@
> > expression e;
> > identifier r.i;
> > assignment operator a;
> > @@
> >  (<+...i...+>) a e
> >
> > @bad2@
> > identifier r.i;
> > @@
> >  &(<+...i...+>)
> >
> > @bad3@
> > identifier r.i;
> > declarer d;
> > @@
> >  d(...,<+...i...+>,...);
> >
> > @bad4@
> > identifier r.i;
> > type T;
> > T[] e;
> > identifier f;
> > position p;
> > @@
> >
> > f@p(...,
> > (
> >   (<+...i...+>)
> > &
> >   e
> > )
> > ,...)
> >
> > @bad4a@
> > identifier r.i;
> > type T;
> > T *e;
> > identifier f;
> > position p;
> > @@
> >
> > f@p(...,
> > (
> >   (<+...i...+>)
> > &
> >   e
> > )
> > ,...)
> >
> > @ok5@
> > expression *e;
> > identifier r.i;
> > position p;
> > @@
> > e =@p i
> >
> > @bad5@
> > expression *e;
> > identifier r.i;
> > position p != ok5.p;
> > @@
> > e =@p (<+...i...+>)
> >
> > @rr depends on used && !bad1 && !bad2 && !bad3 && !bad4 && !bad4a && !bad5@
> > identifier s,r.i;
> > position r.p;
> > @@
> >
> > static
> > +const
> >  struct s i@p = { ... };
> >
> > @depends on used && !bad1 && !bad2 && !bad3 && !bad4 && !bad4a && !bad5
> >  disable optional_qualifier@
> > identifier rr.s,r.i;
> > @@
> >
> > static
> > +const
> >  struct s i;
> > // </smpl>
> >
> > ---
> >
> >  drivers/acpi/acpi_apd.c                              |    8 +++---
> >  drivers/char/tpm/tpm-interface.c                     |   10 ++++----
> >  drivers/char/tpm/tpm-sysfs.c                         |    2 -
> >  drivers/cpufreq/intel_pstate.c                       |    8 +++---
> >  drivers/infiniband/hw/i40iw/i40iw_uk.c               |    6 ++---
> >  drivers/media/i2c/tvp514x.c                          |    2 -
> >  drivers/media/pci/ddbridge/ddbridge-core.c           |   18 +++++++--------
> >  drivers/media/pci/ngene/ngene-cards.c                |   14 ++++++------
> >  drivers/media/pci/smipcie/smipcie-main.c             |    8 +++---
> >  drivers/misc/sgi-xp/xpc_uv.c                         |    2 -
> >  drivers/net/arcnet/com20020-pci.c                    |   10 ++++----
> >  drivers/net/can/c_can/c_can_pci.c                    |    4 +--
> >  drivers/net/can/sja1000/plx_pci.c                    |   20 ++++++++---------
> >  drivers/net/ethernet/mellanox/mlx4/main.c            |    4 +--
> >  drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c |    2 -
> >  drivers/net/ethernet/renesas/sh_eth.c                |   14 ++++++------
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c     |    2 -
> >  drivers/net/wireless/ath/dfs_pattern_detector.c      |    2 -
> >  drivers/net/wireless/intel/iwlegacy/3945.c           |    4 +--
> >  drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c  |    2 -
> >  drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c  |    2 -
> >  drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c  |    2 -
> >  drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c  |    2 -
> >  drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c  |    2 -
> >  drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c  |    2 -
> >  drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c  |    2 -
> >  drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c  |    2 -
> >  drivers/platform/chrome/chromeos_laptop.c            |   22 +++++++++----------
> >  drivers/platform/x86/intel_scu_ipc.c                 |    6 ++---
> >  drivers/platform/x86/intel_telemetry_debugfs.c       |    2 -
> >  drivers/scsi/esas2r/esas2r_flash.c                   |    2 -
> >  drivers/scsi/hptiop.c                                |    6 ++---
> >  drivers/spi/spi-dw-pci.c                             |    4 +--
> >  drivers/staging/rtl8192e/rtl8192e/rtl_core.c         |    2 -
> >  drivers/usb/misc/ezusb.c                             |    2 -
> >  drivers/video/fbdev/matrox/matroxfb_g450.c           |    2 -
> >  lib/crc64_ecma.c                                     |    2 -
> >  sound/pci/ctxfi/ctatc.c                              |    2 -
> >  sound/pci/hda/patch_ca0132.c                         |   10 ++++----
> >  sound/pci/riptide/riptide.c                          |    2 -
> >  40 files changed, 110 insertions(+), 110 deletions(-)
>

[toc] | [prev] | [next] | [standalone]


#1481271

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-09-12 15:20 +0200
Message-ID<sgzjr-3N9-15@gated-at.bofh.it>
In reply to#1481054
On Mon, Sep 12, 2016 at 10:54:07AM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 11 Sep 2016, Jarkko Sakkinen wrote:
> 
> > On Sun, Sep 11, 2016 at 03:05:42PM +0200, Julia Lawall wrote:
> > > Constify local structures.
> > >
> > > The semantic patch that makes this change is as follows:
> > > (http://coccinelle.lip6.fr/)
> >
> > Just my two cents but:
> >
> > 1. You *can* use a static analysis too to find bugs or other issues.
> > 2. However, you should manually do the commits and proper commit
> >    messages to subsystems based on your findings. And I generally think
> >    that if one contributes code one should also at least smoke test changes
> >    somehow.
> >
> > I don't know if I'm alone with my opinion. I just think that one should
> > also do the analysis part and not blindly create and submit patches.
> 
> All of the patches are compile tested.  And the individual patches are

Compile-testing is not testing. If you are not able to test a commit,
you should explain why.

> submitted to the relevant maintainers.  The individual commit messages
> give a more detailed explanation of the strategy used to decide that the
> structure was constifiable.  It seemed redundant to put that in the cover
> letter, which will not be committed anyway.

I don't mean to be harsh but I do not care about your thought process
*that much* when I review a commit (sometimes it might make sense to
explain that but it depends on the context).

I mostly only care why a particular change makes sense for this
particular subsystem. The report given by a static analysis tool can
be a starting point for making a commit but it's not sufficient.
Based on the report you should look subsystems as individuals.

> julia

/Jarkko

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | linux.kernel


csiph-web