From patchwork Fri Jan 19 10:45:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523592 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2DEBC47DAF for ; Fri, 19 Jan 2024 10:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V0JHFomiWZHrpcPRULKJicmhQCcM0iiX3bywh5S9hmM=; b=spyJBmg/pqr0aJ fcd6BYEsjgk5hyc0ouiLa3EL99c28nl4sxQXCM8Tzuvw/ubcN0+nUOhc8GMlTFhogwyAVIJg3DIWT sjNWIZ1amK09UNDbATqD3MOkusozgWCsjLMJbR7Hf8H/lhv7lZ1hu3cQ0CM7vG10w8djVGl5p2E5/ 0iTanX7lFU9/F7Agmmszig/67J3Hd2rJhgaDi4CAOLSBCc+YoZjx5TwGhcRE7kH3Q9lDBdgSkYHfx U7lOICMRiGRkZaWuIaHbtfnRiF5k6yJBYgHEV210fS0Hbzvv0js7CvftO1eUfLe5ntW3nYHNUY9z5 8T5tMPLNRojEMmYY1f1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmOR-00584B-36; Fri, 19 Jan 2024 10:46:35 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNe-0057Mh-14 for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:47 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40e9ef9853bso1969465e9.1 for ; Fri, 19 Jan 2024 02:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661142; x=1706265942; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aNVrIVfmeLqNWh0q32FnE3SCbDOH2rJsoikX7ZaHXN8=; b=SK3WQFgcJM7hmLXN+lM3OoAve9cs6stxy5xOwJR8KuJCt22g8hGP4njS/pZWvT/EkU UzqSiawd2j13dt1VyG8K8kkQmbF+WMdMZWOWQ63yehUEy7mpr4VbQrQZlp4ZnN1huKrQ vc2t1JP7EPZTZPLKmMnCM+y+zl+y86tW8Bwgh0PM3h2t3fEEC+yjYLn1/lvymD6wf9J/ IozKmhpFlHOPrki+pZcN6xc2WMqTciXzh0KHGS0daYyzEO1mW+lj3THGXepXU25Mk3e0 VlwrnMX0OJWAVussWGL3M9WoVs5jeON5Hog43PTVc2Pp3A4sRY2zocWlfgrfBesJrOA7 +8nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661142; x=1706265942; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aNVrIVfmeLqNWh0q32FnE3SCbDOH2rJsoikX7ZaHXN8=; b=rAwBm+EolgHXT1ZT19n8g0ryD+keiDU/9ej86L/vqSIffEMSYHWV7KKM6h4yt/xG8W 1kiuKBb+FYYve43saN07zEw9Y56AYvw41FTawOdirlX+s3yY0lIn8d5cTPlKujJGZRdM LscUvuSuGm8FTeTX20pd7WD/4B/0jpxthB4F2KI5iiUEK6MfokyKbRW1Q3AZvFFJcq51 0w33hgSV/l+zap5FTV9+Lq5W1ZstPaxr+AE4q7j7GoSlrs38xi2Tivh0Jx307H4dCtHN GJeeFLWxhh5dNuWt4uRVN1WFzb12VAlvIEQM0JLMd6VBgsuqY7Le3tA9jHzp73UWCjbt crmQ== X-Gm-Message-State: AOJu0Yxg5z2pUm1QpuxdBqbv2h5pfeIhpKKmUNa4iGSi8ShG1cXSJxA7 qx5f1snKs/otuVXe612WK6SkqUjjjU9K8Ix7301A9MDL8/uyZkqBfuSuJKdff9o= X-Google-Smtp-Source: AGHT+IG1Zs80+jewlD9VzzkTPw9eOk7A/qP/u9l55zJeijZCyenfdFg/MX5eIVS2ZxYAe9I/6F6bSg== X-Received: by 2002:a05:600c:1392:b0:40e:360b:e3e1 with SMTP id u18-20020a05600c139200b0040e360be3e1mr497918wmf.13.1705661142682; Fri, 19 Jan 2024 02:45:42 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id fm16-20020a05600c0c1000b0040ea10178f3sm77470wmb.21.2024.01.19.02.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:41 -0800 (PST) From: Tudor Ambarus To: gregkh@linuxfoundation.org, jirislaby@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: alim.akhtar@samsung.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, andre.draszik@linaro.org, kernel-team@android.com, peter.griffin@linaro.org, semen.protsenko@linaro.org, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v2 14/19] tty: serial: samsung: return bool for s3c24xx_serial_txempty_nofifo() Date: Fri, 19 Jan 2024 10:45:21 +0000 Message-ID: <20240119104526.1221243-15-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240119104526.1221243-1-tudor.ambarus@linaro.org> References: <20240119104526.1221243-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_024546_402120_172A30DF X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org s3c24xx_serial_txempty_nofifo() returned either 0 or BIT(2), which is counterintuitive. Make the method return bool, and return true when TX is empty and false otherwise. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 333ffa3a76a3..90d697def5c7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -236,7 +236,7 @@ static inline const char *s3c24xx_serial_portname(const struct uart_port *port) return to_platform_device(port->dev)->name; } -static int s3c24xx_serial_txempty_nofifo(const struct uart_port *port) +static bool s3c24xx_serial_txempty_nofifo(const struct uart_port *port) { return rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE; } @@ -782,7 +782,7 @@ static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) ch = rd_reg(port, S3C2410_URXH); if (port->flags & UPF_CONS_FLOW) { - int txe = s3c24xx_serial_txempty_nofifo(port); + bool txe = s3c24xx_serial_txempty_nofifo(port); if (ourport->rx_enabled) { if (!txe) {