mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Anssi Hannula <anssi.hannula@gmail.com>
Cc: linux-kernel@vger.kernel.org, dtor_core@ameritech.net
Subject: Re: + input-new-force-feedback-interface.patch added to -mm tree
Date: Tue, 23 May 2006 03:03:24 +0200	[thread overview]
Message-ID: <1148346205.3100.3.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <4471E2F6.1040709@gmail.com>

On Mon, 2006-05-22 at 19:12 +0300, Anssi Hannula wrote:
> Arjan van de Ven wrote:
> > On Wed, 2006-05-17 at 21:46 -0700, akpm@osdl.org wrote:
> > 
> >>+
> >>+#ifdef DEBUG
> >>+#define debug(format, arg...) printk(KERN_DEBUG "ff-effects: " format "\n" , ## arg)
> >>+#else
> >>+#define debug(format, arg...) do {} while (0)
> >>+#endif
> > 
> > 
> > please just use the existing prdebug() thing for this, no need to invent
> > your own ;)
> 
> Couldn't find any info on that one, are you sure you spelled it correctly?


> 
> > 
#ifdef DEBUG
#define pr_debug(fmt,arg...) \
        printk(KERN_DEBUG fmt,##arg)
#else
#define pr_debug(fmt,arg...) \
        do { } while (0)
#endif


in linux/kernel.h


> Well, I don't know. When should EXPORT_SYMBOLs be EXPORT_SYMBOL_GPLs?
> 

if it's linux-only code or otherwise very internal, _GPL is usually the
right thing

> > hmmm stack space?
> > 
> 
> I count 76 bytes (x86), is that too much?

it's sort of ok, just make sure it doesn't grow more

> > 
> > that is almost always a wrong return value
> > 
> 
> It's returned when the device is mem-capable but driver doesn't
> implement set_gain() but sets FF_GAIN or when driver doesn't implement
> set_autocenter() but sets FF_AUTOCENTER. But yes, if that happens, it's
> a driver bug, so maybe this is not correct use for -ENOSYS. Probably
> there should be BUG() too here.

-EINVAL or so would be better; -ENOSYS basically is "not implemented
system call", which is totally off topic in this context

> 
> >>+	if (test_bit(FF_CONSTANT, dev->ff->flags))
> >>+		set_bit(FF_CONSTANT, dev->ffbit);
> >>+	if (test_bit(FF_SPRING, dev->ff->flags))
> >>+		set_bit(FF_SPRING, dev->ffbit);
> >>+	if (test_bit(FF_FRICTION, dev->ff->flags))
> >>+		set_bit(FF_FRICTION, dev->ffbit);
> >>+	if (test_bit(FF_DAMPER, dev->ff->flags))
> >>+		set_bit(FF_DAMPER, dev->ffbit);
> >>+	if (test_bit(FF_INERTIA, dev->ff->flags))
> > 
> > 
> > are you really sure you need atomic set_bit()'s here??
> > if so.. I think you have a race ;)
> 
> Well, I'm not. Is there an alternative?

__set_bit() is not atomic, and thus a lot faster if you don't need
atomic behavior..



      reply	other threads:[~2006-05-23  1:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200605180446.k4I4kFxs007658@shell0.pdx.osdl.net>
2006-05-18 14:44 ` Arjan van de Ven
2006-05-22 16:12   ` Anssi Hannula
2006-05-23  1:03     ` Arjan van de Ven [this message]

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=1148346205.3100.3.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=anssi.hannula@gmail.com \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®