All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, bilotta78@hotpop.com,
	danlee@informatik.uni-freiburg.de, vojtech@suse.cz,
	tuukkat@ee.oulu.fi
Subject: Re: [RFC/RFT] Raw access to serio ports (1/2)
Date: Wed, 2 Jun 2004 02:43:09 -0500	[thread overview]
Message-ID: <200406020243.09560.dtor_core@ameritech.net> (raw)
In-Reply-To: <20040602003626.4d754944.akpm@osdl.org>

On Wednesday 02 June 2004 02:36 am, Andrew Morton wrote:
> Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> >
> > Hi,
> > 
> > Below is an implementation of rawdev driver.
> 
> Yes, it does appear that we need the feature, thanks.
> 
> > Comments?
> 
> They're the thingies inside /* and */.  Your patch is refreshingly free of
> them ;)
> 
> > +static ssize_t rawdev_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
> > +{
> > +	struct rawdev_list *list = file->private_data;
> > +	ssize_t written = 0;
> > +	int retval;
> > +	unsigned char c;
> > +
> > +	retval = down_interruptible(&rawdev_sem);
> > +	if (retval)
> > +		return retval;
> > +
> > +	if (!list->rawdev->serio) {
> > +		retval = -ENODEV;
> > +		goto out;
> > +	}
> 
> The return values here are mucked up - this function returns `written'.

Or an error code in negative notation - it's the standard practice for
read/write. Am I missing something?

> 
> > +	if (count > 32)
> > +		count = 32;
> 
> Why?  (Don't tell me - add a comment!)

I have no idea - taken from 2.4... My best guess would be it's an attempt not to
hog the device... I'll sprinkle some comments ;)

-- 
Dmitry

  reply	other threads:[~2004-06-02  7:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02  7:18 [RFC/RFT] Raw access to serio ports (1/2) Dmitry Torokhov
2004-06-02  7:36 ` Andrew Morton
2004-06-02  7:43   ` Dmitry Torokhov [this message]
2004-06-02  7:46     ` Andrew Morton
2004-06-02  7:49     ` Dmitry Torokhov
2004-06-03  5:45   ` Dmitry Torokhov
2004-06-03  6:26     ` Sau Dan Lee
2004-06-03  6:38       ` Dmitry Torokhov
2004-06-05  7:31       ` [RFC/RFT] Raw access to serio ports (1/2) - take 3 Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200406020243.09560.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=akpm@osdl.org \
    --cc=bilotta78@hotpop.com \
    --cc=danlee@informatik.uni-freiburg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tuukkat@ee.oulu.fi \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.