Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp970372rbb; Sun, 25 Feb 2024 12:41:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXHnXfbg3xfHvIyWjkdDVDaIFPWdx6dBRtKdhfRPWTd+sKSZmq+FHv6ObKQbv918zWYOlN5u1Idu1CseRc6/J634M5qhRE4y+5HWu5Gtw== X-Google-Smtp-Source: AGHT+IFNA+2coe/4/fX+1bxnPD3rEe3dJUSQrjkEbwfH0y/pOpqkXNTT+N4koC+TYWRTYLSjO7Ja X-Received: by 2002:a05:6402:148d:b0:565:7116:11d with SMTP id e13-20020a056402148d00b005657116011dmr3554503edv.27.1708893669016; Sun, 25 Feb 2024 12:41:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708893669; cv=pass; d=google.com; s=arc-20160816; b=t1AF6wW+hFaztTrg4q7LnD9qQeIe/u5erQpH7avwGm5qpDfw1Gj92dRt1idEQLhGFt bhOlVcBBOSrHpdIwDIRQ/35KRJVyfn6+5PtLNdfj7bleBGvBh2Eu6p4via0kDINxDtZ6 azkK+1GU/eyYuByiUYPdmU/7ak9mqV6AiyPkDJ9Lse5NOLTp6WbTKaBmI+UvK6fHLcya zbIo4qMdeqWqHkxoIDdASdAtVT29bK0F6F0mzLgm9L+tvnUNPXogIMOVGDz7ruq3dMMU huLTxgU4aXSqcSS0A1BrzJlws7RnUWQ4ZNSENhth8wog92pQiMEVO7oYfp0Zjkn7iJSf csYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from; bh=DiUavHh/hkzQyQAh4jkEs53PG0TMl0L8L33xgXDDPws=; fh=5fzQ5a94SBI18aarghFswMPMRuhYF3clwrK7qEU8u/Q=; b=ViDK7rJ/J5sB7DGZENOuKSSW2NLw1zGa47iFc44S6ais376cOm1fVByoVhXvkr8vwZ eI5EW4FKyKRcSXv/mrxnkrgHUF730GwxffqKiUQHLT9foFFo2R5+EpCz3W80/X1kgWbN N9mcW2N3O+MPSXR1FMuvRVJU3JKocQF0cYqQNiCDaXE7lYuZOcI5Ub7ojJtVvnQ7sw7x 34sZEVZcNyRq/UMnKhqcBhOXgUC9EgdfoSY/m/iCwXwccbcCiKS7Q2ewDiI1xT8enuXE hEIr/ryB3W2gpmnOzt+fpk+wlmKjxf0Qwalrz6yCuPNVETdzWuze9tR2jwI+o6+Vk6Zr PcZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-80284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x12-20020a05640226cc00b00565c4f55596si889052edd.499.2024.02.25.12.41.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 12:41:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-80284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id A53391F21C98 for ; Sun, 25 Feb 2024 20:41:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDF4E1B81D; Sun, 25 Feb 2024 20:41:00 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 637B7111A5; Sun, 25 Feb 2024 20:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708893660; cv=none; b=YAi1ShU921+fSwyvp7dzKTdm0da1r0/wXz51VjmPsT/thbLFztWCM2xbfPiUZMd50zqxinO6GE0jBF1R0UTwqNWYrvR09TAWyM5/Yrn26eUKVpMHxEY9IglRH7BqOtBQmb+TMSrt7KNIRBrngM3cz+ktjwSR+20ld2CeC6Y6E0w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708893660; c=relaxed/simple; bh=XumoTfKfv/ZGFc5svkWZgCNU7144b6sk/mox3FGWCLM=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=RhqwRouy9KQam4FA5xXsjrs8wXjAp4bVFvBkZYA3EkrMwKdHt+aOA1eTN+2piPcHUn/miWdnlVSoM5+mM4Flq3jVIuJQixqN6vPSrl9b66I9/Mx+tv4aEFgR0wQpn5atVDn437Q/HOZnLQFyAjrFNrBB3IWdcGc5Aw4nrxJkXcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8402EC433C7; Sun, 25 Feb 2024 20:40:59 +0000 (UTC) Received: by mercury (Postfix, from userid 1000) id 088151060D21; Sun, 25 Feb 2024 21:40:57 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , "Ricardo B. Marliere" Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman In-Reply-To: <20240224-device_cleanup-power-v2-1-465ff94b896c@marliere.net> References: <20240224-device_cleanup-power-v2-1-465ff94b896c@marliere.net> Subject: Re: [PATCH v2] power: supply: core: constify the struct device_type usage Message-Id: <170889365697.1930401.10570101771941744000.b4-ty@collabora.com> Date: Sun, 25 Feb 2024 21:40:56 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12.4 On Sat, 24 Feb 2024 17:15:41 -0300, Ricardo B. Marliere wrote: > Since commit aed65af1cc2f ("drivers: make device_type const"), the driver > core can properly handle constant struct device_type. Move the > power_supply_dev_type variable to be a constant structure as well, placing > it into read-only memory which can not be modified at runtime. > > In order to accomplish that, export power_supply_attr_group in > power_supply.h and use it with the macro __ATTRIBUTE_GROUPS when defining > power_supply_dev_type in power_supply_core.c. Therefore the attribute group > is no longer static. Lastly, because power_supply_attr_groups is no longer > dynamically associated to power_supply_dev_type in > power_supply_init_attrs(), make the function receive zero arguments. > > [...] Applied, thanks! [1/1] power: supply: core: constify the struct device_type usage commit: 7b46b60944d77e361a727cd8ce46aec31c146e26 Best regards, -- Sebastian Reichel