Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1481048
| From | Julia Lawall <julia.lawall@lip6.fr> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 10/26] tpm: constify local structures |
| Date | 2016-09-12 10:50 +0200 |
| Message-ID | <sgv6a-So-3@gated-at.bofh.it> (permalink) |
| References | <sgcZz-6F5-5@gated-at.bofh.it> <sgd9h-6Ig-47@gated-at.bofh.it> <sggA9-xs-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
> >
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[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
csiph-web