Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2539355rbb; Wed, 28 Feb 2024 05:15:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXkaLgIc1L9ELzYf0CUIOmU2ei6rki9NmgTptg122I3TTSbDGnmWJJXObJmxx8wLCYyQAEju7HKvS9nhR7HFlga6pYk+BtqKqUPM9utgA== X-Google-Smtp-Source: AGHT+IGldKI9KDc9z+XDOD5nF2VcuBgUeKJanwChB1HFNfQ0aRo3EXV5GnWCkbg2h9Nxuz+PQXnZ X-Received: by 2002:a05:6a20:9d90:b0:1a1:55e:2103 with SMTP id mu16-20020a056a209d9000b001a1055e2103mr5106032pzb.40.1709126099808; Wed, 28 Feb 2024 05:14:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709126099; cv=pass; d=google.com; s=arc-20160816; b=yBgZxCORIwtlp5hD3CtRXBydnuLmXI3BTa7mcL7rD9niJWHWaZhTT7kixmy6MkyTWo uWE1+VuO7AC85y6Db2+woCBtyp5MyIaukj8g5yVHgM91nhJJtrksf/lyKtcTmBmYclnr GC0pz32gqCcWqFpDNwqwNYV62eGJiFWOoZkS4AbXty+7J5BY20XnCQsadv27PW3GW03f BDw6QuR3iITLaGhKqXI3lE1+MFI53+vrL1045dAB5gThHrsAszrm30wm33mKPtBnapnG WfvVArKderD01XqlxQYYb/sT6MsKhwkGPG/ry2Sgsh7BTflqUCYX3RT+LbaUFf0K3bZd KzIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=k7qSr+E8IkDSOGsp4neJk0QYmDXRPfIuMj+PPH7uuhU=; fh=B4akNKHX9OlODNoBKCAchSCOuYn3Oamu7s/mHrkDtl4=; b=Gimn8n4Hs9XmzjhZrQtwLN359w3sKngiig/lJOenBg3PD8k0PTkW2cqimLdNcXWHAt tWnGojzihz4UK53019gUtwpmtvu67p9t/v0bKIxjul5pNWslM0PDpsnUlBS9KaAgH4uF PHTLDwq+lL/wxWzdEYD/4q7noKBQKTxqdZd//TV5Vz8wgAYu9zQA5YyxweiEik0oykpT RN6eX+AWG0tdX8/XkQV0de7j9Hb+XCJvp1tgg3r4YRbMAPItj3cNd0FvA/L5X+9SJHSh fkhUqSbW8fIn4ydSZDk4NcNjEzm5uB5TkUl0GXWJrDBHwap5aLNwVCYDzf3knRy5potn vmGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2Ds+7VX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-85056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e124-20020a636982000000b005dc4f115f2csi7322997pgc.496.2024.02.28.05.14.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 05:14:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2Ds+7VX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-85056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B0DEDB25B3B for ; Wed, 28 Feb 2024 13:04:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FF90149DEB; Wed, 28 Feb 2024 13:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O2Ds+7VX" Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA2C33BBEE for ; Wed, 28 Feb 2024 13:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709125449; cv=none; b=WhU+eZYRtD2q/QR6vSZeUXl9evDKbwm4NBwzMnM/Dh0cvpCWKEI2fv6r7s8JeRSW/EZHApX9SK5CTU1ev4oKzHxeeLYBVazLFFGQgQaAu7VvBRV9z/1t7YT2MBRZyQMFeAIeAxNYPD7UmP9hdkQD5n7o56CvpbYcrZ3oMJSrpqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709125449; c=relaxed/simple; bh=gtYJD78+zk61wKaUFAjdhRUznoMop+FRi7xFVUcdo2M=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=TWDsdMttPgaLkGVhh7/0eIHE4fU1kM/6nR3NbV3Gz2zsNSnNKHEZf+Qtwznx1r7p7WDNRM6m35dzNFmeTyZ54QlMzPG0g7Q5bESy5lHFNcusbYcx+vPv0UufQlmGefe+jGTrKmY7Mc8Ltc6VxZmvriz4eZvblbiztwO++8m/tys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=O2Ds+7VX; arc=none smtp.client-ip=209.85.167.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3c1a2f7e302so1493022b6e.0 for ; Wed, 28 Feb 2024 05:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709125447; x=1709730247; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=k7qSr+E8IkDSOGsp4neJk0QYmDXRPfIuMj+PPH7uuhU=; b=O2Ds+7VXocLutQOlNqbMDecMXFOEPAl9AROKjkqvsRcO4s6ST/4Hblw4sgTObpg87L UH6ZqYwT4gdqgCwkMDOg5M/yRgVWDPbJZmtdBhRoa4R10TM50OxTxXl03Xubp2IjlcBU ejERcZyHRmrYIEfLWGAD212tTzxF4Eq3hK59A3Hyn1nsmmG5R/BfS7Nc28NYHYsGKXv1 5HeefEGeihHgOs2F5IvYKi+LHyhHmPTpFJ1+lqo2JRWYltVa7clgm6iUIyUgYP+c1Z3Y Q1TCehYhdTabyxZYiKZYRSfXNurtZd1dErt2r2XiG7MXE9aNkeHmmATV9ec753pHg82o C/zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709125447; x=1709730247; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k7qSr+E8IkDSOGsp4neJk0QYmDXRPfIuMj+PPH7uuhU=; b=fvYT1lHECMzYnL81gHmiyf9zJFrryG8ZNwecJ9WFpNF3tilA8megtPsz082sX8qVp3 ac2sl3hKJmSxhgKEklSd+XzqUodhcRrwYV+QASrvFCfdC6psXVbP9hDOvhhHKePZ4JFs asaCx+3Am49Ic98KYerVqyn3IUBV2BgewU4tXtnQSr0bkk/klMZhvVMoYDrG3N6uVyli uopmg9FBOldJ8mhe9PF/kthueTvDb2H+A6uTQeM3Zy7+VmznhLPIIyeVJ+UiFFs9H96o Fizo1ZDtS9KUWt0rOaafC9PG0mrM9047N87mcoKna07hC36ElA+lDthxYvvChZofE6A4 mIgA== X-Forwarded-Encrypted: i=1; AJvYcCVb2Q6nCmodFRTZTIqYqs7RKuJIXaKeEQfh6xmua/cQdEISINwxJZkVqiM5fE/JaYegsKTP1fgq/EIdDRlllYW7WdxP6qedJfRDrHaB X-Gm-Message-State: AOJu0YzDJI9MMWCb/y55TKbvaTlCDZaB5LXzGZ6TDe0o822+cOmCTFNN gaYNVMqR/5tzcf06FMsUTM7HBv1BO4bArVy2aILyL1mlzbMGPwGSbFHN6b1MKXIkrrEwb+F2bst 7OfMXzgaZ0iJBzarm9U5GZgEEJsFAJkPedi3s4BKXYuljwDqg X-Received: by 2002:a05:6358:b5c2:b0:17b:bd6e:22c9 with SMTP id wb2-20020a056358b5c200b0017bbd6e22c9mr5635045rwc.8.1709125446965; Wed, 28 Feb 2024 05:04:06 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240219-device_cleanup-mmc-v1-1-1910e283cf5a@marliere.net> In-Reply-To: <20240219-device_cleanup-mmc-v1-1-1910e283cf5a@marliere.net> From: Ulf Hansson Date: Wed, 28 Feb 2024 14:03:30 +0100 Message-ID: Subject: Re: [PATCH] mmc: core: constify the struct device_type usage To: "Ricardo B. Marliere" Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" On Mon, 19 Feb 2024 at 13:43, Ricardo B. Marliere wrote: > > Since commit aed65af1cc2f ("drivers: make device_type const"), the driver > core can properly handle constant struct device_type. Move the sdio_type, > sd_type and mmc_type variables to be constant structures as well, placing > it into read-only memory which can not be modified at runtime. > > Cc: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/core/bus.c | 2 +- > drivers/mmc/core/bus.h | 2 +- > drivers/mmc/core/mmc.c | 2 +- > drivers/mmc/core/sd.c | 2 +- > drivers/mmc/core/sd.h | 2 +- > drivers/mmc/core/sdio.c | 2 +- > 6 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c > index 48daeafdff7a..0ddaee0eae54 100644 > --- a/drivers/mmc/core/bus.c > +++ b/drivers/mmc/core/bus.c > @@ -272,7 +272,7 @@ static void mmc_release_card(struct device *dev) > /* > * Allocate and initialise a new MMC card structure. > */ > -struct mmc_card *mmc_alloc_card(struct mmc_host *host, struct device_type *type) > +struct mmc_card *mmc_alloc_card(struct mmc_host *host, const struct device_type *type) > { > struct mmc_card *card; > > diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h > index 3996b191b68d..cfd0d02d3420 100644 > --- a/drivers/mmc/core/bus.h > +++ b/drivers/mmc/core/bus.h > @@ -23,7 +23,7 @@ static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *a > static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL) > > struct mmc_card *mmc_alloc_card(struct mmc_host *host, > - struct device_type *type); > + const struct device_type *type); > int mmc_add_card(struct mmc_card *card); > void mmc_remove_card(struct mmc_card *card); > > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c > index 58ed7193a3ca..5b2f7c285461 100644 > --- a/drivers/mmc/core/mmc.c > +++ b/drivers/mmc/core/mmc.c > @@ -883,7 +883,7 @@ static struct attribute *mmc_std_attrs[] = { > }; > ATTRIBUTE_GROUPS(mmc_std); > > -static struct device_type mmc_type = { > +static const struct device_type mmc_type = { > .groups = mmc_std_groups, > }; > > diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c > index c3e554344c99..1c8148cdda50 100644 > --- a/drivers/mmc/core/sd.c > +++ b/drivers/mmc/core/sd.c > @@ -805,7 +805,7 @@ static const struct attribute_group sd_std_group = { > }; > __ATTRIBUTE_GROUPS(sd_std); > > -struct device_type sd_type = { > +const struct device_type sd_type = { > .groups = sd_std_groups, > }; > > diff --git a/drivers/mmc/core/sd.h b/drivers/mmc/core/sd.h > index 1af5a038bae9..fe6dd46927a4 100644 > --- a/drivers/mmc/core/sd.h > +++ b/drivers/mmc/core/sd.h > @@ -4,7 +4,7 @@ > > #include > > -extern struct device_type sd_type; > +extern const struct device_type sd_type; > > struct mmc_host; > struct mmc_card; > diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c > index 5914516df2f7..4fb247fde5c0 100644 > --- a/drivers/mmc/core/sdio.c > +++ b/drivers/mmc/core/sdio.c > @@ -66,7 +66,7 @@ static struct attribute *sdio_std_attrs[] = { > }; > ATTRIBUTE_GROUPS(sdio_std); > > -static struct device_type sdio_type = { > +static const struct device_type sdio_type = { > .groups = sdio_std_groups, > }; > > > --- > base-commit: 25e69172db8a31ef8564ce1cf755ac5cb8374daa > change-id: 20240219-device_cleanup-mmc-04210bcc3d9a > > Best regards, > -- > Ricardo B. Marliere >