Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp884217rdd; Wed, 10 Jan 2024 02:24:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHc5CJzrfExThqXkTfMAtSgxGars2Ah9aZNAjKPLxW2XF/VPWEt1WgOPUxeU/2CNG+Z+1G6 X-Received: by 2002:a05:6402:120d:b0:557:89bb:37a0 with SMTP id c13-20020a056402120d00b0055789bb37a0mr158586edw.43.1704882292253; Wed, 10 Jan 2024 02:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704882292; cv=none; d=google.com; s=arc-20160816; b=OU3jpelMnChSXdEh/FQ8wdd7uOYyTMmgXFTKY2DIQN8SCz2zaOREhrnSwZGUVUW8Qk kuGKN3eMyVAsiuH5jnHlvEFcQATIJ7D6A7pSCeUUYMpFmwtLi9VV3r7SBb4hY5rZ23Zq dQzZ5TQLk/verg5ammAEhu/HjRtabm8F6oSifUXlB262FPIyedqUqOYHQ+BP9N42ea9t 42x13ISd5pQZnfAaLO14wls1bXYA7ayn3iMEAO6gPzCX+NzfZXm8rEnmmQumvlB+sGXC qMQ/8+XXQKvFn4evNgAVpqOGLFxqN0bgFykn95eDADm5sSSZyM8hviPnmCmZilzX7WbL rlnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zUZkD3RxZyomRUtnLq1bNhUO9I/uygo4/DAHV/FeOS0=; fh=L3T8yf8vSzHphCvhrp7B+WkrE2tyOzsKyWRf66adBdI=; b=VeyoxRg2sZYx9owIwpvqjKCFaNw0LmhduQN2/ePHFt20stTOdTsqNabs9/SzrW8xI+ 8K6g3jTh4fRqChfyUQXvwGuuMNL83144THuvYCfG5AO621X7AnaCXdP9wQiJwnkJISKf LC065V3PxTWsjSzsWTpW3fmPlmnb5D+o2sYVnAwGV4Z52ZRwWFz3Z67oXYO1/5v69CH7 zK5qpYk+z74Y9UtDAcdjrJYS/Z4rzgskOTvsja+NUWh7CySnjgp664sCu69ZLB2M/Cpt z8k7ys5aNJ5WdPFhkx1T6346JgamOz6mTvQ/D0K46QaWCgtBGwoTdXBSkltdIvXV/IfK 9/uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yYSveuyM; spf=pass (google.com: domain of linux-kernel+bounces-21979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b17-20020a056402279100b005566abdc30asi1683097ede.473.2024.01.10.02.24.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:24:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yYSveuyM; spf=pass (google.com: domain of linux-kernel+bounces-21979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CB16E1F28243 for ; Wed, 10 Jan 2024 10:24:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CC88481C9; Wed, 10 Jan 2024 10:21:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yYSveuyM" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89B3147A60 for ; Wed, 10 Jan 2024 10:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40e4582ed74so32219425e9.1 for ; Wed, 10 Jan 2024 02:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882078; x=1705486878; darn=vger.kernel.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=zUZkD3RxZyomRUtnLq1bNhUO9I/uygo4/DAHV/FeOS0=; b=yYSveuyMs5dIyP/53U1mj1nZF+w3Z5vq/5XOV2by6TdQiU6pvh/hhKxfWqAylgUOMm KF/NC+SVesNplooqw5r8RnYkIwQOwpvzmU+cI4vl83fGKi4YqgZ8GYaLUm382PqJT05Z G+FWWGFcl4Wg2qcNVYqFaF5UCAwQnbl579KGCTQpuuBVBGq52zqIHiudcZ71xW5atKqO 1xiZelrkBcF2JjUrjgRYHXcm/hOqWyzVT1afhB92FgZYuyL4IKuWI9w8+enrNqyfLG3C uziI49QNg7DgrKIsi7zNem1j6k8iEvYoMJTzFTvrjjSfMNJGum73aytwRGZtWE7ATzS6 S3Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882078; x=1705486878; 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=zUZkD3RxZyomRUtnLq1bNhUO9I/uygo4/DAHV/FeOS0=; b=t6VjJAr4yCvJEw7YUvfDQujKOV9/WRLZ2i2JAQWlFYRcZf2sVlTOon0b0rHKd1A2Ub EiXV2pN1H8U2aEM5ErYzLvpgbdEjBbIzA5WkIkCzJN3560Eiv0ym4a+UZJQ9uMfrjb88 cXnOGNLFagtiP2zKCM+SuTthn754uRuYqyL/hyAPVSPuvS5GGZxywyM7AWrNohMgcQ/r Amh80DZTh+ndyfJfnqe89g3zFFwMc1b6/Ms8nHLrK/gBclwfGdcA0VOqy8oUAN4QDcQ3 OovqfRhBD4cz4/jZeNm3pj8DgI0gNQJ4CUsPtJ8u2y7B5rIN/siqKeCv2nX2lpq2Sp7d Aivg== X-Gm-Message-State: AOJu0YxxqLf206av6XNIwdxy+3Obr13wyJbne8Yb7VZWyy61HeTD1pw5 COH/XJSq/XQUrhDThAaXHrF7IhaJUElopQ== X-Received: by 2002:a05:600c:45d2:b0:40d:7c1a:cce4 with SMTP id s18-20020a05600c45d200b0040d7c1acce4mr208326wmo.213.1704882078025; Wed, 10 Jan 2024 02:21:18 -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 j7-20020a05600c190700b0040e52cac976sm1625302wmq.29.2024.01.10.02.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:17 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH 13/18] tty: serial: samsung: return bool for s3c24xx_serial_txempty_nofifo() Date: Wed, 10 Jan 2024 10:20:57 +0000 Message-ID: <20240110102102.61587-14-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240110102102.61587-1-tudor.ambarus@linaro.org> References: <20240110102102.61587-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 46fba70f3d77..63e993bed296 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -236,9 +236,9 @@ 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; + return !!(rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE); } static void s3c24xx_serial_rx_enable(struct uart_port *port) @@ -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) { -- 2.43.0.472.g3155946c3a-goog