From patchwork Mon May 21 11:08:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10414691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E6206032C for ; Mon, 21 May 2018 11:09:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4094928815 for ; Mon, 21 May 2018 11:09:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 336FC28817; Mon, 21 May 2018 11:09:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C02FF28815 for ; Mon, 21 May 2018 11:09:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751505AbeEULJb (ORCPT ); Mon, 21 May 2018 07:09:31 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:40756 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbeEULJa (ORCPT ); Mon, 21 May 2018 07:09:30 -0400 Received: by mail-lf0-f68.google.com with SMTP id u140-v6so11024831lff.7; Mon, 21 May 2018 04:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=Qs49kNqyYdlWkCXG3goHRBam0oYyRGTSayYL3KE6vYw=; b=CQ8oyA4SwRPglwxjv9UBsbFtC88L+Hwv3BZkcPP2OEgKz/RpVCd8w/d2Em2LpDcOng QE2oXUVou+r0oJtUroT2n3W1d1mo2TYu7NSCkR54HnY5UNPzYtCQBm47OTS7vr+3XlZN YYmLiuY2o8E4REoVqaynVMVXhWpurnqdqvbIIiuITN7+MHdFpPRfHzVgODAsPQ4tlxc2 WDhmV6jD/IATFQW+YWSfvzbgsZ1Es4za9qHjC8eOaM8Jps9WBoLWWhPAFFbjMpdWB3+H kQprSaCSEbiHQ36RK+Isu6CRiFCxA0AQRSZchZhEcQQVeaeaRzAazM5L5yf4e5RvmbO7 UWPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=Qs49kNqyYdlWkCXG3goHRBam0oYyRGTSayYL3KE6vYw=; b=QdwgcKsYm+qryIm4Na3sWZCUnheUvhedgSBG6ZJYfFq2uy0HUHS4ndwZQjfa/01EGt w1w3473yTGnWXjr98jda0IVPvKSnDX536JKZ1vd32ras0/qbDOuVYn8cFRKZloHzUIem avhSiZk/XaOUGgny3wdM9TdV1+jQd7/SRt1MsJSc7WhvehD9HX+0JlGoXmIn4RWmNuaw ZvAhvQPgk8xwyRtkOnFESC6KXvIclQ5I7UUeIGH0/6tQYXyYzNjzntC+ULExhq6GHGcI HjsevEtcWg6a9smxjHO4snU7ejZ0BA8+OKOIhvx4zv8+lj9U0//VboilEBI4zo+xnru0 Cydw== X-Gm-Message-State: ALKqPwfWEdVYDhm4nqZ4f8hTA22iJPyyiWAeOa4ZO/7i7eoG44jAi1MJ facL+aJ/6LBaI5cjdmmXvXQ= X-Google-Smtp-Source: AB8JxZpsnY4GS1opjluLpXOYdMVXMMXCQt10PBJ7Z/BXjJlxPluuHhimsHVZ+fRnAHq3FgMTyGG8gg== X-Received: by 2002:a2e:9ac3:: with SMTP id p3-v6mr11678698ljj.60.1526900968504; Mon, 21 May 2018 04:09:28 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id f196-v6sm3384129lff.59.2018.05.21.04.09.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 04:09:27 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fKigs-00080N-Te; Mon, 21 May 2018 13:09:23 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold Subject: [PATCH] tty: add missing const to termios hw-change helper Date: Mon, 21 May 2018 13:08:44 +0200 Message-Id: <20180521110844.30728-1-johan@kernel.org> X-Mailer: git-send-email 2.17.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add missing const qualifiers to the termios hw-change helper parameters, which is used by few USB serial drivers. This specifically allows the pl2303 driver to use const arguments in one of its helper as well. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Johan Hovold --- Greg, are you fine with me taking this one through my tree, or do prefer I split out the pl2303 bits? Note that this helper is only used by a few USB serial drivers and that the pl2303 bits depend on a new patch targeted for -next. Thanks, Johan drivers/tty/tty_ioctl.c | 2 +- drivers/usb/serial/pl2303.c | 2 +- include/linux/tty.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index d9b561d89432..d99fec44036c 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -290,7 +290,7 @@ EXPORT_SYMBOL(tty_termios_copy_hw); * between the two termios structures, or a speed change is needed. */ -int tty_termios_hw_change(struct ktermios *a, struct ktermios *b) +int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b) { if (a->c_ispeed != b->c_ispeed || a->c_ospeed != b->c_ospeed) return 1; diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index ac231cdf48a6..5d1a1931967e 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -533,7 +533,7 @@ static int pl2303_set_line_request(struct usb_serial_port *port, return 0; } -static bool pl2303_termios_change(struct ktermios *a, struct ktermios *b) +static bool pl2303_termios_change(const struct ktermios *a, const struct ktermios *b) { bool ixon_change; diff --git a/include/linux/tty.h b/include/linux/tty.h index 1dd587ba6d88..955cd0c93d84 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -527,7 +527,7 @@ static inline speed_t tty_get_baud_rate(struct tty_struct *tty) } extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); -extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); +extern int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b); extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);