Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp115008rbe; Wed, 28 Feb 2024 14:09:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUEaWZrM5znz1BdLVNnGV1nTzXTgUYMfIg5eZkIJB8ZZ4CxnJuy1lICQwP7JA9fuZcgQeq8kj1OA7SpsVBWV8giTrFb6fmTP9NncUO7ig== X-Google-Smtp-Source: AGHT+IGhl99Qdafa9FoOWZCGoS3RVPiTiCF10ikftzpCBGZ6rF23StqTIVZNd4FTQr+5NJUnosSk X-Received: by 2002:a17:906:2449:b0:a3e:8808:fc1d with SMTP id a9-20020a170906244900b00a3e8808fc1dmr151376ejb.64.1709158152318; Wed, 28 Feb 2024 14:09:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709158152; cv=pass; d=google.com; s=arc-20160816; b=eiFTnWQ/7l5zSsYa0/FIE9GJ6j10eFIi5lEO0HqNv0qsXPZLthhSpn3fynvkuSY1Qm ZKoMOXtZNoyvv2NOStXkjzsd/pG0cNEz7xGluyKoyWPVBAqlvhysAr4JvD0r5s+68f+Y l5DmYYIVdEpO1kqxdl3+uSYBS9hAtmIlZ7h9sUDSs4g7tc8dNmY4I/rEkj2ImOLL1KbS LjQYAvIUpv9KiS3O2tj5+z1UWy8j7xMvP6oG9N/f+KmyOfXII//axKG7wkYNdgWYrfY7 Yk2Y/kB2HurLCslj0eA6vFxyqaaGQobz8XkNQO+Fa6KrWAfg1nGPkqxL1CyAaaK/NE9R 5n6g== 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=OofPtCNOBdr2sWYAqBfNVbSseQA2NMP5OFfjrJrxeUg=; fh=q+GxRlzfkfpnGSBUAyY3ytRPmsKTziTmN+Le0FMd+OA=; b=ah9Jy3G/Bmm4E7oD/K1N+etgxl/BFM0ho6OUJJJKzIDQpB1rqhTnSKK6Edkxa/1PTB /5hKUxuIhfmea2NBM13h0+pCcTIb8kj2UAXlYt6GjdPDx/HDtHgsD09HGFiSKp31qhLa QcQ7EzxzkSUT2cE8xz9tLXtJZxQQ8iV8COH+ObCYJZNmxkhesk467vaCJYAsscrNXlPV NKQ2GgO4hrYnr+3clrpotdqO6Pf61cWZTAwq65JCo1Uoxf7trgAUb9jlKJOMcD3w0bl7 6bvzvMdwmxsGCfv2MmHoGvt+ZVmj28lUpAoFrKP35QWW+HQleDRzJ99l8YQ3ZoXctL2F WtXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85772-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85772-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. [147.75.80.249]) by mx.google.com with ESMTPS id e9-20020a170906374900b00a43a4f6581asi2052896ejc.828.2024.02.28.14.09.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:09:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85772-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85772-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85772-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 196CD1F25B35 for ; Wed, 28 Feb 2024 22:09:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D99431361DF; Wed, 28 Feb 2024 22:08:57 +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 5FC411361B5; Wed, 28 Feb 2024 22:08:57 +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=1709158137; cv=none; b=WMlNNcznXzx6eAD8bdcVIPJBNe3Z5sgc231RWvAqWDtlmRcu4oSY7l3Wufdy9uxM87j1v0HFe+Elqmh0+qFTpIvrwDNTOI7wvTGq6epMhxzq4QLEcyLxFiXO2SZFAf+iB8lKJxXdAr4ltQKit0RW5f29qyjlCDI8Hsg+FC4U/lI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709158137; c=relaxed/simple; bh=r1i94g2MPDnIrgqSNviSxFemOVfH2bZ3i25wcrLYUfE=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=SwldOUkY3OZbkg3wW/q/cxj58XnZXLG23D0gfrRggdfWuUPI3G4Whh45Ek2aLVdHb9Ozj+M3x1CU5J0Uh3O3mkk35KrnBs8r1xPbbGdPD1ot/4C4xSdhFgnca2Kp+heiRbI5EzNYGNVmzJtoZzIowzlMWm0xp3btoufBs2ROm+4= 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 C6BCAC433A6; Wed, 28 Feb 2024 22:08:56 +0000 (UTC) Received: by mercury (Postfix, from userid 1000) id 63C431067A0E; Wed, 28 Feb 2024 23:08:53 +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 , Nathan Chancellor In-Reply-To: <20240228-device_cleanup-power-v1-1-52c0321c48e1@marliere.net> References: <20240228-device_cleanup-power-v1-1-52c0321c48e1@marliere.net> Subject: Re: [PATCH] power: supply: move power_supply_attr_group into #ifdef block Message-Id: <170915813338.50142.16479593478459212798.b4-ty@collabora.com> Date: Wed, 28 Feb 2024 23:08:53 +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.13.0 On Wed, 28 Feb 2024 10:46:28 -0300, Ricardo B. Marliere wrote: > When building with CONFIG_SYSFS=n, the build error below is triggered: > > ld: drivers/power/supply/power_supply_core.o:(.data+0x0): undefined > reference to `power_supply_attr_group' > > The problem is that power_supply_attr_group is needed in > power_supply_core.c but defined in power_supply_sysfs.c, which is only > targeted with CONFIG_SYSFS=y. Therefore, move the extern declaration into > the #ifdef block that checks for CONFIG_SYSFS, and define an empty static > const struct otherwise. This is safe because the macro __ATRIBUTE_GROUPS in > power_supply_core.c will expand into an empty attribute_group array. > > [...] Applied, thanks! [1/1] power: supply: move power_supply_attr_group into #ifdef block commit: ea4367c40c79a5f16cb0de8a94a6b72697d37f06 Best regards, -- Sebastian Reichel