From: Liu Xiang Date: Fri, 30 Oct 2020 13:43:11 +0000 (+0800) Subject: tty: serial: linflexuart: Remove unnecessary '|' operation and add error count X-Git-Tag: accepted/tizen/unified/20230118.172025~8318^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80f510f5fd078379b772f3b745c49e1db949bb43;p=platform%2Fkernel%2Flinux-rpi.git tty: serial: linflexuart: Remove unnecessary '|' operation and add error count The '|' operation of status in linflex_rxint is unnecessary, so it can be removed. Signed-off-by: Liu Xiang Link: https://lore.kernel.org/r/1604065391-3790-1-git-send-email-liuxiang_1999@126.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c index 3e28be4..d870480 100644 --- a/drivers/tty/serial/fsl_linflexuart.c +++ b/drivers/tty/serial/fsl_linflexuart.c @@ -252,23 +252,22 @@ static irqreturn_t linflex_rxint(int irq, void *dev_id) flg = TTY_NORMAL; sport->icount.rx++; - if (status & (LINFLEXD_UARTSR_BOF | LINFLEXD_UARTSR_SZF | - LINFLEXD_UARTSR_FEF | LINFLEXD_UARTSR_PE)) { - if (status & LINFLEXD_UARTSR_SZF) - status |= LINFLEXD_UARTSR_SZF; + if (status & (LINFLEXD_UARTSR_BOF | LINFLEXD_UARTSR_FEF | + LINFLEXD_UARTSR_PE)) { if (status & LINFLEXD_UARTSR_BOF) - status |= LINFLEXD_UARTSR_BOF; + sport->icount.overrun++; if (status & LINFLEXD_UARTSR_FEF) { - if (!rx) + if (!rx) { brk = true; - status |= LINFLEXD_UARTSR_FEF; + sport->icount.brk++; + } else + sport->icount.frame++; } if (status & LINFLEXD_UARTSR_PE) - status |= LINFLEXD_UARTSR_PE; + sport->icount.parity++; } - writel(status | LINFLEXD_UARTSR_RMB | LINFLEXD_UARTSR_DRFRFE, - sport->membase + UARTSR); + writel(status, sport->membase + UARTSR); status = readl(sport->membase + UARTSR); if (brk) {