Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5692665pxv; Wed, 21 Jul 2021 11:27:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwba4oQmGJQQ1eXAuWvV23yjSYN7erZglq+0H/qZzifMpjQ9OmHVLsyD6yCNkp8YirVwCeU X-Received: by 2002:a92:c54d:: with SMTP id a13mr12373932ilj.74.1626892062699; Wed, 21 Jul 2021 11:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626892062; cv=none; d=google.com; s=arc-20160816; b=lID3mWOXngTdOeZiALmchQr4YpJKkPTWEWeWq6zkjzDP+9ilV4V3y1xPfvMVuxAna7 4OCawbMysyVD5cIRuDmT0KH+uy/QfIl88iwqgUWWMuA0hcHMYUF9/2sVVJeUvMS1+r00 uqIhUTi2ieT2AgqfpJesszN4i+hdTJJQ7sQttMJDUBvwItQpWcbnVgBTbXM673KmG9F8 hRQ7Opixd+uMt5X+vYKS10TP9PhpTNhuw/KSOCuizEEUY4YGAKcolJEA29QXDZBjiQ35 7dW5NoGzs/bFR4Y5rL0BHy1fzMUzYbzxsGBHICHJ6PIE6uEXKOwzOdEk7tVnwwLli49W Do/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iv3GrYGJUQgZ0uDNyTImICR6X15wuHMecLC2T1/RMXo=; b=sTzaWmFRbgzktX4WZmzzWcUU2M7D9+2MRtQzBSV0azXGH/bVEyD9MT6UrGKtwp+zST d1CpZ8D9mfhSKi6Xq+RTcl9hc+5WZlT9W43PVmYp0XM4QeTVb7SjPhIiMRBWW/MKaVRX aT2Bdz9/fG853i+dCO5BKMXYL1Z5g4cydKr0+EDHb6olzynQsDesPBHqp/U05SMU3DX/ Mvnft7tPnEDJsn0hUirv9k8lq9n/YoEpK8Y1lRGjSECb2GNdXKIQJaIHb8gIjlldqQSb fgYu2Le/8IcZF23frnIuVS5qURZNWZoaeMK7mQ1YtZBmUtMmB3yKUb8nEjkjcWPjd0xU 3Lvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hTH2xDXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si17888613jaf.48.2021.07.21.11.27.30; Wed, 21 Jul 2021 11:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hTH2xDXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238010AbhGUM5F (ORCPT + 99 others); Wed, 21 Jul 2021 08:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238159AbhGUMzi (ORCPT ); Wed, 21 Jul 2021 08:55:38 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D862FC061762; Wed, 21 Jul 2021 06:35:58 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id oz7so3309012ejc.2; Wed, 21 Jul 2021 06:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iv3GrYGJUQgZ0uDNyTImICR6X15wuHMecLC2T1/RMXo=; b=hTH2xDXFTP8YJSxGbXerdWTQWBygjFRpRwTlnBK48BtxbHmHiD86/vC3vzlDTYCYv2 4ylYGWVajaCRpMFqa0yC8bHEJDxD78w3Z9xAcrpWFAqPmBUWqVj4r/kz15KNHQetfrcv 7GXuGvpQR73Okplia/PqeLidI7Bc9eDhA6TnrSV4N5QDmY+4r8hLOyUdI99hB/lwRAnw 1KjdKpYl6z5CkhcDA47andrc+Wu1athTpClVRB5baJn4T9bUf9XBqQcxTG7WHhDHFjgK Zii2YwvXt1VtHRA1KiRGzcCpzcvDfH74idQ3D6+mqAGquzvTY9lbzZaVrPOBov4iYyuz P+6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iv3GrYGJUQgZ0uDNyTImICR6X15wuHMecLC2T1/RMXo=; b=X/W3gKmhdpk0QEO+SqBf6jrPZUjCt5zN93cbXN4RiFrgRU7UQfmo8mdywowibBwRcJ cttKNvSS9apKmWl8CPrZqweuXZLZe80mBo7nrXOoNS9ErAk+DVAJ4Yjsvcg1iyqb/ZS6 uYNCmT4vpzC7eMnAtI5/9+x437TiN7UdGnfbCmXht/L1dP6Pbjy+YVH8ZrdH/jcJexvl ie9A3eamJICgAV6hCkIdwkwSwCYvPXvUM/FD+HVyVioT78jvTMaZ9NifhL2jgyDDS+XX lKE6o4WjyQJceBHjKE33+18Nh+PbmD6bBxS9cZDYdyFAZOGcQOGte18xN6ysYSklnmJc U0oQ== X-Gm-Message-State: AOAM531tLMeXJQvXNUTbYr7UvdlghRbNe6QCZCwWjJZ+ainPvUQwJ92C Wbs8Jebi6j3hLF3uCFCxPOAomJFpJC6usisbPLw= X-Received: by 2002:a17:906:eda7:: with SMTP id sa7mr38847584ejb.135.1626874557379; Wed, 21 Jul 2021 06:35:57 -0700 (PDT) MIME-Version: 1.0 References: <20210721113305.1524059-1-mudongliangabcd@gmail.com> In-Reply-To: From: Dongliang Mu Date: Wed, 21 Jul 2021 21:35:31 +0800 Message-ID: Subject: Re: [PATCH v2] tty: nozomi: tty_unregister_device -> tty_port_unregister_device To: Johan Hovold Cc: Greg Kroah-Hartman , Jiri Slaby , stable@vger.kernel.org, Greg Kroah-Hartman , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 21, 2021 at 9:09 PM Johan Hovold wrote: > > On Wed, Jul 21, 2021 at 08:53:47PM +0800, Dongliang Mu wrote: > > On Wed, Jul 21, 2021 at 8:01 PM Johan Hovold wrote: > > > > > > On Wed, Jul 21, 2021 at 07:33:04PM +0800, Dongliang Mu wrote: > > > > The pairwise api invocation of tty_port_register_device should be > > > > tty_port_unregister_device, other than tty_unregister_device. > > > > > > Are you sure about that? Please explain why you think this to be the > > > case and why this change is needed. > > > > I am sure about this. > > I'm afraid you are mistaken. There is a bit of inconsistency in the API, > but it is *not* a requirement to use the port helper for deregistration > here. > > > 1. From the implementation, > > tty_port_register_device -> tty_port_register_device_attr -> > > tty_port_link_device; tty_register_device_attr > > tty_register_device -> tty_register_device_attr > > > > tty_port_unregister_device -> serdev_tty_port_unregister; > > tty_unregister_device > > tty_unregister_device > > > As to the functionability, tty_port_register_device pairs with > > tty_port_unregister_device; meanwhile, the same to tty_register_device > > and tty_unregister_device. > > Again, this is not an explanation. Why do think it is needed? What could > possibly go wrong if you don't change the code like you propose? > > > 2. From the function naming style, > > > > tty_port_register_device - tty_port_unregister_device; > > tty_register_device - tty_unregister_device > > Yes, the naming suggests you should be using the port helper and it is > ok to do so, but again, it is not a requirement (unless you're using the > serdev variant). OK, I see. Thanks for your information. Next time I will double-check the underlying details of each function to verify if they are in pairs. > > > > > Fixes: a6afd9f3e819 ("tty: move a number of tty drivers from drivers/char/ to drivers/tty/") > > > > > > Please try a little harder, that's clearly not the commit that changed > > > to the port registration helper. > > > > > > > Cc: stable@vger.kernel.org > > > > > > Why do you think this is stable material? (hint: it is not) > > > > From the documentation, this label could make the patch automatically > > go to stable tree. And stable tree is also using the incorrect api. > > No, it is not using an "incorrect api". There is nothing wrong with > current code. And it certainly does not need to be changed in stable. > > Johan