From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56CF4C4167B for ; Mon, 27 Nov 2023 12:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233186AbjK0MhL (ORCPT ); Mon, 27 Nov 2023 07:37:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233180AbjK0MhJ (ORCPT ); Mon, 27 Nov 2023 07:37:09 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADB48182 for ; Mon, 27 Nov 2023 04:37:16 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1141FC433C9; Mon, 27 Nov 2023 12:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701088636; bh=mjtY/xAfKON0Sp8E15Yo20j/7gC9ke0H9DYO5Gi6kng=; h=From:To:Cc:Subject:Date:From; b=flvhiYUVDrOcHMdF6FadIoQqk17m6TgN0YPF81bj0/kz2dvflay3khtQ+4X4QFiS2 1apEOkDMKFP/5DLIS2ZvqDfCoYZ8A2tPG8ATPw2qHKWPfY0+iK7hoTb+P80enOQl7f +0vcseQ8nbRgeF6/KzBjZca6Y5ahKnwDZXbRXaw2L+oEYDjGsa+aidpGYcZXk2X9FV tt2kxJfBGM60aCxAJ8laEYDNNFlcvHlZaXQEL/dKWG9j+ey5gxZOgz1OdBEOCcSwJ/ P9rlcTox09DDRXE5S8srjmkLVLtPY03NIOqT1cRixXS7+L34EXWhlXefNsbVlxBnhF sVkNu3UTZT98Q== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 1/5] tty: make tty const in tty_get_baud_rate() Date: Mon, 27 Nov 2023 13:37:09 +0100 Message-ID: <20231127123713.14504-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 87888fb9ac0c ("tty: Remove baudrate dead code & make ktermios params const"), the 'tty' parameter is only read in tty_get_baud_rate(). Therefore, we can make 'tty' accepted in the function 'const' for clarity. The "the terminal bit flags may be updated." part of the tty_get_baud_rate()'s kernel-doc is dropped as it is no longer true. Because of the same commit above. And it was misplaced anyway. Signed-off-by: Jiri Slaby (SUSE) Cc: Ilpo Järvinen --- include/linux/tty.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/tty.h b/include/linux/tty.h index 7625fc98fef3..e96c85f4f91e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -440,10 +440,9 @@ void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, * * Returns: the baud rate as an integer for this terminal * - * Locking: The termios lock must be held by the caller and the terminal bit - * flags may be updated. + * Locking: The termios lock must be held by the caller. */ -static inline speed_t tty_get_baud_rate(struct tty_struct *tty) +static inline speed_t tty_get_baud_rate(const struct tty_struct *tty) { return tty_termios_baud_rate(&tty->termios); } -- 2.42.1