From patchwork Mon Jul 31 08:59:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 709525 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 DF138C04A94 for ; Mon, 31 Jul 2023 09:00:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbjGaJAL (ORCPT ); Mon, 31 Jul 2023 05:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjGaJAK (ORCPT ); Mon, 31 Jul 2023 05:00:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61E3283; Mon, 31 Jul 2023 02:00:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E97D160F2A; Mon, 31 Jul 2023 09:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D068C433CB; Mon, 31 Jul 2023 09:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690794008; bh=HRgq8PnvNhpR3/55CfJPsOVwTF/5PMq6rz6tiVpFMTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BoZMXKWU9tJV0tkUTimjGAOnp/MFr3ph4Zf4a8PGkLvW6F0Oxnaua4udM0PgNYt7m dGIaSrax3BqYQ1bexEKE+N3UU8KRFm3ggetszu7MqISTcb1BaEEXVNaaaxGeAfIJ2F fPQJRFKLoXBcyD4LsJACB25PTHxCi+K/MqrR82ZPbeYlGsuh9/3wb35CV8ZNF2bEZT 1G7/NSK8WwG49sA3hcrjt6KSvwGGX+pH/3FP6UsRtx8N4R5CPX1Q1L9NNFJeimIOax 0cL+weqnv4CPLSxs2zR+KqomYmuGrw+o91lp/dLDNd9PPLFMoXoGa5kkH8r1wZCjfz ET+6PKS68AYNA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 2/7] tty: synclink_gt: drop global slgt_driver_name array Date: Mon, 31 Jul 2023 10:59:57 +0200 Message-ID: <20230731090002.15680-3-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731090002.15680-1-jirislaby@kernel.org> References: <20230731090002.15680-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org It's used on one place, so put the containing string there directly. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/synclink_gt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 00efed2c139e..c2ab7ecf0900 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -88,7 +88,6 @@ * module identification */ static char *driver_name = "SyncLink GT"; -static char *slgt_driver_name = "synclink_gt"; static char *tty_dev_prefix = "ttySLG"; MODULE_LICENSE("GPL"); #define MAX_DEVICES 32 @@ -3683,7 +3682,7 @@ static int __init slgt_init(void) /* Initialize the tty_driver structure */ - serial_driver->driver_name = slgt_driver_name; + serial_driver->driver_name = "synclink_gt"; serial_driver->name = tty_dev_prefix; serial_driver->major = ttymajor; serial_driver->minor_start = 64; From patchwork Mon Jul 31 08:59:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 709524 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 CE65CC001DF for ; Mon, 31 Jul 2023 09:00:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbjGaJAR (ORCPT ); Mon, 31 Jul 2023 05:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbjGaJAN (ORCPT ); Mon, 31 Jul 2023 05:00:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C7B0E0; Mon, 31 Jul 2023 02:00:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EDAE860DFF; Mon, 31 Jul 2023 09:00:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EBB9C433C9; Mon, 31 Jul 2023 09:00:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690794011; bh=koPLOXpSKm8PLNO/WcSVGaP713T9jox+3iKwaWka9XI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mOF/8lLKzsmsN3VeOBvafYS3/82sJF7zj7BOg9Dg9rwqWIk1unPCX2WwYyQpskZFJ 3x5XBLwN1FThAAt6r2RATPWfFy8f+HJts9itx+QU4lF2uxxon9kaG1fTEv+rL2vrLO pqcJGr0vhGjxDb2RniJEm3GMNbH34sHjUtICcfVlYxeHdFZ0Xhp6AOceE+aZ9mCGCp cV98SHnULawaB3+XFyyhQORoncvQqHYQj62mkz+VeZhruu/qLzxLTsO8llzvLROiPA iX0UOc+ehHAhgCqa1lOkbwn6AodHMYM7MDhkX9Bty5BF9ADoZ352xEhUl+R0YM2cS9 lNitkD0kr3ugw== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 4/7] tty: synclink_gt: drop info messages from init/exit functions Date: Mon, 31 Jul 2023 10:59:59 +0200 Message-ID: <20230731090002.15680-5-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731090002.15680-1-jirislaby@kernel.org> References: <20230731090002.15680-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org It is preferred NOT to print anything from init and exit functions of a module. (If everything goes fine.) Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/synclink_gt.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index a8716a81ac74..4a93e0e48156 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -3628,8 +3628,6 @@ static void slgt_cleanup(void) struct slgt_info *info; struct slgt_info *tmp; - printk(KERN_INFO "unload %s\n", driver_name); - if (serial_driver) { for (info=slgt_device_list ; info != NULL ; info=info->next_device) tty_unregister_device(serial_driver, info->line); @@ -3671,8 +3669,6 @@ static int __init slgt_init(void) { int rc; - printk(KERN_INFO "%s\n", driver_name); - serial_driver = tty_alloc_driver(MAX_DEVICES, TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV); if (IS_ERR(serial_driver)) { @@ -3701,9 +3697,6 @@ static int __init slgt_init(void) goto error; } - printk(KERN_INFO "%s, tty major#%d\n", - driver_name, serial_driver->major); - slgt_device_count = 0; if ((rc = pci_register_driver(&pci_driver)) < 0) { printk("%s pci_register_driver error=%d\n", driver_name, rc); @@ -3711,9 +3704,6 @@ static int __init slgt_init(void) } pci_registered = true; - if (!slgt_device_list) - printk("%s no devices found\n",driver_name); - return 0; error: From patchwork Mon Jul 31 09:00:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 709523 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 78843C001DC for ; Mon, 31 Jul 2023 09:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231560AbjGaJAk (ORCPT ); Mon, 31 Jul 2023 05:00:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230326AbjGaJAR (ORCPT ); Mon, 31 Jul 2023 05:00:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D4EE125; Mon, 31 Jul 2023 02:00:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF6B160FA0; Mon, 31 Jul 2023 09:00:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B3C3C433CB; Mon, 31 Jul 2023 09:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690794014; bh=bqTVXbRunEpODgYOcmi3I5Ad7VnQnc4RQhFgP2aeJGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BP/VyGV5WZSSospGjdgCqfrdB69q2pOjibbP5kmw7UpdGI7w81E8/mtnPCOis6d5q /PSgBubVNxETXQ5EIMx0DRJ4hZld7g1+q6GGhonpo8F3/PFjpHQBi1cxtTwLzA5ehA fr0g6parwBSRuZ136O1NIElrVekImwZqZ4XOx2pG3ic1eaIwwZL6y6sAGye2wgtnj4 lX6MTPVX2EL+KUnFh8pIDFayjGWRPQznVqkzNVwlz8BvJRSY4LpjpJFn5Qp7hsKtmQ DlbKdDeQyRTwV9yGCZJnXVpgCeyG+3yCFaW16AzTHB/vYmBPbSu67Y5nObV8w5srIB +untWsPNXDXkA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 6/7] tty: synclink_gt: make default_params const Date: Mon, 31 Jul 2023 11:00:01 +0200 Message-ID: <20230731090002.15680-7-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731090002.15680-1-jirislaby@kernel.org> References: <20230731090002.15680-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org default_params are only read, so move them from .data to .rodata using 'const'. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/synclink_gt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 381b2e22fa96..fe53e9c2c9b4 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -322,7 +322,7 @@ struct slgt_info { }; -static MGSL_PARAMS default_params = { +static const MGSL_PARAMS default_params = { .mode = MGSL_MODE_HDLC, .loopback = 0, .flags = HDLC_FLAG_UNDERRUN_ABORT15,