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


Groups > linux.kernel > #1480845

Re: [PATCH 00/26] constify local structures

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 00/26] constify local structures
Date 2016-09-11 20:00 +0200
Message-ID <sghcS-Kv-3@gated-at.bofh.it> (permalink)
References <sgcZz-6F5-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, 2016-09-11 at 15:05 +0200, Julia Lawall wrote:
> Constify local structures.

Thanks Julia.

A few suggestions & questions:

Perhaps the script should go into scripts/coccinelle/
so that future cases could be caught by the robot
and commit message referenced by the patch instances.

Can you please compile the files modified using the
appropriate defconfig/allyesconfig and show the
movement from data to const by using
	$ size <object>.new/old
and include that in the changelogs (maybe next time)?

Is it possible for a rule to trace the instances where
an address of a struct or struct member is taken by
locally defined and declared function call where the
callee does not modify any dereferenced object?

ie:

struct foo {
	int bar;
	char *baz;
};

struct foo qux[] = {
	{ 1, "description 1" },
	{ 2, "dewcription 2" },
	[ n, "etc" ]...,
};

void message(struct foo *msg)
{
	printk("%d %s\n", msg->bar, msg->baz);
}

where some code uses

	message(qux[index]);

So could a coccinelle script change:

struct foo qux[] = { to const struct foo quz[] = {

and

void message(struct foo *msg) to void message(const struct foo *msg)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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