Re: [IR-RFC PATCH v4 2/6] Core IR module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 29, 2009 at 12:41:22PM -0500, Jon Smirl wrote:
> On Sun, Nov 29, 2009 at 12:17 PM, Greg KH <greg@xxxxxxxxx> 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-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux