Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1222471iol; Sun, 12 Jun 2022 09:24:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjQu0j1UDYSST1tyN64UJv5gxStAr+7IFZ3YJfjolR9XUqZvjhcqCAce0RXioq5In8y/1k X-Received: by 2002:a17:902:d583:b0:167:6e70:7953 with SMTP id k3-20020a170902d58300b001676e707953mr39245830plh.168.1655051096346; Sun, 12 Jun 2022 09:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655051096; cv=none; d=google.com; s=arc-20160816; b=DQ8uUVQ5dwcp3dIxSeAS8fVRlpvSl7AM21OBKLyXEqkRT+oz5RcSyJ/kGDdy/a2Cac 5urtWE+6TAtmKzAtSRh8+GEa+sZ1hfgV6XLQoSGL/qNg5zw10Eo3zeH3uNQEt8Qebt9H 0/Q2FqJDqCMXW1/9UjsIU7mikMeWmCAHSy9c6qtJJJiQ4XyA0kjZHrcyqorp6DgD++My nMVcgA9ez44P7JUTGZVxOqVRy9Ma7aVGwibj6/XsvO5Yg0oaeGGzkWGneteEuKrPIllP CgBRrtuipGiThitHEY1nSb8YWaWPkrTAc18DwGazUUjqrjyItPGRSlX7WpTNq3ZrOeOp Il1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=kG9a24ycc71KHYso5mVXI85kngzOOQOQsRIdLabkULM=; b=rc9oOslVERhRF0ZEuo6HpXeSUBPGQg6q6U4Laa+oxiBVGqo9pjdPCIhmcBQ8KdyrJq eobJx75Sklq1CBjdL3fgbgmf2lbFcrX6ap92wow8mlxXQVwWf5R3TxB03bIzAVBUrHNN +b9AuR8k/4qqPyquI7zrwYV48mKkJFuFJQ/xLBrhL0/6GtbZxBAIM3FCyDMnh3JjJlPr BbLgKk1UWYJ9hl8Fh40VtD4+LL/TIjZt69vRXUDRDYeFyGhwJwknDURac+71A6ZZe0MC x2/clfidteQ8DyM48fbm32DJbdIPIW1oDB8JFHQSLYxrmSX/QGV3suUwovMXl9fjXVW0 KGsQ== 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 k17-20020a170902c41100b00161d4849a90si8619369plk.575.2022.06.12.09.24.44; Sun, 12 Jun 2022 09:24: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; 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 S231453AbiFLQXL (ORCPT + 99 others); Sun, 12 Jun 2022 12:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbiFLQXK (ORCPT ); Sun, 12 Jun 2022 12:23:10 -0400 Received: from mail.enpas.org (zhong.enpas.org [46.38.239.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 92AB3579B6; Sun, 12 Jun 2022 09:23:09 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id EAF23FF9E2; Sun, 12 Jun 2022 16:23:07 +0000 (UTC) Date: Sun, 12 Jun 2022 18:23:02 +0200 From: Max Staudt To: Dario Binacchi Cc: Oliver Hartkopp , linux-kernel@vger.kernel.org, Amarula patchwork , michael@amarulasolutions.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Marc Kleine-Budde , Paolo Abeni , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2 05/13] can: slcan: simplify the device de-allocation Message-ID: <20220612182302.36bdd9b9.max@enpas.org> In-Reply-To: References: <20220608165116.1575390-1-dario.binacchi@amarulasolutions.com> <20220608165116.1575390-6-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Sat, 11 Jun 2022 12:46:04 +0200 Dario Binacchi wrote: > > As written before I would like to discuss this change out of your > > patch series "can: slcan: extend supported features" as it is no > > slcan feature extension AND has to be synchronized with the > > drivers/net/slip/slip.c implementation. > > Why do you need to synchronize it with drivers/net/slip/slip.c > implementation ? Because slcan.c is a derivative of slip.c and the code still looks *very* similar, so improvements in one file should be ported to the other and vice versa. This has happened several times now. > > When it has not real benefit and introduces more code and may create > > side effects, this beautification should probably be omitted at all. > > > > I totally agree with you. I would have already dropped it if this > patch didn't make sense. But since I seem to have understood that > this is not the case, I do not understand why it cannot be improved > in this series. This series is mostly about adding netlink support. If there is a point of contention about a beautification, it may be easier to discuss that separately, so the netlink code can be merged while the beautification is still being discussed. On another note, the global array of slcan_devs is really unnecessary and maintaining it is a mess - as seen in some of your patches, that have to account for it in tons of places and get complicated because of it. slcan_devs is probably grandfathered from a very old kernel, since slip.c is about 30 years old, so I suggest to remove it entirely. In fact, it may be easier to patch slcan_devs away first, and that will simplify your open/close patches - your decision :) If you wish to implement the slcan_devs removal, here are some hints: The private struct can just be allocated as part of struct can_priv in slcan_open(), like so: struct net_device *dev; dev = alloc_candev(sizeof(struct slcan), 0); And then accessed like so: struct slcan *sl = netdev_priv(dev); Make sure to add struct can_priv as the first member of struct slcan: /* This must be the first member when using alloc_candev() */ struct can_priv can; > The cover letter highlighted positive reactions to the series because > the module had been requiring these kinds of changes for quite > some time. So, why not take the opportunity to finalize this patch in > this series even if it doesn't extend the supported features ? Because... I can only speak for myself, but I'd merge all the unambiguous stuff first and discuss the difficult stuff later, if there are no interdependencies :) Max