Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1492426ybc; Sat, 23 Nov 2019 23:35:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxNy3P8NSfyL5mbJkpPdEWhvq96HVms2xey95jAVFpCzVE9MVWJVuflh6XurZxZmL/fd2Qb X-Received: by 2002:a05:6402:b02:: with SMTP id bm2mr11314057edb.130.1574580932033; Sat, 23 Nov 2019 23:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574580932; cv=none; d=google.com; s=arc-20160816; b=ve/17Z3MBU+h+ccIY8YlNJntu/cuSy8BhHUGOABNbTK7Vc0oiII16uBLc/3bAUcgZ2 6uanvGVELBeb2wS7t0wA0HU5cnaQF+F1C6xGawigI5pO60CiBbyNTa9ml3ht5FRD+1mO 2fFuymYkrvEc3eh6C4DpvxMMSDrYKv/qALWabeE4blrmBa3+xiiJmomBtNYzh59K8F9z o53SdGu2XhL0DXTQShnBF/xZSmZo/Qp9woRv1AbrWEPrwdvuGzihNJ1OcJyTz7eM6cO+ t2L6WYTP4Szanhw1uRT3zguYo1Hw1ddbVWHCBFlB6ah8IV1Q76MJpN+BymisOD5N1XTa oCjw== 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=MvXqyvMCPXJuSRfiU9/7y1nXCrqRPYZD5DWphAgfRhmV8+m6ETHSqE6xIkayGXScWu fXgw8kHJXIAfEeyrdgFee/ED5ViBJiZteTi8ohh9rpybuUwculn0zjDuL+zwCM797OSN rgSq+MiGByyFHD7v8DeMX80dgdYRC2unKnZn4vQIGkOwMaj9veUoActa/964pRfdTN3J 6RtBUtRjTpYFHYWedjjFjC+N0pgGmwpNoDvlIBS/RBL8hamjdi4M2AzWDjLJ/JXkQi5B Pm3f9Ine+QnGnsuxjjs2S/NiNULqBeOL6lVgm4EwhHE7sI1vnfyLD2Xk+FnFOgf2wcY1 xpwg== 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 l23si2686437edc.279.2019.11.23.23.34.31; Sat, 23 Nov 2019 23:35:32 -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 S1726851AbfKXHaf (ORCPT + 99 others); Sun, 24 Nov 2019 02:30:35 -0500 Received: from mga18.intel.com ([134.134.136.126]:57974 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbfKXHaf (ORCPT ); Sun, 24 Nov 2019 02:30:35 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Nov 2019 23:30:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,237,1571727600"; d="scan'208";a="210722847" Received: from twinkler-lnx.jer.intel.com ([10.12.91.155]) by orsmga003.jf.intel.com with ESMTP; 23 Nov 2019 23:30:32 -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: Sun, 24 Nov 2019 12:15:52 +0200 Message-Id: <20191124101552.13677-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