Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1521588pxb; Thu, 28 Oct 2021 05:24:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkfxtzB+fAKP9r57NNwGAgzQXTD/oB4/OUDZ01sGbsCJuzbT4x+7t/CAn3v0G//nIGW5ve X-Received: by 2002:a17:907:8693:: with SMTP id qa19mr5159360ejc.154.1635423897784; Thu, 28 Oct 2021 05:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635423897; cv=none; d=google.com; s=arc-20160816; b=nqtgcaDbBDiNth1XUwMbFcBcznAjL57IotDUik5sNYS7oXVn/sbBDR6swJUxqqu1W+ WO6bqXRJUfOJjSYd9UkCIqfyPN7Pnp/QD9WG3Ieh0Qm9ElZmc8KfYkGVH8TTwflMh3+/ rxP+Jpislir2STMO4DPUAx3lgdBDXpEq4SeefEdjwxQTsVUp9GG0iGBD8uJp00JUhnxM BVQWMQRDQ14kpSsa3tA1IibbSd4LBMAQ1jKN2GtrRmwAVwE7S2rNtAn217m8dW3H3ioB 0yAhK+LmcZPSxi3VXZjjOHA3Ush+zUWeUs0LCg22f+pjXJQK+c6l4rlHV7aTI0ljTvGZ hFvQ== 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=jy5GjePngso9jMR/1t7K5Jw0GNktau3SWuUZWboTjA0=; b=c093SjtytxlcOJxt6Y5RyZSy6ObokVpWRedeZC16Tnhzj3PakjjTAOxuqYaXAeY3+N XfyEy+6Xw0TE3hiINx/gZdHpvLs0y23HyzRZFh19swSR05cE7MTkE/vQvBVtOkLvPIyg CgLe5Slr6S7qAcu/kSuCed7a9iWkYm224xfLxdeSr88TDbz+yLvqJpHBTGxVbonEhAFE 42MSfIt/9EqysJFSsdi/ZlnySGYKVZ7sFTW2vRj1nmoBa+YYRgV3hIhs+c2LAv8K9mT8 Ps/g9xYyyOdOgbYVHaJI5YSBriQ1GOMRtCoSBw6HTho+CWr7HHF+oCKY6o6NT7bQZ/Bc feUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="uKX/4zI6"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si3573930edr.519.2021.10.28.05.24.34; Thu, 28 Oct 2021 05:24:57 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b="uKX/4zI6"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230310AbhJ1MYn (ORCPT + 99 others); Thu, 28 Oct 2021 08:24:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:52180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhJ1MYm (ORCPT ); Thu, 28 Oct 2021 08:24:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9807760238; Thu, 28 Oct 2021 12:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635423735; bh=sNViopt2AGTtGw527JuqTqB1yq2eoISJmKY8LUifpCw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uKX/4zI6IWHcPtl7pW3anmaQmlXeBb4YgFJOp/BU2SAJuIN3NW0EEzmC5p7dHppqU zo9JBqBGeQAPw1RDqiumR6BA4dNwpxHy2rXxKscMYKDh6NeF8aA4rzrHDqmmv2kL+X OSh4+0vYvXrL98kcOYjt0aafPlxXSw8FCIOu6MJ3ifW8R1aQ3WyMX2Wyh/FFwn8T52 4eyzLpbMoby1OLMO46v12CZMwzTnczzgeTrQXWxl56o6lgx86VGAf17mzes2ymRjUo XZ8/9Ixb/16kTjsyiuJlM+5ycsJVeEMVEs8ZwhOZTtSvbRlPSwTs0THkgM4um3YTyo z329vdIQiPhVg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1mg4Q9-00053D-8y; Thu, 28 Oct 2021 14:22:13 +0200 Date: Thu, 28 Oct 2021 14:22:13 +0200 From: Johan Hovold To: cgel.zte@gmail.com Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, macro@orcam.me.uk, fancer.lancer@gmail.com, andrew@aj.id.au, pali@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Yao , Zeal Robot Subject: Re: [PATCH] drivers: tty: replace snprintf in show functions with sysfs_emit Message-ID: References: <20211028101350.14172-1-yao.jing2@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211028101350.14172-1-yao.jing2@zte.com.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 28, 2021 at 10:13:50AM +0000, cgel.zte@gmail.com wrote: > From: Jing Yao Where's the commit message? Also, look at the log for the driver you're changing for the Subject prefix you should use. Including "drivers:" is never right. > Reported-by: Zeal Robot > Signed-off-by: Jing Yao > --- > drivers/tty/serial/8250/8250_port.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c > index 5775cbff8f6e..557e8b13b5c1 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -3099,7 +3099,7 @@ static ssize_t rx_trig_bytes_show(struct device *dev, > if (rxtrig_bytes < 0) > return rxtrig_bytes; > > - return snprintf(buf, PAGE_SIZE, "%d\n", rxtrig_bytes); > + return sysfs_emit(buf, PAGE_SIZE, "%d\n", rxtrig_bytes); FFS... This would not even compile, at least not without a warning, as it's completely broken. You do know that you have to at least compile-test your patches, right? > } > > static int do_set_rxtrig(struct tty_port *port, unsigned char bytes) Johan