public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: Andrew Morton <akpm@osdl.org>
Cc: Hansjoerg Lipp <hjlipp@web.de>,
	kkeil@suse.de, i4ldeveloper@listserv.isdn4linux.de,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, gregkh@suse.de
Subject: Re: [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface
Date: Wed, 15 Feb 2006 02:55:01 +0100	[thread overview]
Message-ID: <43F289F5.2080102@imap.cc> (raw)
In-Reply-To: <20060212022742.16df78a2.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

Andrew,

thank you very much for your comments.

On 12.02.2006 11:27, Andrew Morton wrote:
> 
>>This patch adds the procfs interface to the gigaset module.
> 
> sysfs, actually.

Yes, sorry, the comment didn't get updated when we did the move from
procfs to sysfs.

> - The ringbuffer head and tail indexes are atomic_t's, but always seem to
>   be manipulated inside the lock.  Perhaps they can become integers.

We use ringbuffers in two places. I suppose you are talking about the
one implementing our event queue through the ev_head and ev_tail members
of the cardstate structure. You have a point there, although I'm not
sure if it wouldn't be better to take advantage of the atomic_t and do a
little less locking instead.

The other one, within the inbuf_t structure, used for capturing
characters received from the device, is accessed without locking from
the gigaset_handle_event() tasklet and therefore needs atomic_t indexes,
IMHO.

> - You did the ringbuffer the wrong way.  Don't constrain the head and
>   tail to be within 0..MAX_EVENTS.  Instead, just let them wrap right up to
>   0xffffffff.   Apply the masking when you actually _use_ them.
> 
>   That way, empty is (head == tail) and full is (tail - head == MAX_EVENTS).

Interesting idea. I have to admit it's rather new to me. I have always
done ringbuffers the way they are done in the Gigaset driver now. Can
you point me to some example code done the way you propose, so I can
familiarize myself with its advantages?

> - Could use kstrdup() in a few places.

Thanks for the hint. Will watch out for these.

> - A few unneeded casts of void*'s, but everyone does that.

:-)

> - There are a lot of global symbols in there.  Perhaps they don't all
>   need to be global.

Well, I *hope* there aren't any unnecessary ones, but we'll re-check.

Regards
Tilman

-- 
Tilman Schmidt                          E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2006-02-15  1:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11 14:52 [PATCH 0/9] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX Hansjoerg Lipp
2006-02-11 14:52 ` [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles Hansjoerg Lipp
2006-02-11 14:52   ` [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module Hansjoerg Lipp
2006-02-11 14:52     ` [PATCH 3/9] isdn4linux: Siemens Gigaset drivers - event layer Hansjoerg Lipp
2006-02-11 14:52       ` [PATCH 4/9] isdn4linux: Siemens Gigaset drivers - isdn4linux interface Hansjoerg Lipp
2006-02-11 14:52         ` [PATCH 5/9] isdn4linux: Siemens Gigaset drivers - tty interface Hansjoerg Lipp
2006-02-11 14:52           ` [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface Hansjoerg Lipp
2006-02-11 14:52             ` [PATCH 7/9] isdn4linux: Siemens Gigaset drivers - direct USB connection Hansjoerg Lipp
2006-02-11 14:52               ` [PATCH 8/9] isdn4linux: Siemens Gigaset drivers - isochronous data handler Hansjoerg Lipp
2006-02-11 14:52                 ` [PATCH 9/9] isdn4linux: Siemens Gigaset drivers - M105 USB DECT adapter Hansjoerg Lipp
2006-02-15  3:35                   ` Greg KH
2006-02-15  3:33               ` [PATCH 7/9] isdn4linux: Siemens Gigaset drivers - direct USB connection Greg KH
2006-02-12 10:27             ` [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface Andrew Morton
2006-02-15  1:55               ` Tilman Schmidt [this message]
2006-02-15  3:22                 ` Andrew Morton
2006-02-15  3:30             ` Greg KH
2006-02-15  3:27     ` [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module Greg KH
2006-02-21 17:01       ` advice on using dev_info(), dev_err() and friends (was: [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module) Tilman Schmidt
2006-02-21 23:00         ` Greg KH
2006-02-15  4:13     ` [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module Nishanth Aravamudan
2006-02-15  3:19   ` [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles Greg KH
2006-02-16 21:30     ` Tilman Schmidt
2006-02-21 17:16     ` how to handle multi-part patch dependencies (was: [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles) Tilman Schmidt
2006-02-21 23:01       ` Greg KH
2006-02-12 10:29 ` [PATCH 0/9] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2005-12-11 18:20 Hansjoerg Lipp
2005-12-11 18:20 ` [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles Hansjoerg Lipp
2005-12-11 18:20   ` [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module Hansjoerg Lipp
2005-12-11 18:20     ` [PATCH 3/9] isdn4linux: Siemens Gigaset drivers - event layer Hansjoerg Lipp
2005-12-11 18:20       ` [PATCH 4/9] isdn4linux: Siemens Gigaset drivers - isdn4linux interface Hansjoerg Lipp
2005-12-11 18:20         ` [PATCH 5/9] isdn4linux: Siemens Gigaset drivers - tty interface Hansjoerg Lipp
2005-12-11 18:20           ` [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface Hansjoerg Lipp

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=43F289F5.2080102@imap.cc \
    --to=tilman@imap.cc \
    --cc=akpm@osdl.org \
    --cc=gregkh@suse.de \
    --cc=hjlipp@web.de \
    --cc=i4ldeveloper@listserv.isdn4linux.de \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /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