From patchwork Mon May 27 05:01:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 165195 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp6698080ili; Sun, 26 May 2019 22:02:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfMtyUrjgMtYDlIa+0cb7FPdFEdnpB9ain6S3kQHALUXVf0NFNLdKetpet9JR2BrCq5ijp X-Received: by 2002:aa7:8c1a:: with SMTP id c26mr133651063pfd.25.1558933349813; Sun, 26 May 2019 22:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558933349; cv=none; d=google.com; s=arc-20160816; b=JrpYlKDeBTaKRaTR5XIRgXxod38p8dphXpkKnrM/pmzLhDFMlonVZHkV4AI9Df5Mpf 7FyI3ElIT6qFYdg2Iuz849aUWwSkwbTRiyqLWEqJDTbPYtB7GfQc5TAjeJlkFv6ObPYI DXPziayw05lqm+3qyEJAMx/5iUIqN7IJBLua+VOGtduxtygtGgnB+IUX7Wq5rFpi/j9x y5HTCbI41Km5JR0ydkP5ksrTg+gvVBG56Y1hAPPyWGvID0bz0vDyaLfUk0CEcq/ZiV/B fbxtsPl4QPuLaR8NQhBYr4EfEW3IQK5HjupOgkiL5riSYKeak+qmM+FhQI2u4u8EfvT5 V/Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=UY2Pl2yFPZpSPMOj8rl10VQ1QNvO0rbW5IF36j6c95w=; b=m7Rzxk/+h2yvvT+2xEJMRmp3Uumz2C64QBdGRhdYiM6JwCTNlGQglB7XRd46OBWsCI xXSfbN+TcxeNq+YGmsyJvkWbjb+OAju9G7VnNcXF/6zRWvMdrjbSMMjsVNkmTq5qxda7 dnUXNaY8Fh5kwxBx6ipm9cuF4ESAMXHJOzcVuHYG6+XJaWqgGjzhNUwbnCqI4LkrT/2a aEM/3/FBUvOmEFjfu3DhIhqwoKJZZ/SCM7tNLP55ZcWbq8kesu9juwgQPz/UgdWgi7tm oUkUflxcgEGW+hKUehjKiproI2y1n4GlgBfD9+fqCNKmWoHH/MFzf1yzogcJ7E4DE610 VAUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m62si16508164pjb.1.2019.05.26.22.02.29; Sun, 26 May 2019 22:02:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726063AbfE0FC3 (ORCPT + 1 other); Mon, 27 May 2019 01:02:29 -0400 Received: from mx.socionext.com ([202.248.49.38]:48343 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726052AbfE0FC2 (ORCPT ); Mon, 27 May 2019 01:02:28 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 27 May 2019 14:02:26 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id C848818010A; Mon, 27 May 2019 14:02:26 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Mon, 27 May 2019 14:02:26 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by kinkan.css.socionext.com (Postfix) with ESMTP id 4956E1A04FC; Mon, 27 May 2019 14:02:26 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 0A229120ABF; Mon, 27 May 2019 14:02:26 +0900 (JST) From: Sugaya Taichi To: Greg Kroah-Hartman , Jiri Slaby Cc: Takao Orito , Kazuhiro Kasai , Shinji Kanematsu , Jassi Brar , Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Sugaya Taichi Subject: [PATCH] serial: Fix an invalid comparing statement Date: Mon, 27 May 2019 14:01:27 +0900 Message-Id: <1558933288-30023-1-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Drop the if-statement which refers to 8th bit field of u8 variable. The bit field is no longer used. Fixes: ba44dc043004 ("serial: Add Milbeaut serial control") Reported-by: Colin Ian King Signed-off-by: Sugaya Taichi --- drivers/tty/serial/milbeaut_usio.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) -- 1.9.1 diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c index 949ab7e..d7207ab 100644 --- a/drivers/tty/serial/milbeaut_usio.c +++ b/drivers/tty/serial/milbeaut_usio.c @@ -56,7 +56,6 @@ #define MLB_USIO_SSR_FRE BIT(4) #define MLB_USIO_SSR_PE BIT(5) #define MLB_USIO_SSR_REC BIT(7) -#define MLB_USIO_SSR_BRK BIT(8) #define MLB_USIO_FCR_FE1 BIT(0) #define MLB_USIO_FCR_FE2 BIT(1) #define MLB_USIO_FCR_FCL1 BIT(2) @@ -180,18 +179,14 @@ static void mlb_usio_rx_chars(struct uart_port *port) if (status & MLB_USIO_SSR_ORE) port->icount.overrun++; status &= port->read_status_mask; - if (status & MLB_USIO_SSR_BRK) { - flag = TTY_BREAK; + if (status & MLB_USIO_SSR_PE) { + flag = TTY_PARITY; ch = 0; } else - if (status & MLB_USIO_SSR_PE) { - flag = TTY_PARITY; + if (status & MLB_USIO_SSR_FRE) { + flag = TTY_FRAME; ch = 0; - } else - if (status & MLB_USIO_SSR_FRE) { - flag = TTY_FRAME; - ch = 0; - } + } if (flag) uart_insert_char(port, status, MLB_USIO_SSR_ORE, ch, flag);