From patchwork Wed Jan 10 10:20:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13515906 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 739A9C3DA6E for ; Wed, 10 Jan 2024 10:22:16 +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=PlByeNHjt0XxJXH76Lu4GMiI9W+4qqIp69dAwRabp60=; b=IhRs9bp2GCkgcZ BBgtA7pZJlJGb5+91yFafMrSbs57I9CtZmgD2QZj4MquurvgCpZqanfMtuzdCW5Fp5TAHXf1uHAT0 JaygYv+/0bwvrluVAylkXwmrLYuOcPnaOq0pWhEUGPkSvA4SlGZRzLzjvwq57FhA2cooKpDzvhaL/ 5XBVYsjcFKIAhNfHJztZ00pg573FHHzcBizG4VwjdKpT3srP/swMiUJ1UX2Es+5cJmgwWZ5nFTO0D gf99h5ELuoa5vaQPu4AVa7TbT87VO/HPns9MslR8/PqQQctNnotXEgBQCwqTi4HJhjzaBwDFCAWgL ufHzd9mCcyBXRfKSnL6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNViV-00B0Re-1w; Wed, 10 Jan 2024 10:21:48 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNVi2-00B01n-1z for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 10:21:21 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2cd56dac1adso34669931fa.2 for ; Wed, 10 Jan 2024 02:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704882076; x=1705486876; 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=nZqqbWPwYwhLrpcSvI/iFs7tmVPH9J4dNpzf8ql04hU=; b=m3nCaXlXntNYlqqPFVoAOb6goRoLuxVDd8ZoYzVwNFDgdCfXv9QV9FfvLmtSpABcot p+0VUmsvIh2o9w85j557IHsjLfJF+eKJFaBVASRGrR16IHmyzk/iRrXT5mMeN8rJbAv+ hUXkF5+ASXjCXmSMLeIFFiMmSdf7jjWvfPrK9SxV7e5r+F4dWxiINha9QB2Dk8rqX2mm PfinzZOMs5hCE171K/9SdnGFtzqcXorrW6O3i0YmfdUgz0aRxHuTc2fGGSPpSthiGSd5 TbyTvUmNTuBo1TslTqAbcjESu6+fDlldYC9U/jlSU3PRCVLfo6UauJ+HWD5Tp+BWxnJW K8Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704882076; x=1705486876; 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=nZqqbWPwYwhLrpcSvI/iFs7tmVPH9J4dNpzf8ql04hU=; b=rIR75R4qqtrxYTnj24Se+N2KqbbwHGF3WfO35hFvYyQfiw+pfE7A2aW0zvDgdeWfCz hssL2JjKNoO3PerlufJ4+QaEaFK4Zvy2uJMDpBcKnVw2aHPbj/sfX2yodr4ooMji2cd0 EQeB4t89wCwWO6VLP3Al241Re2PWeygov7oT/+m0sENsbqMYyHNVZ+jly64VTKJUVnqJ N10qfuovPEZvnop8X0ZjSFRe2otrZTfvYWvCyuTKvPIqWnl11bHVtnE0YnewaCL5We5V em3uNf1ixc4/s6vtvg57F5YW0qgAknIeN9WE+J7o8HOTji2+JPvtm1NeB8hkQhZqR9Ut xSBg== X-Gm-Message-State: AOJu0YyC+gw0CcEzpo/m9ET/qsn1+9f7qNNP1Idvl5Y0BVQLP9wAFTKj xrSu/MR2GvwKexwg3+3gODgPzqP0zg8RuQ== X-Google-Smtp-Source: AGHT+IHUDinlorp0iKAoAamRhoFsnXh8pnrCQea2LbnsIeK75SvmBljlO0KL8/orqVUjuZxufpV6mQ== X-Received: by 2002:ac2:4554:0:b0:50e:8137:9a10 with SMTP id j20-20020ac24554000000b0050e81379a10mr307722lfm.129.1704882076456; Wed, 10 Jan 2024 02:21:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:21:15 -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 11/18] tty: serial: samsung: don't compare with zero an if (bitwise expression) Date: Wed, 10 Jan 2024 10:20:55 +0000 Message-ID: <20240110102102.61587-12-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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240110_022118_663548_76B2B164 X-CRM114-Status: GOOD ( 11.94 ) 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 Since an if tests the numeric value of an expression, certain coding shortcuts can be used. The most obvious one is writing if (expression) instead of if (expression != 0) Since our case is a bitwise expression, it's more natural and clear to use the ``if (expression)`` shortcut. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/tty/serial/samsung_tty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index dbbe6b8e3ceb..f2413da14b1d 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -988,8 +988,7 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) u32 ufcon = rd_regl(port, S3C2410_UFCON); if (ufcon & S3C2410_UFCON_FIFOMODE) { - if ((ufstat & info->tx_fifomask) != 0 || - (ufstat & info->tx_fifofull)) + if ((ufstat & info->tx_fifomask) || (ufstat & info->tx_fifofull)) return 0; return 1;