Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753173AbZK2TL6 (ORCPT ); Sun, 29 Nov 2009 14:11:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753039AbZK2TLp (ORCPT ); Sun, 29 Nov 2009 14:11:45 -0500 Received: from kroah.org ([198.145.64.141]:56931 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752925AbZK2TLo (ORCPT ); Sun, 29 Nov 2009 14:11:44 -0500 Date: Sun, 29 Nov 2009 11:09:57 -0800 From: Greg KH To: Jon Smirl Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [IR-RFC PATCH v4 2/6] Core IR module Message-ID: <20091129190957.GB6171@kroah.com> References: <20091127013217.7671.32355.stgit@terra> <20091127013423.7671.36546.stgit@terra> <20091129171726.GB4993@kroah.com> <9e4733910911290941o761a4dfhf4168e573c6b6e89@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e4733910911290941o761a4dfhf4168e573c6b6e89@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1610 Lines: 41 On Sun, Nov 29, 2009 at 12:41:22PM -0500, Jon Smirl wrote: > On Sun, Nov 29, 2009 at 12:17 PM, Greg KH wrote: > >> +static ssize_t ir_raw_show(struct device *dev, > >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?struct device_attribute *attr, char *buf) > >> +{ > >> + ? ? struct input_dev *input_dev = to_input_dev(dev); > >> + ? ? unsigned int i, count = 0; > >> + > >> + ? ? for (i = input_dev->ir->raw.tail; i != input_dev->ir->raw.head; ) { > >> + > >> + ? ? ? ? ? ? count += snprintf(&buf[count], PAGE_SIZE - 1, "%i\n", input_dev->ir->raw.buffer[i++]); > >> + ? ? ? ? ? ? if (i > ARRAY_SIZE(input_dev->ir->raw.buffer)) > >> + ? ? ? ? ? ? ? ? ? ? i = 0; > >> + ? ? ? ? ? ? if (count >= PAGE_SIZE - 1) { > >> + ? ? ? ? ? ? ? ? ? ? input_dev->ir->raw.tail = i; > >> + ? ? ? ? ? ? ? ? ? ? return PAGE_SIZE - 1; > >> + ? ? ? ? ? ? } > >> + ? ? } > >> + ? ? input_dev->ir->raw.tail = i; > >> + ? ? return count; > >> +} > > > > This looks like it violates the "one value per sysfs file" rule that we > > have. ?What exactly are you outputting here? ?It does not look like this > > belongs in sysfs at all. > > It should be on a debug switch or maybe a debug device. If the rest of > the system is working right you shouldn't need this data. Then why export it at all? If it's debug stuff, please use debugfs, that is what it is there for. thanks, greg k-h -- 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/