Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp667326pxb; Fri, 8 Jan 2021 15:12:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyu9FKHmMnyQRqphrWzGTX2wkgaYrabQsGyiD+S4pqon/otywbplrhjo/LJWcwH0HZ6B25d X-Received: by 2002:a17:906:c7d9:: with SMTP id dc25mr4220966ejb.138.1610147557989; Fri, 08 Jan 2021 15:12:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610147557; cv=none; d=google.com; s=arc-20160816; b=dMi3Jpf0vmmXKMKn05ZciMtPiW7fTYcWP5uIZMuBE20b03c9+8bXANTXSzxFcIESJo BpEUngFhqRFr4hXM7LIhErSx8sGyDaohFVjOCyUU21swTmoh39N2Cg7MgpAq3tMFkNuq kawA50PGqJzFRXcuCj2I2rrn2+UnpyruGgM5Lk0Em4leA+Hkws/quDSF/rCalpC+nyJp R69BHoJIegZbUgwUIjyHgNn9vGY+daUBN16z/t5Y5Q3B4ljGdCRvGIRQkZ4ZG+v+oEjl 9dqlLua+k7STPzl2mzCNLc21bYJ66Dp0WXZQEzeTYE+qAQRthUALqEqGhoz3maAbBEE2 VPjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QxReFlRL658xHbvF0w+cE6+pBgV0FdWMdR2zg93M1ho=; b=Hi8dYjEiEaQnmEkhvOwT5NHOrJS2fFFoYSYfTlSbH8EgBUnqSpBxynuZ/FKr6XMCu9 qhTJILrTOzTzO2ji20D7VbUZq9jIivTSnn3nBd8bMm5bTBFmym0tVvt5GPdZmWTjtAiK xh/JXcCiW4To1WT+kgpXvO1Ova5ROJ/1pRG3dbcZsoDqWLN/DwUb4NUIR4vtBH5Pwviy dSgXtEVNKwpPgY9BTXSLLvpF+Uj3FU65+ADwYKeSEZ5gQof9jWfCcyF98IwAbIdARCqs wSsqh0zf6ls818oc2pPr5UCsEPztIcHq3jKuQ5Ee0hMWqo9+furGPoJTmU9fusxaz432 Ik+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KFVj7EsO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si3867975edw.463.2021.01.08.15.12.14; Fri, 08 Jan 2021 15:12:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KFVj7EsO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726375AbhAHXKP (ORCPT + 99 others); Fri, 8 Jan 2021 18:10:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbhAHXKP (ORCPT ); Fri, 8 Jan 2021 18:10:15 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88CD7C061574; Fri, 8 Jan 2021 15:09:34 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id m12so26792273lfo.7; Fri, 08 Jan 2021 15:09:34 -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:mime-version :content-transfer-encoding; bh=QxReFlRL658xHbvF0w+cE6+pBgV0FdWMdR2zg93M1ho=; b=KFVj7EsONPRX+yGIGJEUXCf3seHQC1ULt3DEDoRhBXrEIkKUECrTPT69UjjwrpS4cv 4GD0cqlHvWb9YxQ923LrYbrJfRwQDuhaBfRnyAyKpyy5KKTdVpOAD8QOB8ToKg3s1YIP ldP56SJzJpxIy1q3ngaXS6Ffdp23MOBjGlWXV+NMjcehm7HybKBb8QV/0i8zqx6wjF9J 6dWKAq8K7C3vm/0DWEsXF7rMIy9kX3ecEZlZ516K0TFka7CJjn5NhaLVkYdoxzyF0/qo pQ0JZRePMaoxazT1mUOkSYCRdltpw0mGNaxwzcvU6EksyzDK3bhfOIBahTZKGy8CBLCt xhqw== 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:mime-version :content-transfer-encoding; bh=QxReFlRL658xHbvF0w+cE6+pBgV0FdWMdR2zg93M1ho=; b=DhNhUZOvNi1bn7lxuVVMvW22HVS98KWnVBPMLXFk8kiboIkDhdci01QGOzWItj5pI3 7dHi0+rpMdolZLJ/m8/0AQAb1G0T1XkhlTQ7piSrpbhgdVZ8ZueUlrbIfjQuwKIwb+At GnvJSPHoS825srw8mwExHqJxAX+xet+ShdWTE4krEPdEC2zK0G9Wb2n6sh3NuVJrDP2M /HjrsCriM6ttBlqfPVauYA92e/bWu52Utpl6dDpoHM4H2+wp2x/tyO0yr3FXqB0PW47w zO+YE8eJN5Q8J6JXzew1at4Z8GCzUfRQ9xHtvyGcFPpA6fXT2VbxaN9qC7yanCLU9+fo 20Kg== X-Gm-Message-State: AOAM532oW1Zwp/AeL0HXA1xif1xjT+a6iDCBC7Rhe7wSg6x+OTMbVRZL eeA+9ADlu+IYCS15JcaBe84= X-Received: by 2002:a05:6512:788:: with SMTP id x8mr2778551lfr.250.1610147372821; Fri, 08 Jan 2021 15:09:32 -0800 (PST) Received: from localhost.localdomain (h-98-128-228-148.NA.cust.bahnhof.se. [98.128.228.148]) by smtp.gmail.com with ESMTPSA id w16sm2186264lfn.227.2021.01.08.15.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 15:09:31 -0800 (PST) From: Rikard Falkeborn To: Andreas Noever , Michael Jamet , Mika Westerberg , Yehezkel Bernat Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn Subject: [PATCH] thunderbolt: Constify static attribute_group structs Date: Sat, 9 Jan 2021 00:09:19 +0100 Message-Id: <20210108230918.32302-1-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only usage of these is to put their addresses in arrays of pointers to const attribute_groups. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/thunderbolt/domain.c | 2 +- drivers/thunderbolt/switch.c | 2 +- drivers/thunderbolt/xdomain.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index f0de94f7acbf..d2b92a8be577 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -289,7 +289,7 @@ static umode_t domain_attr_is_visible(struct kobject *kobj, return attr->mode; } -static struct attribute_group domain_attr_group = { +static const struct attribute_group domain_attr_group = { .is_visible = domain_attr_is_visible, .attrs = domain_attrs, }; diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index a8572f49d3ad..602e1835bf61 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -1771,7 +1771,7 @@ static umode_t switch_attr_is_visible(struct kobject *kobj, return sw->safe_mode ? 0 : attr->mode; } -static struct attribute_group switch_group = { +static const struct attribute_group switch_group = { .is_visible = switch_attr_is_visible, .attrs = switch_attrs, }; diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 9b3a299a1202..f2d4db1cd84d 100644 --- a/drivers/thunderbolt/xdomain.c +++ b/drivers/thunderbolt/xdomain.c @@ -756,7 +756,7 @@ static struct attribute *tb_service_attrs[] = { NULL, }; -static struct attribute_group tb_service_attr_group = { +static const struct attribute_group tb_service_attr_group = { .attrs = tb_service_attrs, }; @@ -1239,7 +1239,7 @@ static struct attribute *xdomain_attrs[] = { NULL, }; -static struct attribute_group xdomain_attr_group = { +static const struct attribute_group xdomain_attr_group = { .attrs = xdomain_attrs, }; -- 2.30.0