From patchwork Fri Mar 10 16:45:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13169644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41D0EC6FA99 for ; Fri, 10 Mar 2023 16:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbjCJQup (ORCPT ); Fri, 10 Mar 2023 11:50:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbjCJQuX (ORCPT ); Fri, 10 Mar 2023 11:50:23 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F25119FBC; Fri, 10 Mar 2023 08:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678466849; x=1710002849; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=P+cQavtHY/atkpwjlQlWntsoa6QJUnXRT+Gt23ep0Ww=; b=U5EmXpjlHG/y/fH3YBzhKZzG5Z3JbUlVvBCg+UXhU21WFuFhQELNaIZq vSAmKCdr4schqYC79A7b40AzUC0RblE9rDZ5949THcLvTqyb4lAM5TlSD gnHPjp/2TEIY+dBw0fcbWytahqrd7Lsxh1cy3CVyFy9omp+mt5loPEGmv bKH2iIpJqeoVPWPtt55WgLvjxZgkwM+BiY9zfBig+7lTtxVoFvITaKaoV QgiBIkorFLoSWmNSZsE77P14PeUn+rF6/ectolpXTx6Zf2dCuxoZ/a0Ph avDujkhd2dyr0NWBckzmRldSSkjDHgsYfKIotgIlgen4Sa7EWAnzzGdsg A==; X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="320621121" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="320621121" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 08:45:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="746778621" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="746778621" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Mar 2023 08:45:08 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2BF7C354; Fri, 10 Mar 2023 18:45:53 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Jens Axboe , Greg Kroah-Hartman , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/9] pktcdvd: use sysfs_emit() to instead of scnprintf() Date: Fri, 10 Mar 2023 18:45:43 +0200 Message-Id: <20230310164549.22133-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310164549.22133-1-andriy.shevchenko@linux.intel.com> References: <20230310164549.22133-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman --- drivers/block/pktcdvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index ad4336ae9927..98a5c388eabf 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -339,7 +339,7 @@ static ssize_t device_map_show(struct class *c, struct class_attribute *attr, struct pktcdvd_device *pd = pkt_devs[idx]; if (!pd) continue; - n += sprintf(data+n, "%s %u:%u %u:%u\n", + n += sysfs_emit_at(data, n, "%s %u:%u %u:%u\n", pd->disk->disk_name, MAJOR(pd->pkt_dev), MINOR(pd->pkt_dev), MAJOR(pd->bdev->bd_dev),