Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1572447pxb; Mon, 8 Mar 2021 00:28:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWY3HEswkXrSa0GUe/QD0d8vGpsgRouaytePcdf1MGps4V0ArdkQfs0sUIshtjGcLiGDA8 X-Received: by 2002:a05:6402:57:: with SMTP id f23mr4856304edu.323.1615192094883; Mon, 08 Mar 2021 00:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615192094; cv=none; d=google.com; s=arc-20160816; b=gi7oZKCTGmXWtq8oQoaEOmBYtWQhZnuSwY5/I49sqcXZXvwhPGTZ6jkgck/7CCVhNI DSFiH+Ub7JMczWeXVoUJgz+qnwLLzDXsF+H3Oaqrta7KCi7RxjqzXfeacyaNmtLSwLGm sS6wLH6aUsPaaxWMT//SBSmHXfH/RFwK3qz+x6mUEI2TiU/2VJ7mr57zTozdk6mxPoZZ 4oJPyI28ZEkrnfUm953ejl4zbYnskmEoRl0VTIO15uUdqehJ7x5J0adCqefDGTgTN2Ui JyU10NQeH0qyu1O3LQhWeByw9VZ48LNvAhC5F9OfQ1lUWgyhWiF4iEUI9wUClIBZH8Vo tdJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Y/j6Cq0L0/qK+bPKbsMfp46b9C06hF4J+uRP7tNJ/uQ=; b=vkijP2csIrB2NHsznNOpgBzq5B/KVldGninWMe45zWi2DGBwmYX78gW/qRq3eY7CAb WSrcyI85O7WJkIdLzu9/2kKbq5bpKmXA0ZI3Lu26C55dnSOG0l2c2wb5Wq+BFZZZjdKn CRxuvmfTkfNyJv8DbIZT7vW2Od2Ro/b/kXFmFWxUp8ASqPc1JusitNYwU1P2ZM3N3YLo qO5CJvCPGzPMzS1+NIlLnrLI7EEfoe32M6fYFugGtoTQ9meqIXsikfe7Wd+2KUR5Ql00 QDRttxw3vmWA8ySUuJPrce2X7e6uSTam6Zm+hWQO7CsrkHTGIOb/qLt+H1f3R5MqzTLw laDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si6269370ejz.383.2021.03.08.00.27.52; Mon, 08 Mar 2021 00:28:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232964AbhCGUqh (ORCPT + 99 others); Sun, 7 Mar 2021 15:46:37 -0500 Received: from mail-ed1-f47.google.com ([209.85.208.47]:46279 "EHLO mail-ed1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbhCGUqE (ORCPT ); Sun, 7 Mar 2021 15:46:04 -0500 Received: by mail-ed1-f47.google.com with SMTP id w9so11670171edt.13; Sun, 07 Mar 2021 12:46:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Y/j6Cq0L0/qK+bPKbsMfp46b9C06hF4J+uRP7tNJ/uQ=; b=pOW19Ie5sD+JbC5rh2BfSlJNI8j+7uGR5isFbWu/cFf5qDZlEW8DJcz1jPmHwjntyv uLIczGsSQHrBM/tc0BKxsjpqHf4ZayicUhyeaSeV1QlYTDPcYyWKdrTGy5gwtHKNzif9 Oh3gB6oDYwGnSE4IpmsQfGh2pxwUrAEOYeac/XzYI9uSsR3BYB6JnoX/GBKAmPBk1Q8T fEObKjwi/8TA4wwxLvDjVFAog4LPT3P6bYP5bYUxqRjqEJrFskhPS7KCaBlFcINOuXbx yX/fX/pUWc+B6xjB9yVIYoscIsP+Q5Pta7mZ5GRtlJLZJJOyNbmVrY+Z91kA4OzoPYUz prYA== X-Gm-Message-State: AOAM531CRyiOslKgUp1GHVCczXhJc78d9cK06rqD0MV4xCf9MeXfQv4q e9qJAMY4UgFg0X0Gl9zgS4U= X-Received: by 2002:a05:6402:158d:: with SMTP id c13mr18828466edv.297.1615149962785; Sun, 07 Mar 2021 12:46:02 -0800 (PST) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id lu26sm5495962ejb.33.2021.03.07.12.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 12:46:01 -0800 (PST) Date: Sun, 7 Mar 2021 21:46:00 +0100 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Niklas Schnelle Cc: Bjorn Helgaas , Narendra K , Greg Kroah-Hartman , Viktor Mihajlovski , Stefan Raspl , Peter Oberparleiter , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [RFC 1/1] s390/pci: expose a PCI device's UID as its index Message-ID: References: <20210303095250.1360007-1-schnelle@linux.ibm.com> <20210303095250.1360007-2-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210303095250.1360007-2-schnelle@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Niklas, [...] > +static ssize_t index_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); > + u32 index = ~0; > + > + if (zpci_unique_uid) > + index = zdev->uid; > + > + return sprintf(buf, "%u\n", index); [...] Would it be possible to use the new sysfs_emit() rather than sprintf() even though the zpci_attr macro and still use mio_enabled_show() still would use sprintf(). What do you think? See https://www.kernel.org/doc/html/latest/filesystems/sysfs.html for the changes in the internal API. Krzysztof