Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp914224pxb; Wed, 3 Feb 2021 23:45:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRGxkH/Ss0RLXbSH2wrx8xK6Ms/74jR07e5caL/1JdbhES7559APJJPsAS8H8lEvN+PMFm X-Received: by 2002:a17:906:b106:: with SMTP id u6mr6716023ejy.313.1612424707931; Wed, 03 Feb 2021 23:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612424707; cv=none; d=google.com; s=arc-20160816; b=u4seNuBT6LwiEEoYGts3fM1k3ozvmNhRyCGnAJHGsxXqoyzU5PaGR9Z3JESjvKWQMD PvwskAGj2H9Af+6zoY5Xk+WKGR/SEFLY7fpr3XMWiibRzyJdqgMA+j2S5vdeTeoD0MnH nN4zy0MdcWVwfKurEb+Uzy9FVoDOy1+ppqtuRpBWPqIupWxPj6hLDMnCZy0gZFmWkram MISM1xx6iDdjU95mrhde6EctZo1DDpXHHYxXDGxG7c8bBTR/D0izdDZt4gYXjxexbFix HoS2iQLauxEaq6zviXix58M7wtpPrm4G3olGvmnEYjusaKb5LeYzs/qcE8jMwUrZH16c IA0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=mF4gC48laHIBzxQNAbb2yJo9lzSAGPX9pZYbizcS1Wk=; b=jhQnvqBgIajkkd+FgoK5tVoZu5QNiWCWC63US2Qq6+LGT3Ll4QPcpMTQSGrS/R3sBL rJn5Vi2D7IRrHxEvZ9fr6oDnDof5RvzrKb6m9+saEAXPxooo2ATCJd2Ff1QIJ0xhIx7f FauRj0615PCgOekgvbyqbxfraQnjI9PpDE+we3p6iCX2ypdlaHzE1MgKkJxqI9qvjqeI uJMjr6Mwtw8F02+mqWuIHI43OKyeOJf42WI/7yr3qqppjXgtO4btQJ3tz6lk9htw8e9J BVj9baG4E4uV6jXo9nZmnqgeDugHv+eqmwvaNA605FgLvaijtMtk0ooTS5xmTPwhkyZJ uPfQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch5si2880211ejb.407.2021.02.03.23.44.43; Wed, 03 Feb 2021 23:45:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234742AbhBDHlQ (ORCPT + 99 others); Thu, 4 Feb 2021 02:41:16 -0500 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:10652 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234750AbhBDHlJ (ORCPT ); Thu, 4 Feb 2021 02:41:09 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0UNqzBz7_1612424421; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UNqzBz7_1612424421) by smtp.aliyun-inc.com(127.0.0.1); Thu, 04 Feb 2021 15:40:27 +0800 From: Jiapeng Chong To: stefanr@s5r6.in-berlin.de Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH v2] firewire: convert sysfs sprintf/snprintf family to sysfs_emit Date: Thu, 4 Feb 2021 15:40:20 +0800 Message-Id: <1612424420-96871-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warning: ./drivers/firewire/core-device.c:375:8-16: WARNING: use scnprintf or sprintf. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- Changes in v2: - Modified print format. drivers/firewire/core-device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 80db43a..25508a8 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -372,8 +372,7 @@ static ssize_t rom_index_show(struct device *dev, struct fw_device *device = fw_device(dev->parent); struct fw_unit *unit = fw_unit(dev); - return snprintf(buf, PAGE_SIZE, "%d\n", - (int)(unit->directory - device->config_rom)); + return sysfs_emit(buf, "%td\n", unit->directory - device->config_rom); } static struct device_attribute fw_unit_attributes[] = { @@ -403,8 +402,7 @@ static ssize_t guid_show(struct device *dev, int ret; down_read(&fw_device_rwsem); - ret = snprintf(buf, PAGE_SIZE, "0x%08x%08x\n", - device->config_rom[3], device->config_rom[4]); + ret = sysfs_emit(buf, "0x%08x%08x\n", device->config_rom[3], device->config_rom[4]); up_read(&fw_device_rwsem); return ret; -- 1.8.3.1