Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2270366yba; Thu, 25 Apr 2019 13:32:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/RNZG+xJ9RPM3zgMafIvmaTGdujoWLHjqXumrQgT9p0t+BZMocDxBCPghFMtiM2uxwCUM X-Received: by 2002:a62:2c89:: with SMTP id s131mr19438953pfs.211.1556224333846; Thu, 25 Apr 2019 13:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556224333; cv=none; d=google.com; s=arc-20160816; b=chTtaCbFTWy21XgnSaBbX04OclxphrhIDX/C6e1foTrM31z8RQW+i0Aa3vIOvV3FbC FMQfswuD1qiAFpoalvi+glwDjKO+EM6h7waKgBq/3nDmWuaqgUmfmuaUZLMfJn8qINOE 1zCQYY8HDo0Lq15P4TeKZyw//ZJp8+VNQQvgwsj3VLEbGFdRd4P2FEHXnGrajcdHB00x vcA4BdTusPi/lRZ5ZaR2RGHFrkf0HV6U1cf6Y9jFbiavoo5FsofgiIeI2p0dJmze8AvA gzw84OL+b/YTDW2IBKHTDrbSjrYBvOYNmntQuQmOAtqt8YQF1ZnRJ2brreuCkdRI7WvK dLqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HWufQS3FJE/WWMl5W9mTvyiAbl/mQMT+oKFDU6MI2Ik=; b=azpHnng7fXcnqYGzX1G2YfVPrzrspuKy1ln3bo5PXc5WaCeD2Z0SH/k1KEFqCu2grr w9osuFZEtycGKIS2FHmBYQ8tlmW07l9SAKxlsrc5/Z8YZ7VCHJ+Y9gKdOyLUqVuIwr5t 5j37RC7PQD8V22VOCYWHm1UIMfbszwReX6RZoQfcElzJyK+7I77NLPM+Qfh/WrI3xwQ1 CgHNJRZB+Z+eUsTyS9C7sYPP3ieYp1bq4N0wabiA3vAOb+IvqAtlrbl7ItH5W0y+zn5J A38/2+u0xhYLM6rf3h7sZCgSho2njYByC8fRadvaqJHWzgaau+uDaRfWaO/59XdY2uvE PyYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t0SSdAS4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b34si24049704pla.381.2019.04.25.13.31.58; Thu, 25 Apr 2019 13:32:13 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=t0SSdAS4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731071AbfDYUau (ORCPT + 99 others); Thu, 25 Apr 2019 16:30:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:53888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730991AbfDYUat (ORCPT ); Thu, 25 Apr 2019 16:30:49 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4438206A3; Thu, 25 Apr 2019 20:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556224249; bh=30cPmhYk9+IDH3/xSH5F9qo31Czy69WZicE1p5RCi+I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t0SSdAS4CWR+ZMG4GTP/ZMxPkJQvvIVWspLmrHd4D5v+b/dDHretkTK2CBHT7moGB qCvCfuRRlXiQGhpnkOGeR5r1B4Kx+JQ2d90t6PvplvFpD9ZKuTqBkZHtThJdtcjdji voZ5JB3taSj934XtmvEtQWv52nwvLNS+xsgDSXLA= Date: Thu, 25 Apr 2019 22:30:46 +0200 From: Greg KH To: richard.gong@linux.intel.com Cc: robh+dt@kernel.org, mark.rutland@arm.com, dinguyen@kernel.org, atull@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Richard Gong Subject: Re: [PATCHv1 4/6] firmware: add Intel Stratix10 remote system update driver Message-ID: <20190425203046.GE22307@kroah.com> References: <1554835562-25056-1-git-send-email-richard.gong@linux.intel.com> <1554835562-25056-5-git-send-email-richard.gong@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1554835562-25056-5-git-send-email-richard.gong@linux.intel.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 09, 2019 at 01:46:00PM -0500, richard.gong@linux.intel.com wrote: > +/* > + * This driver exposes some optional features of the Intel Stratix 10 SoC FPGA. > + * The SysFS interfaces exposed here are FPGA Remote System Update (RSU) It has never been "SysFS", it has always been "sysfs". > + * related. They allow user space software to query the configuration system > + * status and to request optional reboot behavior specific to Intel FPGAs. > + */ > + > +static ssize_t current_image_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + struct stratix10_rsu_priv *priv = dev_get_drvdata(dev); > + > + if (!priv) > + return -ENODEV; > + > + return scnprintf(buf, PAGE_SIZE, "%ld", priv->status.current_image); While it is all nice and fine to try to be "safe" and use scnprintf() it turns out that if you EVER care about the size of a sysfs buffer, your code is doing something wrong. This can just be a simple sprintf() call. Same goes for everywhere in this file. thanks, greg k-h