Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3090790pxf; Sun, 21 Mar 2021 18:45:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5DQRCNNMHGmmOK21j7Kj9M4Mn5VgNr45ZY0FJxfSgwP64ks80s4U76+dhsWayDxAYqByw X-Received: by 2002:a17:906:3295:: with SMTP id 21mr16765989ejw.88.1616377539826; Sun, 21 Mar 2021 18:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616377539; cv=none; d=google.com; s=arc-20160816; b=vCta+QPtB9xpoxgUoUogHsrgyiOnX6uAqh4Oo+eDxOG4tiZrd6bXC1ZriRcdE9P+64 pSi5wGkY+pCWQU4tiL61b2aUtgCrflVcMFYeWlj7m4Y+U75H2SGyNqKtYS6KXCo11/T8 eci2tiK+BW41v1tGBMbnHERA+Owzw8XxoYERZNa2Z3h2giodriECAhQDKH2pvN5kDABe cfwwyUx1rsWwbXqTRLnjFaXk4xdPkMydQdCS5NAElA2YcVFvjQJBxb88CE76rfH18Dgi C5sjO4UXMsNlkR9RYwLxlz50ZGXsagxp/A0pXSo06oNzZ0wod19fgfdUo86s+u4/RXNY EROg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=oIY7wTSvHkfwDkHWUMBXFJTELB1SKsdPpW/CxvrbJww=; b=gLHa2CqpRUxxQL0xv1IHpOP0mCzdmqoSH52HR1iw0WrHL94LxaAOV6cFxZupAIrpmV CL6x1yXNutvKdsmirO15ojIQp0kB3fYxhtk6xzDp8yrX/wxpMY5p35U8brnFfOtk/MO1 AijPkLr5BO+4GFhUVRM9go9VcyGhWg5fd8RKn9B1C3q0r5leQVOKhFkagoeFTgmteqmP OMI/JdyC1xZM3pO63BppVYVWgOKjuduulRApVXvVZSeiCsjzgRrDqKCoOTz+1pccG9p1 +ktokvpflMRkvRHXn8GstjrPrRrFz/aUX/t9JCqqwVSkHD1PGuvKNoAZlUsaz5/wF431 5nag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz20si11092532ejc.70.2021.03.21.18.45.07; Sun, 21 Mar 2021 18:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbhCVBoX (ORCPT + 99 others); Sun, 21 Mar 2021 21:44:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13650 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbhCVBoE (ORCPT ); Sun, 21 Mar 2021 21:44:04 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F3cfh5gDLznTdC for ; Mon, 22 Mar 2021 09:41:32 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Mon, 22 Mar 2021 09:43:59 +0800 From: Tian Tao To: CC: Subject: [PATCH] hwrng: core - Use sysfs_emit to replace snprintf Date: Mon, 22 Mar 2021 09:44:36 +0800 Message-ID: <1616377476-27337-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix the following coccicheck warning: drivers/char/hw_random//core.c:399:8-16: WARNING: use scnprintf or sprintf Signed-off-by: Tian Tao --- drivers/char/hw_random/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 8c1c47d..adb3c2b 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -396,7 +396,7 @@ static ssize_t hwrng_attr_selected_show(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%d\n", cur_rng_set_by_user); + return sysfs_emit(buf, "%d\n", cur_rng_set_by_user); } static DEVICE_ATTR(rng_current, S_IRUGO | S_IWUSR, -- 2.7.4