Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp182320lqc; Thu, 7 Mar 2024 14:09:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWvSiiNJa7uYdMZ3zJEhA66vzEfI73LZ2XFk/JpzRO1paceyvBL7Q+URN1ED9bW0D5CGYJVECw3TSA3Vqz/ryT6ftSFtitr0ej1Y2v6Yw== X-Google-Smtp-Source: AGHT+IEx2EKO2PSMpDHghS7PTQItAMPBD/06wUzyivV+Y2Hm9PxeVsYnvD1fL9EmM17GUxs/5e0M X-Received: by 2002:a17:902:d4c1:b0:1d8:ab27:d76c with SMTP id o1-20020a170902d4c100b001d8ab27d76cmr11359724plg.51.1709849385927; Thu, 07 Mar 2024 14:09:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709849385; cv=pass; d=google.com; s=arc-20160816; b=yeVbnHrSmgvFWrJV5wZ3tkoYMUcOi5X+XAkrCKLA+h+PYKEUfIHGRkap9P/HuK6Q/4 f8BTMopAQlSeGsKHjcSrybyp5mjqxoTeAcvdEvqs/UDNzkrzVI2Qy5GWjIhidF/A6Eb0 r6bmg+S/H+UpyJt+nofJ4beos1Pbw6WW6nJ03CAMkm5k8TShOgvLEuIbcciIpGg2rSFB c62GIHqWC7ktjLc76TK3MpEEPoTc3VV7uvCNNU2uhAQVe3edQRW/jJvTbZqaNjNTNjrI F0Hz5nfu3P+OjBc2qcNqlTYDxR7G8b8xr/Ap6H2BW2VYcnlwajTjsWFwaBZTArsKJsDY 8iBQ== 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=sF9s1Z7BEcmxYylkTlAMzOQNRchPA4Ff4I2HdMY5kFw=; fh=i+4H2CHZ/3qk1vqktUbN6XNjumFyjT9ZiUuLE1pPKME=; b=ak/7k50RPJcslj4XHuKJHDIakIumYqX/FHGq8Fct8Upop70kgvfcgkO6NmqqTMsuUv rkxWzhRg3KA9hm97HvpzVHA2VGqhPsJIq/Qg5iPq5LbZXQive1b1H9GxCohS7Zt4JsHL dmFYmTVN7w5ntRuiG5yoQctWJDxE9EMQx/ZwmQQfT42bUZHDe+18qfDhbYFsNIcAZDFe 3O7/QklepUsfj/5FmFZiikSxJa3JOeqhbWrDVZBFE7vr6bAjh2DTGf3PX8ncDHaClvPB dgk3SruhBCMkS+xRk+hxbWHmGVKpmhiV5ureCdlXqpjoq9rQB6pKbNMXgv6EYg4vZrZZ ltdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EBZBJUiO; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-96302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96302-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id mc11-20020a1709032b0b00b001dd3cdeeaaesi1793748plb.470.2024.03.07.14.09.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 14:09:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EBZBJUiO; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-96302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96302-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E968AB21814 for ; Thu, 7 Mar 2024 22:04:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 775C613C9DB; Thu, 7 Mar 2024 22:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EBZBJUiO" 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 9940A1EF13 for ; Thu, 7 Mar 2024 22:04:44 +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=1709849084; cv=none; b=Ex0+kmaViHQ5PMQKjxkMQnmLnOWpTgRV0/E2bIQLNZ/ZUH8s/VqYkTu9MZiT9OLZygdBdAr3+UkPEKzQp9agFKjuqqgcQtIwPF+zY8z9pmt/Eoq+8e/hgLbozz2UIR+U9R1B8X9Asi6yV7VN+rYoTvIC/uiK7j0jKMBFfwsAkz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709849084; c=relaxed/simple; bh=Xbx7IeZFMT61R6EmLKA7T0kitwSc6IXVHXZOBHCG0cM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gKtSk36okHdUayeGdi2X6QnvZRUxP2iQEmvw+g1owCVJCdE7Z9wh78kxkILGEoFP2ilfuBrV3VLAKkmI3vTjmo01Q+qZx4ycbt4CZ5mC+HwwM0VAOwzzZJKgFBrhVRGBrppdmQToM9sgyuOVELQSPZoKtTvqTzUuLV/PqEcfgFo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EBZBJUiO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BAE6C433C7; Thu, 7 Mar 2024 22:04:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709849084; bh=Xbx7IeZFMT61R6EmLKA7T0kitwSc6IXVHXZOBHCG0cM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EBZBJUiO2DsgaSao58W+Ejt1lEiKt0afwvQ5dnxxr2m+RP5E5P/MgFOX4cVqQ83c4 Da+OZi7CdR3/D+A9q9lgwA3nqIxv9oW0w+dAXsXeL/D5elUaNNu466eBDgJuifgCet BIXHOaKlUh09odPml+KVTmPu4DZCa9lvmrW6Daik= Date: Thu, 7 Mar 2024 22:04:41 +0000 From: Greg Kroah-Hartman To: Alexey Dobriyan Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sysfs: make sysfs_emit() return ssize_t Message-ID: <2024030713-favorably-liking-2135@gregkh> References: <33cd8f96-4b4f-4741-ac05-ef1bd267ce6b@p183> 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: <33cd8f96-4b4f-4741-ac05-ef1bd267ce6b@p183> On Mon, Feb 05, 2024 at 01:11:36PM +0300, Alexey Dobriyan wrote: > sysfs_emit() is most often found in functions returning ssize_t > not int: > > static ssize_t oops_count_show(...) > { > return sysfs_emit(page, ...); > } > > This pattern results in sign-extension instruction between > sysfs_emit() return value (int) and caller return value (which is > ssize_t). Is that a problem? > But it is better to do sign-extension once inside sysfs_emit() > then duplicate it at nearly every call site on 64-bit. Why is that better? Does this affect code generation? If so, how much? And to what affect? And the function itself really is dealing with an int, it's up to the caller to want to do something with that, not the sysfs_emit() call itself. thanks, greg k-h