Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp580525pxb; Thu, 15 Apr 2021 01:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS2nYJdx9vuLmAOHHp70yApwxP5rNhseCnu8QzSpTmIxpRQPbgwpH1Q6iPytzfzlCuObfX X-Received: by 2002:a17:90a:a0c:: with SMTP id o12mr2513146pjo.184.1618474997878; Thu, 15 Apr 2021 01:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618474997; cv=none; d=google.com; s=arc-20160816; b=Sh0vnD+Jb5wQaPshkFMan5s8sATbj4+IJVoT9b3hgOwpA/uuwuZfyoW+Vq5R6qGKoi 6wCogyGdecQe6fFfildQr7PHNfc8jlsPxEfQiGzh+7kSxl2dYe3OBitVcXpSN/8h/hn5 S7tkCqjKlxzzNf/anFuBru827mcTKm47/tgL/VxV2uEEsRB1Uam/F242rvKeO8hYcRVX wsm+VhpAfzDHs3BmkEfoIEtLo4YCyrDoj2Eta9f5kIzdz8P33B4Sl5Hvk/NOgDwYqHyn LRB/itRCGIgSORPYyv2tc4BMbXbzKgm5531t583mar8+f6kUyvM/g00FEkhOoknVk+wq LwcA== 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:dkim-signature; bh=pbKdWWuwgaQvlYNt0ZoJr2R6mKmJw4vhHz8TDk/zg6Y=; b=L+h8HlCz7FZoZmJyE57sMMUIHEfTF7QgFUlX5DovpYz1emz6Py1NLpULuZ24z0uXjy tJbhrZJfaqJOJodTTxHBbCk93fCeASRW9+cgBz9lKzceenZQMeN6kU/Mrj9iWUY5Qclv GvlGEYixttPKhKA54Dld2m3H4fN8y5ypXnnr39Q4ZgXDjsZML/95XO3RCtuCguNnpKaN KMmg/iFPWNeWck4iv8acM+Q5bBVAgkjXBiFuVWpnhPSlvNBDIZViCeRDHB1VW+JFwtoC 1V0CNDRc39ReXJEgTw9rbpvN0QcEfXTejVhC84jBE0BO1jRrjaUXiq8K7+mSUffyKbin ACVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LLBtLksN; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si2414454pgv.60.2021.04.15.01.23.05; Thu, 15 Apr 2021 01:23:17 -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=@linuxfoundation.org header.s=korg header.b=LLBtLksN; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231601AbhDOIWV (ORCPT + 99 others); Thu, 15 Apr 2021 04:22:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:59000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231388AbhDOIWV (ORCPT ); Thu, 15 Apr 2021 04:22:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 94372611AC; Thu, 15 Apr 2021 08:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618474917; bh=MzgBwo6AvTH3Xni+y03+CAO5/Yr7OdgG7HKKkkwlV5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LLBtLksNikM5Oy26xFOqMe0HES0hX/EkAWnX2quUoqQn8cobXY1ABlJwAOH2+rC7c 3eWHg4n6J4qfoWP5KWrgEGdEnPSAla2IIleDywNSdSpXtS/Q0pGQap5MyYOhMn6oce QtvPYLoP0X9jOGUPhiRlwOkx1ccQKHL1FM8qfmP8= Date: Thu, 15 Apr 2021 10:21:54 +0200 From: Greg Kroah-Hartman To: Johan Hovold Cc: linux-kernel@vger.kernel.org, Tetsuo Handa , Jiri Slaby Subject: Re: [PATCH 00/13] tty.h cleanups Message-ID: References: <20210408125134.3016837-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 09, 2021 at 09:32:45AM +0200, Johan Hovold wrote: > On Thu, Apr 08, 2021 at 08:01:08PM +0200, Greg Kroah-Hartman wrote: > > On Thu, Apr 08, 2021 at 04:25:22PM +0200, Johan Hovold wrote: > > > On Thu, Apr 08, 2021 at 02:51:21PM +0200, Greg Kroah-Hartman wrote: > > > > Turns out there is a lot of tty-internal stuff in include/linux/tty.h > > > > that do not belong there. Create a internal-to-the-tty-layer .h file > > > > for these types of things and move function prototypes to it instead of > > > > being in the system-wide header file. > > > > > > > > Along the way clean up the use of some old tty-only debugging macros and > > > > use the in-kernel dev_*() calls instead. > > > > > > I'm afraid that's not a good idea since not all ttys have a > > > corresponding class device. Notable exception include pseudo terminals > > > and serdev. > > > > > > While dev_printk() can handle a NULL device argument without crashing, > > > we'll actually lose log information by removing the tty printk helpers. > > > > I think the same info will be printed here as before, just some NULL > > information at the beginning, right? And the benifits overall (for real > > tty devices), should outweigh the few devices that do not have this > > information. > > No, you'll only be losing information (tty driver and tty name). Here's > a pty example, where the first line in each pair use dev_info() and the > second tty_info(): > > [ 10.235331] (NULL device *): tty_get_device > [ 10.235441] ptm ptm0: tty_get_device > > [ 10.235586] (NULL device *): tty_get_device > [ 10.235674] pts pts0: tty_get_device > > and similar for serdev, which is becoming more and more common. Ok, good point, I'll go apply only the first 2 patches in this series (moving the macros out of tty.h and removing the unused one) and then will redo this set of patches again. I think a better tty_msg() macro is warrented so that we can provide dev_*() output if we have a device, otherwise fall back to the old style to preserve functionality. thanks, greg k-h