Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2C1BC282DA for ; Tue, 16 Apr 2019 13:25:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA7E020821 for ; Tue, 16 Apr 2019 13:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555421154; bh=2e2UXZm4elVl7Hj+9PFJEXvfcyjJ+8Kgm/Yy8oQrUiw=; h=Subject:To:From:Date:List-ID:From; b=AZD3L+u9qeXPtXQQU369G742IiDa5CUwqbO3uRCKd7Fose1edFjVzZ0Rh0zf3YxLl /O98RI3bf5zP6V4KYEmWk5hCqH3XAe49BG68p4yZBb+eiz/Pgh4KDryWkMwYMEF+cT 1KV2XAPNLcB4RbEWYoucfbrl7B5l8xvk41wRWu5I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbfDPNZy (ORCPT ); Tue, 16 Apr 2019 09:25:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:37956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbfDPNZx (ORCPT ); Tue, 16 Apr 2019 09:25:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C924920643; Tue, 16 Apr 2019 13:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555421153; bh=2e2UXZm4elVl7Hj+9PFJEXvfcyjJ+8Kgm/Yy8oQrUiw=; h=Subject:To:From:Date:From; b=novyRMlHbGb6AlY7gubz0LoWFdbqWeGtMjBpoS1TIpKHOqJ+4yqw9/VPbe3Nlbn8Q tPaNT879sch7GgBKFRWOoZyEmu7YY1qrNGNtHIs5vBo7stdVBLH2Sb4BLQHYx8Ux0O 6/dPR7gUledmMormGWv7QkU18uYDFY1O98q6nJJ8= Subject: patch "serial: sh-sci: Fix HSCIF RX sampling point adjustment" added to tty-linus To: geert+renesas@glider.be, dirk.behme@de.bosch.com, gregkh@linuxfoundation.org, horms+renesas@verge.net.au, stable@vger.kernel.org, uli+renesas@fpond.eu, wsa+renesas@sang-engineering.com From: Date: Tue, 16 Apr 2019 15:25:17 +0200 Message-ID: <1555421117211107@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled serial: sh-sci: Fix HSCIF RX sampling point adjustment to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. From 6b87784b53592a90d21576be8eff688b56d93cce Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 29 Mar 2019 10:10:26 +0100 Subject: serial: sh-sci: Fix HSCIF RX sampling point adjustment The calculation of the sampling point has min() and max() exchanged. Fix this by using the clamp() helper instead. Fixes: 63ba1e00f178a448 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment") Signed-off-by: Geert Uytterhoeven Reviewed-by: Ulrich Hecht Reviewed-by: Wolfram Sang Acked-by: Dirk Behme Cc: stable Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sh-sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 55ef6e577f46..3cd139752d3f 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2521,7 +2521,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, * last stop bit; we can increase the error * margin by shifting the sampling point. */ - int shift = min(-8, max(7, deviation / 2)); + int shift = clamp(deviation / 2, -8, 7); hssrr |= (shift << HSCIF_SRHP_SHIFT) & HSCIF_SRHP_MASK; -- 2.21.0