Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp448828lqt; Thu, 6 Jun 2024 08:13:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXf4EDex0MLQ1z8+js3qSBZ5m19Iq/cj34kPqjskCTJVwb2JWISI/GvyfyDemvwK1hfUVCPmxNqEV4/PvdZbGm3ckhTGfcZoEhzjtmonA== X-Google-Smtp-Source: AGHT+IHlF5PXJEcjtTgVf7e7FQdz9lo1BsTcL7qVuRGmKlWXu6CWP5oH1xA8fYFZH745C2Sm/9OQ X-Received: by 2002:a25:2e02:0:b0:dc6:ff32:aae2 with SMTP id 3f1490d57ef6-dfacad0d872mr5400566276.63.1717686814602; Thu, 06 Jun 2024 08:13:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717686814; cv=pass; d=google.com; s=arc-20160816; b=qpOah6aHHGry+Qc0qdEtHnX1dBnrBizOckRndMRh16dj7My0YJDJIHWl+6cf4W/wjo Om2S54eC6pHOHrIq8rsbGWvhAZnI2StUG2vtxcB6rqVtdtBC4Fx5pSLiIjKwMzMs9126 za8kXi638jqMwW1aXMJ1+ZIOygTpBymbURcgQTX4c8bpYM7iMJ9Pa8Rb6uSxdq+Ftbz2 tcQNHnXHXuZxqm6/9DacjO3N+44bSK1GfVZbCEed9sRw0+PtKhrtwHoOdTOi0Xz516gV L8Dffa47u7Gt19qEgb7vgFlKKcRCkmR/dYWVAOCVzyWfN1pJddwrAFK90iayQ0o08OOB iT1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=F1LeJCGHjjNHp6y4nei1kTr03Mc/C6+6qu89E1H1oJg=; fh=yA3vuFiZmJfoItPaS2BpWDAzGgfs+KcnNwQwMnTjy1k=; b=03u0XPlyRG2MqDOEipQ6t7hGJPEYHurhR/jyUu3Jd6SxQsAKL8uer6mCs+UypbLrhK AEQn3xzt72k+/hz5Ev3jXuYPeqhk0bkCTD9VTFd1LIFi64EoQehgWxlzmQ/yto5tgM6p Iwd58SFHXhHDCNNS72saajlLRa8+O7Izbcmp5PI91hE6TLzgbotTbu5wvdHks8qzpZT0 nwl/Uj1FbWrnhabTTVWUsew65FSG9BuKyaXFr7ARFPVqTdyVMIKw1ky00dHNxcZ7t4hc ISaOBKJDaXbKUxqdZ1p2/6ZtYCZxoQ3EgrxQOpy+EpfY9oDfGnSFW0UMU1CDOpZOzH8A UnlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=bkBQBzA+; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-204530-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204530-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 71dfb90a1353d-4eb4ac8d9e2si328400e0c.82.2024.06.06.08.13.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 08:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204530-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=bkBQBzA+; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-204530-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204530-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 34C081C239AD for ; Thu, 6 Jun 2024 15:13:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E26A51A2C0B; Thu, 6 Jun 2024 14:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="bkBQBzA+" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 D17651A2548; Thu, 6 Jun 2024 14:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717685468; cv=none; b=JrUQJdWT9tDUhzu2mdjK/YBwdhmPR0YXgrPMj/jDNnmXz2eSdrEVDt7t54xXZwCsBD0CAeoLg1ebLxbRFFxMTmjGRHHJtvTjtc2X+WSt9U+P0P3/zfpCFuHgt7RkNVT913cIC1Kx6SrQWl8txTdEMSf2svm87r/PpCm2jevEu30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717685468; c=relaxed/simple; bh=iwmtGXBeadQYz1BR7WvStUjlWi2C455oBoc3ud/Aeks=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=swaw3Wa+6xJLo9XewlEHtQTvKZSv6vPCle7rBRlGIyq6WtZSE2Xgj7/kqhVBQ+UMroQwgIsf/hxA3+t1qlmEtc3qhNwu8wI+LpsR7QYthPEiOh7LxTyF5koBH3IQnJwWz5pcrfVlYYN9w+x0vUX+ikawQV5zMY5O5hx5P94tS5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=bkBQBzA+; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1717685463; bh=iwmtGXBeadQYz1BR7WvStUjlWi2C455oBoc3ud/Aeks=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bkBQBzA+FzaLq9u9NdMLSdi3HvwS5F6FzhMpNcPMteXAdkASFCDh1HOcYw4ghI7TY /+o47YaaxcTrlSvPwepFXcol+3VomRR3IAaeWksCpqlk4xWttN23omkEpowWeUc2qt bI3YSjyEMwm/jdUNeP5iL6da54SgGH+m9YQhTwq0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 06 Jun 2024 16:50:55 +0200 Subject: [PATCH RFC 1/6] power: supply: sysfs: use power_supply_property_is_writeable() 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: 8bit Message-Id: <20240606-power-supply-extensions-v1-1-b45669290bdc@weissschuh.net> References: <20240606-power-supply-extensions-v1-0-b45669290bdc@weissschuh.net> In-Reply-To: <20240606-power-supply-extensions-v1-0-b45669290bdc@weissschuh.net> To: Sebastian Reichel , Jeremy Soller , System76 Product Development , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717685463; l=853; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=iwmtGXBeadQYz1BR7WvStUjlWi2C455oBoc3ud/Aeks=; b=Cm894uo9qkvCZ/6aRkPtVyxRlt7d8CnehIna7X2jXsUNGaYd2ka67wBaMKaLbTdMA+uOjfHuB ajRTaCxvYB6AZn2Mp5KH8Ft/sfRfkbzMB4awGLr67225DA9etXAsanH X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Instead of open-coding the helper use it directly. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/power_supply_sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index b86e11bdc07e..3e63d165b2f7 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -379,8 +379,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj, int property = psy->desc->properties[i]; if (property == attrno) { - if (psy->desc->property_is_writeable && - psy->desc->property_is_writeable(psy, property) > 0) + if (power_supply_property_is_writeable(psy, property) > 0) mode |= S_IWUSR; return mode; -- 2.45.2