Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144AbdG1VHS (ORCPT ); Fri, 28 Jul 2017 17:07:18 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:44057 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbdG1VHQ (ORCPT ); Fri, 28 Jul 2017 17:07:16 -0400 X-IronPort-AV: E=Sophos;i="5.40,427,1496095200"; d="scan'208";a="233086935" From: Julia Lawall To: devel@driverdev.osuosl.org Cc: kernel-janitors@vger.kernel.org, greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 00/11] constify hc_driver structures Date: Fri, 28 Jul 2017 22:41:47 +0200 Message-Id: <1501274518-25170-1-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1173 Lines: 53 The hc_driver structure is only passed as the first argument to usb_create_hcd, which is declared as const. Thus the hc_driver structure itself can be const. Done with the help of Coccinelle. // @r disable optional_qualifier@ identifier i; position p; @@ static struct hc_driver i@p = { ... }; @ok1@ identifier r.i; expression e1; position p; @@ usb_create_hcd(&i@p,...) @bad@ position p != {r.p,ok1.p}; identifier r.i; struct hc_driver e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct hc_driver i = { ... }; // --- drivers/staging/greybus/usb.c | 2 +- drivers/usb/c67x00/c67x00-hcd.c | 2 +- drivers/usb/host/hwa-hc.c | 2 +- drivers/usb/host/isp116x-hcd.c | 2 +- drivers/usb/host/isp1362-hcd.c | 2 +- drivers/usb/host/max3421-hcd.c | 2 +- drivers/usb/host/r8a66597-hcd.c | 2 +- drivers/usb/host/sl811-hcd.c | 2 +- drivers/usb/host/u132-hcd.c | 2 +- drivers/usb/host/whci/hcd.c | 2 +- drivers/usb/renesas_usbhs/mod_host.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-)