Message ID | 1577864614-5543-1-git-send-email-Julia.Lawall@inria.fr (mailing list archive) |
---|---|
Headers |
Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1imZEy-007Qds-By; Wed, 01 Jan 2020 08:20:28 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727082AbgAAIUO (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 1 Jan 2020 03:20:14 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:56955 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgAAIUN (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 1 Jan 2020 03:20:13 -0500 X-IronPort-AV: E=Sophos;i="5.69,382,1571695200"; d="scan'208";a="429578748" Received: from palace.rsr.lip6.fr (HELO palace.lip6.fr) ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256; 01 Jan 2020 09:20:08 +0100 From: Julia Lawall <Julia.Lawall@inria.fr> To: Jernej Skrabec <jernej.skrabec@siol.net> Cc: kernel-janitors@vger.kernel.org, Jonas Karlman <jonas@kwiboo.se>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, linuxppc-dev@lists.ozlabs.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 00/16] constify copied structure Date: Wed, 1 Jan 2020 08:43:18 +0100 Message-Id: <1577864614-5543-1-git-send-email-Julia.Lawall@inria.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Series | constify copied structure | |
Message
Julia Lawall
Jan. 1, 2020, 7:43 a.m. UTC
Make const static structures that are just copied into other structures. The semantic patch that detects the opportunity for this change is as follows: (http://coccinelle.lip6.fr/) <smpl> @r disable optional_qualifier@ identifier i,j; position p; @@ static struct i j@p = { ... }; @upd@ position p1; identifier r.j; expression e; @@ e = j@p1 @ref@ position p2 != {r.p,upd.p1}; identifier r.j; @@ j@p2 @script:ocaml depends on upd && !ref@ i << r.i; j << r.j; p << r.p; @@ if j = (List.hd p).current_element then Coccilib.print_main i p </smpl> --- arch/powerpc/sysdev/mpic.c | 4 ++-- drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c | 2 +- drivers/media/i2c/mt9v111.c | 2 +- drivers/media/platform/davinci/isif.c | 2 +- drivers/media/usb/cx231xx/cx231xx-dvb.c | 2 +- drivers/media/usb/dvb-usb-v2/anysee.c | 4 ++-- drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 2 +- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 2 +- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 2 +- drivers/ptp/ptp_clockmatrix.c | 2 +- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +- drivers/video/fbdev/sa1100fb.c | 2 +- net/sunrpc/xdr.c | 2 +- sound/isa/ad1816a/ad1816a_lib.c | 2 +- sound/pci/hda/hda_controller.c | 2 +- sound/soc/qcom/qdsp6/q6asm-dai.c | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-)