Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2687092imi; Mon, 25 Jul 2022 05:41:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vJuq+7kSu3ajIetIBqeYJ+lHyurrh85JjhFtK2EYpJKgZ5xamolx0VWB47jtI/3yKXR5EY X-Received: by 2002:a05:6402:448b:b0:43b:5ec6:8863 with SMTP id er11-20020a056402448b00b0043b5ec68863mr13030732edb.377.1658752882125; Mon, 25 Jul 2022 05:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658752882; cv=none; d=google.com; s=arc-20160816; b=mgECVrGbYZXc9+JOlwF2JjF4JDn49ydyfZzQxQlh7Io0obfJq7B83JwJmJR5yemDYO 5ZJbkEFbY5G+ZRmTdBDo7bpwrrfo3VhumHLAZE8ulPOLXK5T04TdoOtZyFnpa1pF7HXb vTD2aAJsvakCFYFZk1s+zv2QG6Z3uqRci7nW20jd01Oqn84Zm1tus5s1E9PPz5DeBrcQ b9wxkNc2ZIf6oEiIcbn08/qFQbl2ldo3EwHp17+9OOvOAWglhFveSceEizGP9Od1uwM4 SRxe+3jLmZ4kOCqvErqW16cW5t/+cBc/Da846AMXFJhKjcgZlGavMlN8F1Oe548tP9Cn pAyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=SuBN6W2O2DV/bFqd0blPExFrmfP7qrmcz7woahVc0Ek=; b=yK1xGl8+2tLXHYoTXiKYC3GJLI4w0VuHQ4/tMJZUuDyb3YCpHy84cJvPG5iKcfqH9h MtniXmbHmP/zEhKF9A0uwvDCKT2dBd5yYWrR72RgYMStyMwKdgITLq10Z8i9s4IOYtm+ JAMlAzy/7BWPWQVw56D5G6C8V0NP2uGaapGLOsEubuWnSGWKtvke/Cf/GtPHAm7PSJ7/ wnHzrz1+mayz9I0IRK7IlFNY0Qi7GPTYz2cmBd7/wGxwDyRA6eSxCZC4t1LRK/aWoqr4 tYrUWM7Y2X+lzeA08YzsSP6sBCEEW68rnAh5RqmB5YJofzVFUgkE4cKAnia/2tLokQ3x xB7g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dk14-20020a0564021d8e00b0043a10e5e81asi11861757edb.66.2022.07.25.05.40.56; Mon, 25 Jul 2022 05:41:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235049AbiGYMiY (ORCPT + 99 others); Mon, 25 Jul 2022 08:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231826AbiGYMiX (ORCPT ); Mon, 25 Jul 2022 08:38:23 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4D4BC98 for ; Mon, 25 Jul 2022 05:38:22 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFxLc-0004gS-Ep; Mon, 25 Jul 2022 14:38:08 +0200 Received: from pengutronix.de (unknown [IPv6:2a01:4f8:1c1c:29e9:22:41ff:fe00:1400]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 68AB6B98C1; Mon, 25 Jul 2022 12:38:05 +0000 (UTC) Date: Mon, 25 Jul 2022 14:38:04 +0200 From: Marc Kleine-Budde To: Dario Binacchi Cc: linux-kernel@vger.kernel.org, michael@amarulasolutions.com, Amarula patchwork , Jeroen Hofstee , Oliver Hartkopp , Max Staudt , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2 2/6] can: slcan: remove legacy infrastructure Message-ID: <20220725123804.ofqpq4j467qkbtzn@pengutronix.de> References: <20220725065419.3005015-1-dario.binacchi@amarulasolutions.com> <20220725065419.3005015-3-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="e3oacdo4nyrbeooo" Content-Disposition: inline In-Reply-To: <20220725065419.3005015-3-dario.binacchi@amarulasolutions.com> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 --e3oacdo4nyrbeooo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 25.07.2022 08:54:15, Dario Binacchi wrote: > Taking inspiration from the drivers/net/can/can327.c driver and at the > suggestion of its author Max Staudt, I removed legacy stuff like > `SLCAN_MAGIC' and `slcan_devs' resulting in simplification of the code > and its maintainability. >=20 > The use of slcan_devs is derived from a very old kernel, since slip.c > is about 30 years old, so today's kernel allows us to remove it. >=20 > The .hangup() ldisc function, which only called the ldisc .close(), has > been removed since the ldisc layer calls .close() in a good place > anyway. >=20 > The old slcanX name has been dropped in order to use the standard canX > interface naming. It has been assumed that this change does not break > the user space as the slcan driver provides an ioctl to resolve from tty > fd to netdev name. Is there a man page that documents this iotcl? Please add it and/or the IOCTL name. > The `maxdev' module parameter has also been removed. >=20 > CC: Max Staudt > Signed-off-by: Dario Binacchi >=20 > --- >=20 > Changes in v2: Nitpick: Changes since RFC: https://lore.kernel.org/all/20220716170007.2020037-1-dar= io.binacchi@amarulasolutions.com > - Update the commit description. > - Drop the old "slcan" name to use the standard canX interface naming. >=20 > drivers/net/can/slcan/slcan-core.c | 318 ++++++----------------------- > 1 file changed, 63 insertions(+), 255 deletions(-) >=20 > diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/s= lcan-core.c > index c3dd7468a066..2c546f4a7981 100644 > --- a/drivers/net/can/slcan/slcan-core.c > +++ b/drivers/net/can/slcan/slcan-core.c [...] > @@ -898,72 +799,49 @@ static int slcan_open(struct tty_struct *tty) > if (!tty->ops->write) > return -EOPNOTSUPP; > =20 > - /* RTnetlink lock is misused here to serialize concurrent > - * opens of slcan channels. There are better ways, but it is > - * the simplest one. > - */ > - rtnl_lock(); > + dev =3D alloc_candev(sizeof(*sl), 1); > + if (!dev) > + return -ENFILE; > =20 > - /* Collect hanged up channels. */ > - slc_sync(); > + sl =3D netdev_priv(dev); > =20 > - sl =3D tty->disc_data; > + /* Configure TTY interface */ > + tty->receive_room =3D 65536; /* We don't flow control */ > + sl->rcount =3D 0; > + sl->xleft =3D 0; Nitpick: Please use 1 space in front of the =3D. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --e3oacdo4nyrbeooo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmLejqkACgkQrX5LkNig 010mfgf/cH0YEhypTig+kCqgox8q4agiCCilkZAvzfxC/Krv3IF286RMEQTCQEXW gNG6EGyWJ63niB/Kum4fsG3Rbb7DxiTcjMqqALC7fWmJ1mKro6/lSN2SbO8LAU2B FCa3Cd3HujrZpbaiTo+DXIwQptbEH32GAFWqUL3Pr5IeclMMiaPeAxpPgTXYyP6/ UqOldpT16NDyk+HdxPoieUPkK4ULcUqj7sAJzmPf+1rQWPZCPmFDI9K1l63ZswRz Eoh0S6j1LOKBzYLMmjSyNXts4iEDgxAOpkc188o4vkja9Y0fJghhany+/ojhHn+q TWKAVA20tMR12QAHA5xKhcBRWWtdMg== =I1Pq -----END PGP SIGNATURE----- --e3oacdo4nyrbeooo--