Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp143757pxb; Tue, 2 Feb 2021 01:13:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwpN9wFw+s7ZU6PsNj3Dr0Hf8fbrBGxqCgjkgsd8IC1J4j7uUX1w6eCHz1JuRwtdwLIvq/ X-Received: by 2002:a50:d484:: with SMTP id s4mr22691683edi.13.1612257222335; Tue, 02 Feb 2021 01:13:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612257222; cv=none; d=google.com; s=arc-20160816; b=f6Qay7//kS0nDDUn8uYOTQC7TPJWXDhLWD5yrb2rLb5S+GfrfzCGTdBYcCgzwuTp+i 9e3B3R9TKlXK7ZXG29kZy2qBJzUlM8Qlgw9LQXojK0SCZfxR8tT/K4ZWYIye+E/hoyET BhjCcY/9G4aViOeo7jyZ4ej/AohW96DW4ZF7KvhP2nYsicOv24OhlpBCpG/NzVz5xkkT TA4jkxy3ZA9iwcwZHVmdVqbtpWHwHIAAFOhiFsML1YLrh6ecFL/Mdn5+FSZV/c0N2rFm zsObj65AxnvFE+AkWp9tThuEvaMZx+33wz7bhmQ1RtctQlSgrroTfe9bQmG0fvGYLFW5 gqnA== 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=qXjI8hu62U74COeCtHNE25BGeNo49gBAoUqN9eZze00=; b=wXHC6w/drrLA/tPxSePWPvNoo9IkNhj4ReGnR2SZJViLL6UxTgTnFCNAAjf481JVe0 PEXWNAmV3PU6EPMhKfpqVRZPk16yHI/vpImLqtAijvf9i+LJIXhNtIkQo9p/L2ZBXf2p 5umrqEUuuBNz2RTPKIfk24rBQaRiJry7RxFtqb80If/jpyhar5z9m2l1OCEncikyTvte 5qi3OqVyJgORlBz6Oj0TkDSgLoLYaDbpPvsaRqN1he2x4c6d/A4LRebjV32Z8cU/xVG2 YFQsOEWB9SsosBB1lYz8f3VdJb31Tgeu035d75DCVdUrRwTqHTky099L56sMRKthZmZN wE5w== 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 j20si11760818ejy.38.2021.02.02.01.13.17; Tue, 02 Feb 2021 01:13:42 -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 S232842AbhBBJLw (ORCPT + 99 others); Tue, 2 Feb 2021 04:11:52 -0500 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:37935 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232966AbhBBJHL (ORCPT ); Tue, 2 Feb 2021 04:07:11 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R261e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0UNfe6ce_1612256773; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UNfe6ce_1612256773) by smtp.aliyun-inc.com(127.0.0.1); Tue, 02 Feb 2021 17:06:24 +0800 From: Jiapeng Chong To: alexander.deucher@amd.com Cc: christian.koenig@amd.com, airlied@linux.ie, daniel@ffwll.ch, john.clements@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] drm/amdgpu: convert sysfs sprintf/snprintf family to sysfs_emit Date: Tue, 2 Feb 2021 17:06:12 +0800 Message-Id: <1612256772-70147-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/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:220:8-16: WARNING: use scnprintf or sprintf. ./drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:249:8-16: WARNING: use scnprintf or sprintf. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index 541ef6b..2913d57 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -186,7 +186,7 @@ static ssize_t amdgpu_xgmi_show_attrs(struct kobject *kobj, kobj, struct amdgpu_hive_info, kobj); if (attr == &amdgpu_xgmi_hive_id) - return snprintf(buf, PAGE_SIZE, "%llu\n", hive->hive_id); + return sysfs_emit(buf, "%llu\n", hive->hive_id); return 0; } @@ -217,7 +217,7 @@ static ssize_t amdgpu_xgmi_show_device_id(struct device *dev, struct drm_device *ddev = dev_get_drvdata(dev); struct amdgpu_device *adev = drm_to_adev(ddev); - return snprintf(buf, PAGE_SIZE, "%llu\n", adev->gmc.xgmi.node_id); + return sysfs_emit(buf, "%llu\n", adev->gmc.xgmi.node_id); } @@ -246,7 +246,7 @@ static ssize_t amdgpu_xgmi_show_error(struct device *dev, adev->df.funcs->set_fica(adev, ficaa_pie_status_in, 0, 0); - return snprintf(buf, PAGE_SIZE, "%u\n", error_count); + return sysfs_emit(buf, "%u\n", error_count); } -- 1.8.3.1