Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3984678ybc; Tue, 26 Nov 2019 01:47:35 -0800 (PST) X-Google-Smtp-Source: APXvYqxVD8KphloQRi4VEsgUMOBMHHM1g3Qa6sTxuEBN+RdhSpiEXvay69vQJbGG4Zo2R1c/vLV0 X-Received: by 2002:a50:ed11:: with SMTP id j17mr1433501eds.38.1574761655100; Tue, 26 Nov 2019 01:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574761655; cv=none; d=google.com; s=arc-20160816; b=McAtHDGD20D25E+FRO5L265ny7G8EhfNI0mUIWkRi3d33/Wi6HOk/+2xd+afhzQcoK 2YRfQ5vGxvhCU871iYXvMXzG3BO/q7tk4vY0/OOApZ8N8kxzOy9kpQkj0yBQp2DQQQhR 0AgIJPDPVZeVablf7KGnKBcB9IJH4Xq5IfaLyU9rO7kQbXSdmZxa3mXK6RpfvFRAduxr DR3v1osUy7Xu9r3mJVcNE8WDLfK2jdFmGDNGTRzQVrgQRUYe+d/wuzA8k6PNSLbwvchg YsYVPAU3aM+4b2/oU6a0mz/VymTChMnaEXZD8ftpPItwx99pfTUuf95hAScK6W8MslpB i+vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=veNPiE2apKzT+FnEAHx3BaJpcjwg6Ye+CN/JFRBxxnE=; b=L06PRsOJGdexrU3lrrYHYhJedxmL0Jo68LhFro1D6gqvX+qXi6OBvipCZm+Eier1rK JH0Uy5qyqn7sas/tK9L4Bb9MzxGl/nNTVK+qx5xq1472sGSXsdWpHd2t8xVjEiMUzE5Y xDmbiyTu/0yQrpaXfBv7RkLvzK2lVcjNJiv4ESFIVQ0oOs99x3/gG2Du1rnrmmzWFUWj 7TZb5dDhbtbGuFnkS23qrDUe6U2P5abZpZxQcNCNSlDibkjHOKtsLn6qdvgKPmAQES4M FQvKF1P9fBJ9XTfn9jPfAdg15YCb+0Qik69ZMOq/boo12Hjj6HMJBiOLJg8yF6Xx7p2d YgZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a30si7453709eda.259.2019.11.26.01.47.12; Tue, 26 Nov 2019 01:47:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727672AbfKZJon (ORCPT + 99 others); Tue, 26 Nov 2019 04:44:43 -0500 Received: from mga02.intel.com ([134.134.136.20]:61239 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727397AbfKZJom (ORCPT ); Tue, 26 Nov 2019 04:44:42 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2019 01:44:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,245,1571727600"; d="scan'208";a="220576352" Received: from twinkler-lnx.jer.intel.com ([10.12.91.155]) by orsmga002.jf.intel.com with ESMTP; 26 Nov 2019 01:44:40 -0800 From: Tomas Winkler To: Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, Tomas Winkler Subject: [char-misc-next] mei: bus: use simple sprintf for sysfs Date: Tue, 26 Nov 2019 14:30:02 +0200 Message-Id: <20191126123002.4835-1-tomas.winkler@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace scnprintf with simple sprintf for sysfs files. it is implicitly known that the buffer is big enough for the variables to fit in. Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index a0a495c95e3c..8d468e0a950a 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -765,7 +765,7 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *a, struct mei_cl_device *cldev = to_mei_cl_device(dev); const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl); - return scnprintf(buf, PAGE_SIZE, "%pUl", uuid); + return sprintf(buf, "%pUl", uuid); } static DEVICE_ATTR_RO(uuid); @@ -775,7 +775,7 @@ static ssize_t version_show(struct device *dev, struct device_attribute *a, struct mei_cl_device *cldev = to_mei_cl_device(dev); u8 version = mei_me_cl_ver(cldev->me_cl); - return scnprintf(buf, PAGE_SIZE, "%02X", version); + return sprintf(buf, "%02X", version); } static DEVICE_ATTR_RO(version); @@ -797,7 +797,7 @@ static ssize_t max_conn_show(struct device *dev, struct device_attribute *a, struct mei_cl_device *cldev = to_mei_cl_device(dev); u8 maxconn = mei_me_cl_max_conn(cldev->me_cl); - return scnprintf(buf, PAGE_SIZE, "%d", maxconn); + return sprintf(buf, "%d", maxconn); } static DEVICE_ATTR_RO(max_conn); @@ -807,7 +807,7 @@ static ssize_t fixed_show(struct device *dev, struct device_attribute *a, struct mei_cl_device *cldev = to_mei_cl_device(dev); u8 fixed = mei_me_cl_fixed(cldev->me_cl); - return scnprintf(buf, PAGE_SIZE, "%d", fixed); + return sprintf(buf, "%d", fixed); } static DEVICE_ATTR_RO(fixed); @@ -817,7 +817,7 @@ static ssize_t max_len_show(struct device *dev, struct device_attribute *a, struct mei_cl_device *cldev = to_mei_cl_device(dev); u32 maxlen = mei_me_cl_max_len(cldev->me_cl); - return scnprintf(buf, PAGE_SIZE, "%u", maxlen); + return sprintf(buf, "%u", maxlen); } static DEVICE_ATTR_RO(max_len); -- 2.21.0