Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp252137rdf; Tue, 21 Nov 2023 01:24:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMPzAY4f7m1aKuxB9VjiISbMepnrpZGOmrlB+eyDw5uYgUc8ZikRW4Q2IIUZiXLQFCClnE X-Received: by 2002:a17:90b:4ad2:b0:283:2652:3d20 with SMTP id mh18-20020a17090b4ad200b0028326523d20mr3319839pjb.9.1700558641872; Tue, 21 Nov 2023 01:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700558641; cv=none; d=google.com; s=arc-20160816; b=AA+p2jDql0RObOGO2HjcrfAtpMXlz7S3C8ERRM7W05wK4icrePJQztJPIxwV26xIJF qd6pBihedyrZ2rIh0am/eytnKfS9ITKDsLH39WWWY410CPSwWCnJuXnOxi3HnhjcEsGF 98LLhtfulCpFFRGCbjGD1/uDSi715/GUXUsJdzvCC9+38FU2ckL9lc6beIwI8NIHra44 OvkTjM0sDhgc+xFb3EFMEKh9ZryQnjDY4KDpl6f8H2fPS+xeLkJ4/7PByutMMuCV35w8 yBU2izIW/wxK+K8WymZx6woMYhx91p5j6U+J2arx7IaYZLdx4PLWhyYzXNDU/F629fjV zJVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NJiF9qbw5HUghqtuQqJp3sd3HMAl9EQ4iwjK4TJhZWA=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=P1ue3HGzAXp3ej5R6EJvWKHxuHs9IrLuj/DbmbXyWgRz/kdysp8+fb60GOrK1xFF22 8TG6iNumDdNQ2MnlsHAm7UzBDEqq1VcyIMV4VNSfMNRE3XSHU1iUla94dmhQxu1R2BRe MfH3pXZYjXP3jEF60LJ5fK2rrit55cwfNF1j2jiQPnntmU281ZdvAtPujI7Zq7CxDZbA DF/9+mmJC2pt0TwnBMkZtP1RfuFzF+G7N/bgIVZRlezWIuoM40IfC9XMVRR3MbvAJ0jb yNwUyLX+uTnkQBPPtkTWDku7Es5jKDmAO29/IgsL3gARz3nhNiXuhCFAnviJQD2hrQQQ OUzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkyjypYt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id gd5-20020a17090b0fc500b002683f507990si12153976pjb.109.2023.11.21.01.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 01:24:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkyjypYt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 578B6804EE7E; Tue, 21 Nov 2023 01:23:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232073AbjKUJXP (ORCPT + 99 others); Tue, 21 Nov 2023 04:23:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbjKUJXK (ORCPT ); Tue, 21 Nov 2023 04:23:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 576FE116 for ; Tue, 21 Nov 2023 01:23:07 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7DF2C433C8; Tue, 21 Nov 2023 09:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700558587; bh=NJRodWQw+P7zL14JGGfRqGN5XnSMc52Tx2CPIuB6IKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkyjypYt3IQbbl2DgXKlWlx+F+UoQfxwd8yzxqY0lHe6HGCuSS2oSFNfqX0nS0vfq k8B39ggdcyrEdbx3PbFrpLi2043eD+f4YrGXcroBXXw/mv86qoPx/L8OYvI32DH2it gTbTxLv/4+uDEvWTAN79xoW+KA0MdM68GsjAnc3iJtNw0CCeoWx9Dt7TSKnSSGIfwh 8IMnaus9PxGkEu3vMi9C7V7sMzUpBstBXg0xDPGzfG99gFRM4Hvhtmtd8jpRPIbKao UVYfeEuYQjaF6c5L/907W8wtaig9AKQbP1K7nJF99oQNhH2q1/4QLjyL0q2mF52PWu PQHM2ZbN5Dnfw== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 02/17] tty: remove unneeded mbz from tiocsti() Date: Tue, 21 Nov 2023 10:22:43 +0100 Message-ID: <20231121092258.9334-3-jirislaby@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231121092258.9334-1-jirislaby@kernel.org> References: <20231121092258.9334-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 01:23:47 -0800 (PST) 'mbz' in tiocsti() is used only to pass TTY_NORMAL to tty_ldisc_ops::receive_buf(). But that can be achieved easier by simply passing NULL to ::receive_buf(). So drop this 'mbz'. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/tty_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index ee5a90f9adb5..005d91c63707 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2280,7 +2280,7 @@ static bool tty_legacy_tiocsti __read_mostly = IS_ENABLED(CONFIG_LEGACY_TIOCSTI) */ static int tiocsti(struct tty_struct *tty, char __user *p) { - char ch, mbz = 0; + char ch; struct tty_ldisc *ld; if (!tty_legacy_tiocsti && !capable(CAP_SYS_ADMIN)) @@ -2296,7 +2296,7 @@ static int tiocsti(struct tty_struct *tty, char __user *p) return -EIO; tty_buffer_lock_exclusive(tty->port); if (ld->ops->receive_buf) - ld->ops->receive_buf(tty, &ch, &mbz, 1); + ld->ops->receive_buf(tty, &ch, NULL, 1); tty_buffer_unlock_exclusive(tty->port); tty_ldisc_deref(ld); return 0; -- 2.42.1