Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp808668lqp; Wed, 22 May 2024 23:52:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWExDvB26WA6M04z11Z6rlmQxtqQbP92newckRrclWiNZZ4xCohb64n9GtHpwGlBwUT1n37k9QQ9yBiSS284G0PZ6bJBymk5vi2siRb2g== X-Google-Smtp-Source: AGHT+IGlcZfmIU78CuS92i27YpSrwy7TFmMnBZFNsiiFzMV4pUExNRC3kuJck5hi1DqkEunuWm3p X-Received: by 2002:a05:6402:2689:b0:578:34db:3f35 with SMTP id 4fb4d7f45d1cf-57834db4244mr2634614a12.4.1716447123204; Wed, 22 May 2024 23:52:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716447123; cv=pass; d=google.com; s=arc-20160816; b=IdaoFOJYAYeEJhH5N2rJOZp1P47miKBTw4PQOJXPdoIGu+/1qM6sxEio42Fqyx28hS bkBw7NELOpUrLhWOB1rKWLIFb2Cj8ke2Mq6UJRbehBbLqZTdJy+sNbSW+5NkOl8eJEco WM/CmERhd4WHmXI63a//7gHIpamIYtHGcE5WBQnW2YcAOpqIMocYTd3u9WVpD6UZwyiS ernx11M7OierJlFVBKRCyFJOLP8KH1RHnMzEpM6rIY2EpTpmTEsQQXfnhVm++KYQjAXC oJtaEy59Ci0OufA1OmrR6f5Dq58w2tPGxPVGZkukxnxwN5JL+2xc2QX7ZlHI11OgBG0P NHdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QJ05xs3Q3N0rOpkALRxQToEqrQmhjj+dAJTles2OUR8=; fh=NHaAfUKn18QivevI2Bl3P6TVv/a5Izj68KVlaOVzUQA=; b=UkQqn9JkXRN23XkTpFoLnv/mHCYd1g+YnB4wNw9PlOGKQFl1g5niDC8YJq0fjuRt22 wrWTumLVx4Nq4wxMq7x++WLum14IjcUxiDgdApHWndom5qOt7xqpCPSkKJMqW6QBxthr 8VzjFRsV+T51sqO6tsn42KxT2FSbWmrOZT66QlKrqYL1wF1RI1wzxJGIl26yXfdcPyWB oYt1J0ssQ9X3EOt+OWBb7NG9jjFwqxoBX0v9adeEr3zCRHNXQZtiQ7VmzIITLEZ0bufy 2rYImm0sCWWgzFhOM78Qhd45cBwD/A+wiOqKHn1a99ukAmtEDt1WZR+Y9oat9SDuHJuv F2/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fCKm2ZqA; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187063-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c328884si15689094a12.409.2024.05.22.23.52.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 23:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187063-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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fCKm2ZqA; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187063-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E80451F21949 for ; Thu, 23 May 2024 06:52:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B12F813C918; Thu, 23 May 2024 06:51:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fCKm2ZqA" 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 C07A113C8F2; Thu, 23 May 2024 06:51:52 +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=1716447112; cv=none; b=Xvd+77JDLi6cJKMaO1jp3T7KT/GCYC+97lIXRc0J0qLoHoZEOqWwV8d1BNQXmEO74kvz7gkfamHg8OKNzRhy2xrIuLkYQtcZ2td8TFJcT2G5LgwCtb8GwRofTgiVe6QeEFJcKQ111AgbWktqPEoYnNASt8VKrf3AVVsTj/OsdbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716447112; c=relaxed/simple; bh=vxr2mkzYP8mbnwy26aQJbbvOzWaMQB/nx4kIMYC3W1A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=naNIdBjZ4yCzP5Rt4fkmQnliJKrcdXD4YrcYoWrDgwVt+fjfHfaGVXmk9WsMndufH2vUb9TX8NQLdaBuOqF+JIdcEjxs8T7iq0h1oPIi5UTlhOyXrFbsH4zeF1Edhv+YEIWTdL82DcXo8ZqRmOM14GQqo2ogQ468Rp3j9r4Ro9E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fCKm2ZqA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01670C2BD10; Thu, 23 May 2024 06:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716447112; bh=vxr2mkzYP8mbnwy26aQJbbvOzWaMQB/nx4kIMYC3W1A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fCKm2ZqAe71lxfgsC1I+obtVtvkM6KQ988dCXcZSItgRCne5xkpE9HqIVIHKcURGn OWi/X6qgvW381+OQ/PkhE0Gztw5g2taRrf+tH/4CpccMpg/oFdYXTYk3bx4mTg2JQF If/tlvTZPws+h4VEuXiCei21esZR+7aawIwmlyDM= Date: Thu, 23 May 2024 08:51:49 +0200 From: Greg Kroah-Hartman To: Guenter Roeck Cc: Lukas Wunner , "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 Subject: Re: [PATCH 2/2] treewide: Use sysfs_bin_attr_simple_read() helper Message-ID: <2024052334-nape-wanting-0a2a@gregkh> References: <92ee0a0e83a5a3f3474845db6c8575297698933a.1712410202.git.lukas@wunner.de> 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=us-ascii Content-Disposition: inline In-Reply-To: On Wed, May 22, 2024 at 07:51:35PM -0700, Guenter Roeck wrote: > Hi, > > On Sat, Apr 06, 2024 at 03:52:02PM +0200, Lukas Wunner wrote: > > Deduplicate ->read() callbacks of bin_attributes which are backed by a > > simple buffer in memory: > > > > Use the newly introduced sysfs_bin_attr_simple_read() helper instead, > > either by referencing it directly or by declaring such bin_attributes > > with BIN_ATTR_SIMPLE_RO() or BIN_ATTR_SIMPLE_ADMIN_RO(). > > > > Aside from a reduction of LoC, this shaves off a few bytes from vmlinux > > (304 bytes on an x86_64 allyesconfig). > > > > No functional change intended. > > > > Not really; see below. > > > Signed-off-by: Lukas Wunner > > Acked-by: Michael Ellerman (powerpc) > > --- > ... > > index da79760..5193fae 100644 > > --- a/init/initramfs.c > > +++ b/init/initramfs.c > > @@ -575,15 +575,7 @@ static int __init initramfs_async_setup(char *str) > > #include > > #include > > > > -static ssize_t raw_read(struct file *file, struct kobject *kobj, > > - struct bin_attribute *attr, char *buf, > > - loff_t pos, size_t count) > > -{ > > - memcpy(buf, attr->private + pos, count); > > - return count; > > -} > > - > > -static BIN_ATTR(initrd, 0440, raw_read, NULL, 0); > > +static BIN_ATTR(initrd, 0440, sysfs_bin_attr_simple_read, NULL, 0); > > > > sysfs_bin_attr_simple_read is only declared and available if CONFIG_SYSFS=y. > With m68k:m5208evb_defconfig + CONFIG_BLK_DEV_INITRD=y, this results in > > /opt/buildbot/slave/qemu-m68k/build/init/initramfs.c:578:31: > error: 'sysfs_bin_attr_simple_read' undeclared here (not in a function) > > This happens because CONFIG_SYSFS=n and there is no dummy function for > sysfs_bin_attr_simple_read(). Presumably the problem will be seen for all > configurations with CONFIG_BLK_DEV_INITRD=y and CONFIG_SYSFS=n. Lukas, can you send a patch adding a dummy function? thanks, greg k-h