From patchwork Wed Nov 25 16:24:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 332745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6793C64E7D for ; Wed, 25 Nov 2020 16:25:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 922E2206F7 for ; Wed, 25 Nov 2020 16:25:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IlCZ9p62" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731088AbgKYQZa (ORCPT ); Wed, 25 Nov 2020 11:25:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730835AbgKYQZ3 (ORCPT ); Wed, 25 Nov 2020 11:25:29 -0500 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B606C0613D4; Wed, 25 Nov 2020 08:25:29 -0800 (PST) Received: by mail-lf1-x142.google.com with SMTP id s30so3965131lfc.4; Wed, 25 Nov 2020 08:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wB6l0ia6oMI14k/Xdxb+u2Q0ubtDmL3njdY+HNE16RA=; b=IlCZ9p62aWxMwiUtQcqX9pwU5Zhxt1PXMgi6VRUw/mN+wM9S8ndgGf7NZYc5C2KagF shLcXba3o8peJ09ZDaL2nWZ6Oa+qgkJSJXcF6sS6DUrv711h3HuxscSfEPsZO6Q6HOWt Ofw4ZIFp7bVPaiSWNQhh6C2+hfiSJ2AKBKio3ARm1aCJdaYi3Ptm6xu8969eA7GxUG3k 9qs0zCey1pg783SzJ8zTYQnb5aX/Hm3p8WfzNNMeXlc/eWleywl/5NQGiDDObt+1TM3s u+UTOMvysepu6SiZsOzspQhOBC3XaMJhi47ksLG9rO3BXyzEaS/afi7tTxjyubdy6syo bh7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wB6l0ia6oMI14k/Xdxb+u2Q0ubtDmL3njdY+HNE16RA=; b=dRAxaRJumWqEFsJnPD8fjdwZzMBGTe2soFl1FKS88laEejNqLaiVHUHgu+t5us5dSX +r3J46ptV7yXFKXu56+76H9+EHUF5/YW7NdarENPtAvac4u8gRlKsNKFeslX//9ALpel 2Ys/Tsn2BhyQq0jW0b9b94eGVhUX5tpm9Z3R1gHFo40E7ROWMrERrg+XFlAvCXY3zlyW tePp1H7F/b50GO/Zl1YXWrdHjdCCDEjRSm28podQf0OTkYZgW//MZ0PsPqNlFKNwCGVy nlNBumJL32zHsS1LlJAUbhny+uEszNS7KzQiUlas8Npv9bf/rlB7ZMl6klMhYkRl/09s 2V0A== X-Gm-Message-State: AOAM530Ibwt8/bozzIlw6aKYsMvwzssyU6v6k9p6u9/E+SqlMdEG91Nm z9iSXEVPRACrDDTjrO7PN3k= X-Google-Smtp-Source: ABdhPJyo6UdUJYI9d8PaWjXlgPAOTbY0ki4HORNYAwatV05muFNseDojTkZ0ITNZ1ZsAR5Kgoc+ojA== X-Received: by 2002:a19:4293:: with SMTP id p141mr1623511lfa.591.1606321527714; Wed, 25 Nov 2020 08:25:27 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-6.NA.cust.bahnhof.se. [158.174.22.6]) by smtp.gmail.com with ESMTPSA id z131sm313881lfc.56.2020.11.25.08.25.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 08:25:26 -0800 (PST) From: Rikard Falkeborn To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn , Alan Stern , Eugeniu Rosca , chenqiwu , Zeng Tao Subject: [PATCH 1/3] USB: core: Constify static attribute_group structs Date: Wed, 25 Nov 2020 17:24:58 +0100 Message-Id: <20201125162500.37228-2-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201125162500.37228-1-rikard.falkeborn@gmail.com> References: <20201125162500.37228-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org These are never modified, so make them const to allow the compiler to put them in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/usb/core/endpoint.c | 2 +- drivers/usb/core/port.c | 4 ++-- drivers/usb/core/sysfs.c | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 1c2c04079676..903426b6d305 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -153,7 +153,7 @@ static struct attribute *ep_dev_attrs[] = { &dev_attr_direction.attr, NULL, }; -static struct attribute_group ep_dev_attr_grp = { +static const struct attribute_group ep_dev_attr_grp = { .attrs = ep_dev_attrs, }; static const struct attribute_group *ep_dev_groups[] = { diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 235a7c645503..dfcca9c876c7 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -155,7 +155,7 @@ static struct attribute *port_dev_attrs[] = { NULL, }; -static struct attribute_group port_dev_attr_grp = { +static const struct attribute_group port_dev_attr_grp = { .attrs = port_dev_attrs, }; @@ -169,7 +169,7 @@ static struct attribute *port_dev_usb3_attrs[] = { NULL, }; -static struct attribute_group port_dev_usb3_attr_grp = { +static const struct attribute_group port_dev_usb3_attr_grp = { .attrs = port_dev_usb3_attrs, }; diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 8d134193fa0c..d85699bee671 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -641,7 +641,7 @@ static struct attribute *usb2_hardware_lpm_attr[] = { &dev_attr_usb2_lpm_besl.attr, NULL, }; -static struct attribute_group usb2_hardware_lpm_attr_group = { +static const struct attribute_group usb2_hardware_lpm_attr_group = { .name = power_group_name, .attrs = usb2_hardware_lpm_attr, }; @@ -651,7 +651,7 @@ static struct attribute *usb3_hardware_lpm_attr[] = { &dev_attr_usb3_hardware_lpm_u2.attr, NULL, }; -static struct attribute_group usb3_hardware_lpm_attr_group = { +static const struct attribute_group usb3_hardware_lpm_attr_group = { .name = power_group_name, .attrs = usb3_hardware_lpm_attr, }; @@ -663,7 +663,7 @@ static struct attribute *power_attrs[] = { &dev_attr_active_duration.attr, NULL, }; -static struct attribute_group power_attr_group = { +static const struct attribute_group power_attr_group = { .name = power_group_name, .attrs = power_attrs, }; @@ -832,7 +832,7 @@ static struct attribute *dev_attrs[] = { #endif NULL, }; -static struct attribute_group dev_attr_grp = { +static const struct attribute_group dev_attr_grp = { .attrs = dev_attrs, }; @@ -865,7 +865,7 @@ static umode_t dev_string_attrs_are_visible(struct kobject *kobj, return a->mode; } -static struct attribute_group dev_string_attr_grp = { +static const struct attribute_group dev_string_attr_grp = { .attrs = dev_string_attrs, .is_visible = dev_string_attrs_are_visible, }; @@ -1222,7 +1222,7 @@ static struct attribute *intf_attrs[] = { &dev_attr_interface_authorized.attr, NULL, }; -static struct attribute_group intf_attr_grp = { +static const struct attribute_group intf_attr_grp = { .attrs = intf_attrs, }; @@ -1246,7 +1246,7 @@ static umode_t intf_assoc_attrs_are_visible(struct kobject *kobj, return a->mode; } -static struct attribute_group intf_assoc_attr_grp = { +static const struct attribute_group intf_assoc_attr_grp = { .attrs = intf_assoc_attrs, .is_visible = intf_assoc_attrs_are_visible, }; From patchwork Wed Nov 25 16:24:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 332744 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E112C8301A for ; Wed, 25 Nov 2020 16:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48D862067C for ; Wed, 25 Nov 2020 16:26:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mFSsVZfb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731137AbgKYQZc (ORCPT ); Wed, 25 Nov 2020 11:25:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730835AbgKYQZb (ORCPT ); Wed, 25 Nov 2020 11:25:31 -0500 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1548C0613D4; Wed, 25 Nov 2020 08:25:30 -0800 (PST) Received: by mail-lf1-x142.google.com with SMTP id a9so3975567lfh.2; Wed, 25 Nov 2020 08:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OzTWfOWBCqlCat4/nCyb0xyciAZ4J6U15v/8EY+RcY0=; b=mFSsVZfbx4WCsqwgF4fnF4uGqk0sZmO3iK5+y6aM/SC6WjJTiRjKGaI8bYqVUw6jMc YaCXuNNoVO/+NdFXUHLC1KokGK3e9Ipl+NvwXbkaNIGcKmJTWQe3qnd0F6ox4dgE+Xr1 DjejSzCx02TPgfoTeKQRP/0VV5L3YO1xJFYgD4SWCRGqLRR1YwB2J42SHCea6NQtTkZf Qq0ak5qlfML9BpCa9TOXdZK2Y8geO/AMUQ3PcOyfCxsQ4KJz2/9b5p1JhaxDgi7We3C2 8V8SkUy8RWcc6+3Fh9cRpzms0r5ThBAFSSohDfaY50a75WZDYVJYji5VYx5KAJXhaXlM oJlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OzTWfOWBCqlCat4/nCyb0xyciAZ4J6U15v/8EY+RcY0=; b=HN1+VYJK1QMG8+kbKhpEI7UwWtzdFAGB3w7OaF0T77QXbrSI5SyDA10i285FNhOZ0y 5izXfShpvwipVqJFD0FYz++QF/9xmn5vI4s5Ile7N5CS9MbBUXME6Mp3Hc+ruCp1gYSn 0z5trIL5dLX4gKimI5U/y4d4eHe69+Uog6uXuw7eGWirFB8hfSDvemK3qQ32czZ8eqbi 60NQzar3H/QwgHLrsxQO0uFRv15jsqTIqGqLytPK1AgtXpDnz+2kS8hpz1jVf/yuYCPR xkoxDXDGZl9ArcRjs3Jbe8xHnCkb3LqC5Zk5eNB5P8urRkQ0QE4gYA3Oep70od9pdK+x kDJw== X-Gm-Message-State: AOAM532g8mrr+Pcr8TM90aQncIlM//pHOK2AZBByvXy/R3kKvPKL7FGk 8Orcx7mDuDpk4ywyUECFUcs= X-Google-Smtp-Source: ABdhPJxPDnnyHI5db/hy6PJ2Fq5m/OaExWjjzkJ/vyPq6xACkGSkYD2FXwlkbTzi79V3j+/KzOAVGQ== X-Received: by 2002:a19:f60e:: with SMTP id x14mr1570779lfe.199.1606321529304; Wed, 25 Nov 2020 08:25:29 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-6.NA.cust.bahnhof.se. [158.174.22.6]) by smtp.gmail.com with ESMTPSA id z131sm313881lfc.56.2020.11.25.08.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 08:25:28 -0800 (PST) From: Rikard Falkeborn To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn , Heikki Krogerus Subject: [PATCH 2/3] usb: typec: Constify static attribute_group structs Date: Wed, 25 Nov 2020 17:24:59 +0100 Message-Id: <20201125162500.37228-3-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201125162500.37228-1-rikard.falkeborn@gmail.com> References: <20201125162500.37228-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org These are never modified, so make them const to allow the compiler to put them in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/usb/typec/class.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index cb1362187a7c..9eaa5ba8d78b 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -384,7 +384,7 @@ static umode_t typec_altmode_attr_is_visible(struct kobject *kobj, return attr->mode; } -static struct attribute_group typec_altmode_group = { +static const struct attribute_group typec_altmode_group = { .is_visible = typec_altmode_attr_is_visible, .attrs = typec_altmode_attrs, }; @@ -574,7 +574,7 @@ static umode_t typec_partner_attr_is_visible(struct kobject *kobj, struct attrib return attr->mode; } -static struct attribute_group typec_partner_group = { +static const struct attribute_group typec_partner_group = { .is_visible = typec_partner_attr_is_visible, .attrs = typec_partner_attrs }; @@ -756,7 +756,7 @@ static umode_t typec_plug_attr_is_visible(struct kobject *kobj, struct attribute return attr->mode; } -static struct attribute_group typec_plug_group = { +static const struct attribute_group typec_plug_group = { .is_visible = typec_plug_attr_is_visible, .attrs = typec_plug_attrs }; @@ -1446,7 +1446,7 @@ static umode_t typec_attr_is_visible(struct kobject *kobj, return attr->mode; } -static struct attribute_group typec_group = { +static const struct attribute_group typec_group = { .is_visible = typec_attr_is_visible, .attrs = typec_attrs, }; From patchwork Wed Nov 25 16:25:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 333423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68A85C64E90 for ; Wed, 25 Nov 2020 16:25:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 114B220789 for ; Wed, 25 Nov 2020 16:25:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jmtMDxB+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731192AbgKYQZd (ORCPT ); Wed, 25 Nov 2020 11:25:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731176AbgKYQZc (ORCPT ); Wed, 25 Nov 2020 11:25:32 -0500 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C249C0613D4; Wed, 25 Nov 2020 08:25:32 -0800 (PST) Received: by mail-lf1-x144.google.com with SMTP id t6so3902468lfl.13; Wed, 25 Nov 2020 08:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jmlCoHVPOl8J4Y5Va4Rv3QYqyzVFu+EFS+LGEEWl1j8=; b=jmtMDxB+HIV04Z/eDaAousylAEXuv8AkDRNVx4h2NfWcRn38W3aOQWqxjKUSGjXwlH eaMSh4+8F9MK/lMpmRmJMRlPQq7urOs0czKUQmf75F/jG27lQGO7UUyThcEtleAMZ5e9 H34MnSYtX8wotXu6fNnWYIOanrYhQiZDX8QMl2Ecu8JXyeSZrRKL1EODhRIlg8h29BD3 0qNnusifor5Nv1TItqEj7Scsfkd9GjqZuWffyUZrUzj7+lJOQ7nhVqsOooCX39a77+oz pxovhmaXW4SEAJoSdKBVQgcSon6TTeglxIAcB6iHEV83j3L1XYQUtCSDZeEGaGNntMg4 0yiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jmlCoHVPOl8J4Y5Va4Rv3QYqyzVFu+EFS+LGEEWl1j8=; b=Y7+kd9XBaRfHSr4CC118ALk9VbfGSFLY46PM0HtdkzOMfxmf//6M6M3NRYLjRqXnXi 1T/5/zhK6EGmEVPdUUPNC3m0VhGG7F3qHIx13QD3R+szu2pX2QlfBYUgfSexFrqNX6yn jlYQRzh3DN82h2k9omVDhvsOO6XJ6NrGA6VY1t3diPUub4twG+wPXAkvaow3M1J5elpX jnjhErkz5iDeNnrBWvJs8R9JdJHuBTKSUXhgIkE/c4y4tPGruN7/wgUiZ6yjybKjX2Av lh/HUaaskcHvvdlziLEzJytf7Jm75ABNv78yoO63DEZOB9z+jUP0ScsRCDSMJtEkG/9d ImmA== X-Gm-Message-State: AOAM530LW2Hj8DsI2zbJMgBYpfFP7ouDqac6eBFETpDVIXSVUXOnliaw mBZJBEue0jbZIjFea6pCWXw= X-Google-Smtp-Source: ABdhPJwObpVG0MMxG1e/+9lWVrL2YTgEGvMaGH4lrX1Vq3qPqqMYofnTMhpCVK0DY80t7ug9Imawug== X-Received: by 2002:a19:c605:: with SMTP id w5mr1594297lff.58.1606321530638; Wed, 25 Nov 2020 08:25:30 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-6.NA.cust.bahnhof.se. [158.174.22.6]) by smtp.gmail.com with ESMTPSA id z131sm313881lfc.56.2020.11.25.08.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 08:25:29 -0800 (PST) From: Rikard Falkeborn To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn , Heikki Krogerus Subject: [PATCH 3/3] usb: common: ulpi: Constify static attribute_group struct Date: Wed, 25 Nov 2020 17:25:00 +0100 Message-Id: <20201125162500.37228-4-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201125162500.37228-1-rikard.falkeborn@gmail.com> References: <20201125162500.37228-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org It is never modified, so make them const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/usb/common/ulpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c index a18d7c4222dd..ce5e6f6711f7 100644 --- a/drivers/usb/common/ulpi.c +++ b/drivers/usb/common/ulpi.c @@ -118,7 +118,7 @@ static struct attribute *ulpi_dev_attrs[] = { NULL }; -static struct attribute_group ulpi_dev_attr_group = { +static const struct attribute_group ulpi_dev_attr_group = { .attrs = ulpi_dev_attrs, };