Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1516313pxb; Thu, 4 Feb 2021 15:24:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWURG1Y5Ovlm+92DQhWTWDVM/WEVdEXr5UgYp9P6YLiceABIhGjA5s2ZhEa+V4isBx7MhG X-Received: by 2002:a17:906:7253:: with SMTP id n19mr1333687ejk.543.1612481057620; Thu, 04 Feb 2021 15:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612481057; cv=none; d=google.com; s=arc-20160816; b=NvYDZdSCY5fGu8Vptp64AsmOJm1Vqkj+cI9KGjOTJ3LoyMdol4ivjF36cOveFbaOHt C19D8zUcMwZ24t6hE+K9YQu446ee9nZn2/JMps+q9l/rz5FSE/7fEYQ21zItQgSMxKKo rsq6VKMSvTRJR8pwxNQU/z7/eO8uFJXjdBCZUbF8Jrlj+YOrs2Yo2TsILZvlY8dvL87K 7zvekNLMoZys4SViIThKT62Kk2IYW8Cbu3SWRfLPOJksS+AaXciCxUy/TiBfuJibdmX7 gsPuuARXY4AtckMOXhK6MZW7jjlOJuh6gCVxJKAiwhnc+MwFuCemYrDbeB+lQVJhqFce nqVA== 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=/2yNixx5Cn40cEw8VN6H44EvJ0f+Us+nfvY2bMkV9RY=; b=VFBZzz9cWRng6bJP5iOVDzsFemUCTNKWxG1tNtQNKEtQzu1HUQbqB00yKrMLZT7xxh KhJriPIFzKBx6/+h2jdyoZ2YnDoEldsqhc3Rr6cixD6H95szDtR++i3/P1keU0T3S6PU h9TNc1Sko5N+GcXg0T2XsJkXGdVKerWoGlqzlGP9hgt0J5agzcwOnnKzED2ZvhNPPveb 2OTjx7m8VTmOBCfzxl8L2yJJbJaRt6Q5DaGOFY/qg1PP1EiL7uewDxnp1f6A6D/Ab2tK juDTWfbSjcUkte4gAPGo4VF5yJoaRMt5d84QgvohAJBBLEceWKxxSLZWllPpUSm3tm7o Nm+g== 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 m3si4468506edq.484.2021.02.04.15.23.53; Thu, 04 Feb 2021 15:24:17 -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 S233067AbhBDGvX (ORCPT + 99 others); Thu, 4 Feb 2021 01:51:23 -0500 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:55018 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233017AbhBDGvU (ORCPT ); Thu, 4 Feb 2021 01:51:20 -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=e01e01424;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0UNpIj3d_1612421433; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UNpIj3d_1612421433) by smtp.aliyun-inc.com(127.0.0.1); Thu, 04 Feb 2021 14:50:37 +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] firewire: convert sysfs sprintf/snprintf family to sysfs_emit Date: Thu, 4 Feb 2021 14:50:32 +0800 Message-Id: <1612421432-39124-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 --- 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..795f69e 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, "%d\n", (int)(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