From patchwork Mon Dec 14 18:57:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7847061 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC9639F32E for ; Mon, 14 Dec 2015 18:59:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28BB820361 for ; Mon, 14 Dec 2015 18:59:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54542203A4 for ; Mon, 14 Dec 2015 18:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932137AbbLNS66 (ORCPT ); Mon, 14 Dec 2015 13:58:58 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:45349 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbbLNS5r (ORCPT ); Mon, 14 Dec 2015 13:57:47 -0500 Received: from ayla.of.borg ([84.195.106.123]) by baptiste.telenet-ops.be with bizsmtp id tWxi1r00a2fm56U01WxiaJ; Mon, 14 Dec 2015 19:57:43 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1a8YJa-0002tR-0e; Mon, 14 Dec 2015 19:57:42 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1a8YJd-0000Gz-EL; Mon, 14 Dec 2015 19:57:45 +0100 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Simon Horman , Magnus Damm , Yoshinori Sato Cc: linux-serial@vger.kernel.org, linux-sh@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 05/27] serial: sh-sci: Drop useless check for zero sampling_rate Date: Mon, 14 Dec 2015 19:57:14 +0100 Message-Id: <1450119456-964-6-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450119456-964-1-git-send-email-geert+renesas@glider.be> References: <1450119456-964-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sci_port.sampling_rate is always non-zero, except for HSCIF, which uses sci_baud_calc_hscif() instead of sci_scbrr_calc(). Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Acked-by: Greg Kroah-Hartman --- v3: - Add Reviewed-by, Acked-by, --- drivers/tty/serial/sh-sci.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index cc6fa55231ba3536..dfee7a2f51f147d1 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1863,13 +1863,7 @@ static void sci_shutdown(struct uart_port *port) static unsigned int sci_scbrr_calc(struct sci_port *s, unsigned int bps, unsigned long freq) { - if (s->sampling_rate) - return DIV_ROUND_CLOSEST(freq, s->sampling_rate * bps) - 1; - - /* Warn, but use a safe default */ - WARN_ON(1); - - return ((freq + 16 * bps) / (32 * bps) - 1); + return DIV_ROUND_CLOSEST(freq, s->sampling_rate * bps) - 1; } /* calculate frame length from SMR */