Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1403879lqe; Mon, 8 Apr 2024 08:01:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZczzDSMum4Qs//7K6md69RH356Rl1hHltMc241OyHbT28QViUMWxaBHhYTaQi741BfbVx51SWkwdWTrxBapgiJGOZ2kkcn7g7OrzfDA== X-Google-Smtp-Source: AGHT+IH1UJRUJaVmrf0nJZ2b0xinY9DUMoT2KlwYFSg8Trie8LAhB4Up2rzubFhTvJzyQAzfn/y/ X-Received: by 2002:a05:6830:1e0f:b0:6ea:ffe:b862 with SMTP id s15-20020a0568301e0f00b006ea0ffeb862mr5187925otr.31.1712588503341; Mon, 08 Apr 2024 08:01:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712588503; cv=pass; d=google.com; s=arc-20160816; b=dzBh5bcVkxoWSDzf2hyF/JDuIPbOD63/S7XMYZu2fON4x8iyI3ifvwkSOkUyNApsQR JeOb3BSrqN6l6L0wf60kTEveoQqc1cA+GRePVG4SX/4TJDVq+sobntlyGncRk5K0KN+G eI3b9EfsKpUli9LIELacb625FoBGLSuj69NHxEtqFqzh8lDjlXLzFU3XAMJTa3qJcoSd lilgl/MAMAxHrCtOG9x7VMy0MqeyrP06JK9orN03+z/TvcKHN879GiPFpHysBxqBEtTq QmY9QkuWhczetOHqigxUQ61uyqOudWdwkzBeWDmHV9yIIR3cey6TvjOImckI4SWU3v6d kG4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=5a8B+j/NdCmgDXXFf0+uEEUKYf/IdrVUyUTUXXZk5E8=; fh=UdoRj5wE4SPggAOFCxPe5ozPRPmk87HB1QUC6GFyyAs=; b=M77F+i962Z92qnhWuhQYyMEeYjIKeEOF45ckXH9GjYp9d6ec39jX5RAsJyioM2UG3L YbiYosLJ1Kowu0YXmrH7BZQ+Q3k1DdxuJIUmMTC7vR+Wq6P8xm0J0e3Giyh0NpAe8ePt ZtUKLjQqO2d4g/h0nMcjegdMolUI0SqTlMNOUyuVY1oE0YUtm9MGJmbTGW6yV5CG1kBi azX8X6dXF8v+qY4ttZLEwRtL4OX/pURC+iXBWd7sNZTFgTgkpKlUbMfqhAoQH4O9vfLp +vX7X2weO7y/wdNPq41mS3vx18ko4zDzTNRAFvPGt6eXNCg3VfhEEws/s9pEEFfXlXoM Mijg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iPVzIBvT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135570-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135570-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i18-20020ac5c2d2000000b004c94c12bc7asi476237vkk.100.2024.04.08.08.01.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 08:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135570-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iPVzIBvT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135570-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135570-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 09D341C2207B for ; Mon, 8 Apr 2024 15:01:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8086F13F449; Mon, 8 Apr 2024 15:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iPVzIBvT" 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 470CD13F42A; Mon, 8 Apr 2024 15:01:33 +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=1712588494; cv=none; b=uRoqqWANLNavbl5vmJnsCI4xn5XWcY4D5QYlTYtBKee6s8H4U6lakBSySHofUzWXb4l8a5c1DZh7NevtJfL8iJDzHTUxGPz/OhMui4vbheLZfMah4cCeRzo/tXAOPsbuHWNcrjaUtDl4On02G5sBnG4plBv6lJpcDBLscpEvzCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712588494; c=relaxed/simple; bh=EITVdlJtkrnylLXhed9Pr1DfYAyVTQ3XvaUDh63E534=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bjGRrwHk++ZbrkhTgH5dXtENpfRHmOQgJczDQVc15iA567JVW7k1W6MUUOXs7yZhxnNGzTX9gfmFXSqeiqb/RfO03pubmr21C5vGhsPv+wymsdlr54E51D1WxkfwCXhutiACQjLNfRk4LWGJ4pRpG7g74ENrtKCkg1UVyI74PrE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iPVzIBvT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB446C433F1; Mon, 8 Apr 2024 15:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712588493; bh=EITVdlJtkrnylLXhed9Pr1DfYAyVTQ3XvaUDh63E534=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iPVzIBvT/iSK03mJ74WyCdtfwrYQ0FIvhL5K8YMXOWzUcxtAW1X9DNCrqtBiFjfyi tl90sPwPpZ5rbnlWkWlrmucbJbApIpssRcLEk4bwAVt6FxwLnhmycj60p3s5ZulGuY Oi6kb5XzN6oeZLDaCEoYGMUGaCwA36s9aVa2vFCs+0r3L2ACNZZS6RJMIMK7lmGxXl LZaKWREq5eaTZ8dEmqubeluPfq1pepZhLI9FVjpANsP8XqyeISOYtrQC8gZ/KN/t0I J4RLdMza2ntow+e8CC8hAcBjXsrybDusTaZepo397svH4xSl9ToXUzq+mYubuhRT/b 17pKAxdggeVsA== Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6ea1572136eso453455a34.1; Mon, 08 Apr 2024 08:01:33 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCW3+0lUuKg3hHhe5fIqYbB6u665OvDnFDviXdUd7KWwdn3iXbLFY6hEeIr3VKPT+6KhtijdC/aMEQixQJR8e62LzYen9GjggTwawKLEhn9SqELjylZL57kGQkpxmjD/8n7Z+WFUBW8H2HCWTBOLjc+YqFVDm55FTv5XdDPgzEIaiLOjT+XnmOtAolUMwTh7zUKraa7MV0+2yxafcRNvULKVG6VwrLZivXIW1gexeQtwi62weIsFjgZCMyHHVQ== X-Gm-Message-State: AOJu0YzUFgJuG5OoHcgg+C7cG0jOPGlDiSTYqqsmM17PI9Otqcm2Gp8w 0xKNpdaFYwl5HKE7Dz+tIuFRrDijMGKw9nsfRzmQji05ws/GVvDn/2lcM2jA+e5CupL+fHBJ80z yHjpuw6lyNGtgRjHxBoAg7xnjuYg= X-Received: by 2002:a05:6808:603:b0:3c5:f534:e2c7 with SMTP id y3-20020a056808060300b003c5f534e2c7mr2839026oih.1.1712588493105; Mon, 08 Apr 2024 08:01:33 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 8 Apr 2024 17:01:22 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] Deduplicate bin_attribute simple read() callbacks To: Lukas Wunner Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org, Jean Delvare , Ard Biesheuvel , linux-efi@vger.kernel.org, Zhenyu Wang , Zhi Wang , intel-gvt-dev@lists.freedesktop.org, Daniel Lezcano , linux-pm@vger.kernel.org, Luis Chamberlain , linux-modules@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 6, 2024 at 3:52=E2=80=AFPM Lukas Wunner wrote= : > > For my upcoming PCI device authentication v2 patches, I have the need > to expose a simple buffer in virtual memory as a bin_attribute. > > It turns out we've duplicated the ->read() callback for such simple > buffers a fair number of times across the tree. > > So instead of reinventing the wheel, I decided to introduce a common > helper and eliminate all duplications I could find. > > I'm open to a bikeshedding discussion on the sysfs_bin_attr_simple_read() > name. ;) > > Lukas Wunner (2): > sysfs: Add sysfs_bin_attr_simple_read() helper > treewide: Use sysfs_bin_attr_simple_read() helper > > arch/powerpc/platforms/powernv/opal.c | 10 +------- > drivers/acpi/bgrt.c | 9 +------- > drivers/firmware/dmi_scan.c | 12 ++-------- > drivers/firmware/efi/rci2-table.c | 10 +------- > drivers/gpu/drm/i915/gvt/firmware.c | 26 +++++-----------= ----- > .../intel/int340x_thermal/int3400_thermal.c | 9 +------- > fs/sysfs/file.c | 27 ++++++++++++++++= ++++++ > include/linux/sysfs.h | 15 ++++++++++++ > init/initramfs.c | 10 +------- > kernel/module/sysfs.c | 13 +---------- > 10 files changed, 56 insertions(+), 85 deletions(-) > > -- For the series Acked-by: Rafael J. Wysocki