Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp263282rwe; Wed, 31 Aug 2022 02:18:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/K3MUGpw8KrAfBDSRXaWpiJntSNSOSW49yojrnbcJ3jeT1f+/Ub47kujnb8zoKVmeuPP6 X-Received: by 2002:a17:902:7c03:b0:172:56b1:8152 with SMTP id x3-20020a1709027c0300b0017256b18152mr25061016pll.16.1661937536165; Wed, 31 Aug 2022 02:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661937536; cv=none; d=google.com; s=arc-20160816; b=tUlw9FdNFw3ApMoiHz76fm9PdNblYdEBVvMkAH97EzZkq0IuPoFPY3C6rvjCPzR3pd 4qQadwPd4t7m3l1PzfJYESHSYquuOhU/bkEir8+nsHUgtAfwbFZVF44Bms//pTdPM5c2 DwIHJboV+ZLh9PgKi8TUPupeMx+CguxoQzm+lX8ZW7c/j/dNv6JJMeqDnoHbQCQaKd/q E+VnNJbbvkDxfDqynIufgFLSjACRSdwLPyqN4L7Yq02g4fto8vgjjGPSJz5FxfejbZDO SwqD005gDzDv/ZHbP27HNl1ITrju2ulsLNldsCR2j1y1L0a6WSnbqtqY9ygr9Vt7DmWc 8naQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=26Dc7y6NWxeC2hFu/fC7SmDBkUmYDy6k4QE9Vjw2usY=; b=bgQbUf6mnQSdGbmzUDso0j1qxELsCKBtViPpR/gDFkI03I29KwP62KcQG+eTVcWSWR J1h3heGwCxg490sgt8biVlfg7P2lCvhn0xpPf+9Jn7kx8DcDV7/QnHAMKAro5a68yqmd wo8o8KT9c1Pq8pMquSOYdlYcYROmFuKTCtZ/MFumF/3AL8S9jEswpXVduioJEMPPdeOB tolR+SUAx6ISPZd5fQb6a2sJ/no+pDIKRWWmvXpjEGDYqDc5jCnKeHkgBDYCjmTDfCj9 mvWmLJvnfONgwA/TfOHmR6oGrmf2BLCOA3LwEvK4FQ/q+W5B2z5t0RUzYhDV6Q8Sj8pL OvsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=oh59g8ea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a84-20020a621a57000000b0053836f22d73si7996350pfa.214.2022.08.31.02.18.45; Wed, 31 Aug 2022 02:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=oh59g8ea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231199AbiHaIMb (ORCPT + 99 others); Wed, 31 Aug 2022 04:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230310AbiHaIM2 (ORCPT ); Wed, 31 Aug 2022 04:12:28 -0400 X-Greylist: delayed 1982 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 31 Aug 2022 01:12:26 PDT Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 029A3BD1C4 for ; Wed, 31 Aug 2022 01:12:26 -0700 (PDT) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20220831073921527a120d4c4c76302e for ; Wed, 31 Aug 2022 09:39:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=26Dc7y6NWxeC2hFu/fC7SmDBkUmYDy6k4QE9Vjw2usY=; b=oh59g8ea4m/iQCLUXttHs97Zi0xPTkZnJapKeJDJ2JX85CQ2H92HUMpoJ601IPUcvlg9Z4 u5CDyfLvRTq9aJmVL8WHcIkYdxUSnn7EDaUewax2YKK3oU4sSjGgAxVdxfORJwTHjRweg3eu Zw68OOSdHytlXecjU7fgCk4KImPQI=; From: "D. Starke" To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH v3 2/6] tty: n_gsm: name gsm tty device minors Date: Wed, 31 Aug 2022 09:37:56 +0200 Message-Id: <20220831073800.7459-2-daniel.starke@siemens.com> In-Reply-To: <20220831073800.7459-1-daniel.starke@siemens.com> References: <20220831073800.7459-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Starke Add a macro which defines the possible number of virtual devices for n_gsm to improve code readability. Reviewed-by: Jiri Slaby Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Added reviewed-by line since v2. No other changes done. Link: https://lore.kernel.org/all/dae848f0-6817-a281-94b3-9d2b6f84c90d@kernel.org/ diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 3fa859a29317..813363825e54 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -164,6 +164,9 @@ struct gsm_dlci { struct net_device *net; /* network interface, if created */ }; +/* Total number of supported devices */ +#define GSM_TTY_MINORS 256 + /* DLCI 0, 62/63 are special or reserved see gsmtty_open */ #define NUM_DLCI 64 @@ -3749,7 +3752,7 @@ static int __init gsm_init(void) return status; } - gsm_tty_driver = tty_alloc_driver(256, TTY_DRIVER_REAL_RAW | + gsm_tty_driver = tty_alloc_driver(GSM_TTY_MINORS, TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_HARDWARE_BREAK); if (IS_ERR(gsm_tty_driver)) { pr_err("gsm_init: tty allocation failed.\n"); -- 2.34.1