Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2758500pxb; Sat, 6 Feb 2021 06:53:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOOzIg6ZD7L00CN50/fQE41k17FMrVhLESrCuajZYP6vU2iVbkCNO4tOHu8hF4t8Ljuti9 X-Received: by 2002:a17:906:24d1:: with SMTP id f17mr9085948ejb.503.1612623218863; Sat, 06 Feb 2021 06:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612623218; cv=none; d=google.com; s=arc-20160816; b=wymQ6bA0d7n9op7QPaaFWcfrdtanfMMwx+qm+Lc6MaJlURRM6mOiXNpzpqQfP6MMsE Yyz6mqshe65kPtg4WMar05VjI9HkuG6UwBbLIUhwTODCxpkicoLdkItZkEXXHxhcxDhg xwiE6i8EBRgB2yHFWRDtnwy4Z4ex57KAKMxP4I5rFoDOWWFwVqq8HSoXwMGv6lhP6kWR drrOjvoI98kxp6U/neFeyFh5z/THAhjTG9/ureX4kIhKUSXgge0nYpAF5Z+Xin8U/MQ/ yfMEBCKXxTTAaif/89NEhSysgEiaUui7Ly3O+b39qdfaipJb6/yzQ7ZL/hImyP8xKcxI V7SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BwcKmh4Goamk8W9V0YvfVpHV5ihgMnkNAYY+3EYuyW0=; b=Zqi8tzQ9FT8rybrAtocgTrrA5BD+O5Z2/A3Anfiy6z3+DRtNbB2Tozoy/ajqRPOI5A FFC5OGIKJjv2xDZ/Vlf1GmvB4dr9x3Lxh142On5vnRjJ0s0cVWyl9UG5Qx/PwZ8gKcdC T1/jr5NnqVsVkoB/gTMTCTFqiRRxuTJIr74af1D1owuaQXMSyacPazjj2VusPAa1jLIb ZAehYVicNP8MDkgSVi03fKC/h1fiX/GBSInraDZdIiYTknvTE5bIJDIh6oanNjTuCEwc ikblH06YGOVFgboSt/CWzrxUHwzUnuNPyU81DeOMdlixKReJywQZ7+sZazuY8nCv9W/1 U86w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JiVCcS0a; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si5785272ejy.284.2021.02.06.06.53.15; Sat, 06 Feb 2021 06:53:38 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JiVCcS0a; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbhBFOrh (ORCPT + 99 others); Sat, 6 Feb 2021 09:47:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:45274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbhBFOr0 (ORCPT ); Sat, 6 Feb 2021 09:47:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BB5C64E07; Sat, 6 Feb 2021 14:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612622806; bh=fxpNf6/vSlVy8KoDHlE/p2NI0kE3WPeb0ArfXHTepJM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JiVCcS0asYKhguHBskKR0D6rKTwbTX+XWx3gWtMGyNMsGw7yZZDHOO45j2j25VWOB 6K/z7LTELt7qL25fjQBQbPV5rp3NVdVadMdqcgPr8IGnXth2887jA4a+h/WY3LNvs8 g1Ge/nSvTArb7ZjeDG/g0eNAgrjNMICqSqn4Cet8= Date: Sat, 6 Feb 2021 15:46:44 +0100 From: Greg Kroah-Hartman To: Tomas Winkler Cc: Alexander Usyskin , linux-kernel@vger.kernel.org Subject: Re: [char-misc-next 1/6] mei: use sprintf in tx_queue_limit_show sysfs Message-ID: References: <20210206144325.25682-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210206144325.25682-1-tomas.winkler@intel.com> 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? thanks, greg k-h