Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2765278pxb; Sat, 6 Feb 2021 07:05:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKEMt/zCUqU5GzzMdCGY1Ejr5AonmksSU6geEx5ISxKPBPjzgYhxJDEScfZ/Y6Nz7Qe88s X-Received: by 2002:a17:906:c09:: with SMTP id s9mr9172850ejf.539.1612623922601; Sat, 06 Feb 2021 07:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612623922; cv=none; d=google.com; s=arc-20160816; b=YXO9CpE9cmEVpl+hO32VGjPBm3hVVUppgQJM9Bkn8EnzGON9mZfMhk6xUvWl/TsguH dLSCNLlDvnJjvPjAoXprZEOpmmqvE0TTnuXEKMzM1TpbAMJIS58KWssak2LfGmlx4Mfc gozEnredu/c8JttSKIGbcBoz6RvYeCMTpPDT8yR6YcwuL9E2CVQpqaXgRkHtlN9LPVYA 8D4ERk6zOpoxc4x0kIZg85hHuBT/gTSC0HxOhPb0F+BpgdJeiYOk7OL5uU2nyCCCtIZa SXib7FQeZkRF6QDOB4GbFpjhEWHYaiP+WdCuww8cUzGKscOCinx1Gvw8InxM3wFhGmPY S0dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :dlp-version:dlp-reaction:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=iXtrpk7Tj1QNz/ZtV5tBpwJqVNI8nO+VN08RQwXMWvY=; b=iCXmUDNGBkJopVdWHmbuhDGRL8v4yfSpkNJnYL80vfkRUAr9olNrJEPq9dHq4mU2+Z GBA3ee9uP5D7kj5b82dVdh3roHYNWuK8w7wldEHWhpAVinGlA9crKN/OjJCSrbSmn3S5 C0Z3rNns4+Bf9mnrNQTyipwdtffgwF7qa9qQVqOqGf8UwS7+p23ZqT/blAR9ewgxLJPy VLi6O7XoQsDaHepCvqBBzPut9UxGxJTStcYCpNinJogm842AY81CzNeglLtd/BpNalGO /N2ElzUvYYGa5Q35FhAZRnhKX5uRpvrjjItMrKjTowCm+mF7LbIn2U430kkorxC7Ga1D z5cg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si7737348ejb.238.2021.02.06.07.04.57; Sat, 06 Feb 2021 07:05:22 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbhBFO7i convert rfc822-to-8bit (ORCPT + 99 others); Sat, 6 Feb 2021 09:59:38 -0500 Received: from mga03.intel.com ([134.134.136.65]:8762 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbhBFO73 (ORCPT ); Sat, 6 Feb 2021 09:59:29 -0500 IronPort-SDR: qQhblP2XlZa25FyLO4lrJpcW65UidPMaqJPDyEWM2kqeppJVS10u2SwhJtgzXLfuTweJ1SEOc2 N7qSpTelZH1w== X-IronPort-AV: E=McAfee;i="6000,8403,9886"; a="181609195" X-IronPort-AV: E=Sophos;i="5.81,158,1610438400"; d="scan'208";a="181609195" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2021 06:58:48 -0800 IronPort-SDR: H7+jjMBA0i8FQSLN04oORNx8Jt/lLfcaVi+Cm9WET5szUMfJxNqEvpjzaM+YJblC0PLuZhT2F6 kKm+VhDBhjWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,158,1610438400"; d="scan'208";a="373769466" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga002.jf.intel.com with ESMTP; 06 Feb 2021 06:58:48 -0800 Received: from lcsmsx603.ger.corp.intel.com (10.109.210.12) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sat, 6 Feb 2021 06:58:47 -0800 Received: from hasmsx602.ger.corp.intel.com (10.184.107.142) by LCSMSX603.ger.corp.intel.com (10.109.210.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 6 Feb 2021 16:58:43 +0200 Received: from hasmsx602.ger.corp.intel.com ([10.184.107.142]) by HASMSX602.ger.corp.intel.com ([10.184.107.142]) with mapi id 15.01.1713.004; Sat, 6 Feb 2021 16:58:43 +0200 From: "Winkler, Tomas" To: Greg Kroah-Hartman CC: "Usyskin, Alexander" , "linux-kernel@vger.kernel.org" Subject: RE: [char-misc-next 1/6] mei: use sprintf in tx_queue_limit_show sysfs Thread-Topic: [char-misc-next 1/6] mei: use sprintf in tx_queue_limit_show sysfs Thread-Index: AQHW/JZ1OmeVbG9b6UmW8NQyyplctapLExIAgAAkUkA= Date: Sat, 6 Feb 2021 14:58:43 +0000 Message-ID: <32de2e88c66d467fb2eafe8d20bc280d@intel.com> References: <20210206144325.25682-1-tomas.winkler@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.22.254.132] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sat, Feb 06, 2021 at 04:43:20PM +0200, Tomas Winkler wrote: > > Using of snprintf is discouraged in sysfs. > > For simple u8 it is safe to use sprintf. > > > > Signed-off-by: Tomas Winkler > > --- > > drivers/misc/mei/main.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index > > 9f6682033ed7..24a05f45b639 100644 > > --- a/drivers/misc/mei/main.c > > +++ b/drivers/misc/mei/main.c > > @@ -1026,7 +1026,7 @@ static ssize_t tx_queue_limit_show(struct device > *device, > > size = dev->tx_queue_limit; > > mutex_unlock(&dev->device_lock); > > > > - return snprintf(buf, PAGE_SIZE, "%u\n", size); > > + return sprintf(buf, "%u\n", size); > > If you are going to do this, why not just convert it to use sysfs_emit() > instead? I thought it's an overkill, but if you prefer that I will resubmit. Thanks Tomas