Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbaBWAYE (ORCPT ); Sat, 22 Feb 2014 19:24:04 -0500 Received: from mail-ve0-f175.google.com ([209.85.128.175]:64363 "EHLO mail-ve0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbaBWAYD (ORCPT ); Sat, 22 Feb 2014 19:24:03 -0500 MIME-Version: 1.0 In-Reply-To: References: <20140220235118.191692546@linuxfoundation.org> <20140220235119.236520201@linuxfoundation.org> <20140221202127.GA28780@kroah.com> <5308BF5A.3040706@suse.de> From: Ray Strode Date: Sat, 22 Feb 2014 19:23:42 -0500 Message-ID: Subject: Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute To: David Herrmann Cc: Hannes Reinecke , Greg Kroah-Hartman , Josh Boyer , "Linux-Kernel@Vger. Kernel. Org" , "stable@vger.kernel.org" , Lennart Poettering , Kay Sievers , Jiri Slaby , Werner Fink Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, (resending because my phone tried to send the reply as html mail and it got rejected) On Sat, Feb 22, 2014 at 9:27 AM, David Herrmann wrote: > > How about this: > > + driver = cs[i]->device(cs[i], &index); > + /* special case for tty0 which must not be resolved */ > + if (driver && (index > 0 || cs[i]->major != TTY_MAJOR)) { > + count += tty_line_name(driver, index, buf + count); > + count += sprintf(buf + count, "%c", i ? ' ':'\n'); > + } else > + count += sprintf(buf + count, "%s%d%c", > + name, index, i ? ' ':'\n'); Assuming I'm reading the code correctly, I don't think that will work. Index will be rewritten from 0 to fg_console (which I suppose is going to be 1) after the device vfunc is called. --Ray -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/