All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	David Woodhouse <dwmw2@infradead.org>,
	Dave Jones <davej@redhat.com>, Sam Ravnborg <sam@ravnborg.org>,
	Greg KH <greg@kroah.com>, Randy Dunlap <randy.dunlap@oracle.com>,
	Kay Sievers <kay.sievers@vrfy.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	Alexander Gordeev <lasaine@lvk.cs.msu.su>
Subject: Re: [PATCH 6/8] pps: serial clients support.
Date: Sun, 21 Feb 2010 20:21:01 +0100	[thread overview]
Message-ID: <20100221192101.GF21778@enneenne.com> (raw)
In-Reply-To: <20100219135359.a5c195ea.akpm@linux-foundation.org>

On Fri, Feb 19, 2010 at 01:53:59PM -0800, Andrew Morton wrote:
> 
> hm.  The n_tty_open/close layering is a bit grubby but I guess we don't
> have a need to create anything more comprehensive at this stage.
> 
> A small stylistic thing: the code's a bit confusing at present because
> the names n_tty_open/n_tty_close are identical to the global functions
> over in n_tty.c.  A user of ctags will be tricked.  Also, the _way_ in
> which these function pointers are called:
> 
> 	ret = n_tty_open(tty);
> 
> make it look like the code is calling
> drivers/char/n_tty.c:n_tty_open().  Except it isn't.
> 
> So I think it's better to do it with
> 
> 	ret = (*n_tty_open)(tty);
> 
> to avoid misleading the reader.
> 
> And perhaps to rename these variables to avoid the duplication with the
> global functions.

It could be acceptable using functions
alias_n_tty_open()/alias_n_tty_close() modifying the code as follow?

diff --git a/drivers/pps/clients/pps-ldisc.c
b/drivers/pps/clients/pps-ldisc.c
index 59e6301..15c4622 100644
--- a/drivers/pps/clients/pps-ldisc.c
+++ b/drivers/pps/clients/pps-ldisc.c
@@ -53,7 +53,7 @@ static void pps_tty_dcd_change(struct tty_struct
*tty, unsigne
                        status ? "assert" : "clear", jiffies, id);
 }
 
-static int (*n_tty_open)(struct tty_struct *tty);
+static int (*alias_n_tty_open)(struct tty_struct *tty);
 
 static int pps_tty_open(struct tty_struct *tty)
 {
@@ -79,7 +79,7 @@ static int pps_tty_open(struct tty_struct *tty)
        tty->disc_data = (void *) ret;
 
        /* Should open N_TTY ldisc too */
-       ret = n_tty_open(tty);
+       ret = alias_n_tty_open(tty);
        if (ret < 0)
                pps_unregister_source((int) tty->disc_data);
 
@@ -88,14 +88,14 @@ static int pps_tty_open(struct tty_struct *tty)
        return 0;
 }
 
-static void (*n_tty_close)(struct tty_struct *tty);
+static void (*alias_n_tty_close)(struct tty_struct *tty);
 
 static void pps_tty_close(struct tty_struct *tty)
 {
        int id = (int) tty->disc_data;
 
        pps_unregister_source(id);
-       n_tty_close(tty);
+       alias_n_tty_close(tty);
 
        pr_info("PPS source #%d removed\n", id);
 }

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it

  reply	other threads:[~2010-02-21 19:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16  9:51 LinuxPPS new functionalities Rodolfo Giometti
2010-02-16  9:51 ` [PATCH 1/8] pps: userland header file for PPS API Rodolfo Giometti
2010-02-16  9:51   ` [PATCH 2/8] pps: documentation programs and examples Rodolfo Giometti
2010-02-16  9:51     ` [PATCH 3/8] pps: LinuxPPS clients support Rodolfo Giometti
2010-02-16  9:51       ` [PATCH 4/8] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2010-02-16  9:51         ` [PATCH 5/8] ldisc n_tty: add new method n_tty_inherit_ops() Rodolfo Giometti
2010-02-16  9:51           ` [PATCH 6/8] pps: serial clients support Rodolfo Giometti
2010-02-16  9:51             ` [PATCH 7/8] serial 8250: enable PPS support Rodolfo Giometti
2010-02-16  9:51               ` [PATCH 8/8] serial amba-pl010: " Rodolfo Giometti
2010-02-19 21:53             ` [PATCH 6/8] pps: serial clients support Andrew Morton
2010-02-21 19:21               ` Rodolfo Giometti [this message]
2010-02-19 21:45           ` [PATCH 5/8] ldisc n_tty: add new method n_tty_inherit_ops() Andrew Morton
2010-02-16 12:44     ` [PATCH 2/8] pps: documentation programs and examples Alexander Gordeev
2010-02-16 13:56       ` Rodolfo Giometti
2010-02-16 12:33   ` [PATCH 1/8] pps: userland header file for PPS API Alexander Gordeev
2010-02-16 13:53     ` Rodolfo Giometti
2010-02-16 12:28 ` LinuxPPS new functionalities Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2008-02-08 18:00 LinuxPPS: the PPS Linux implementation Rodolfo Giometti
2008-02-08 18:00 ` [PATCH 1/8] LinuxPPS core support Rodolfo Giometti
2008-02-08 18:00   ` [PATCH 2/8] PPS: basic documentation file Rodolfo Giometti
2008-02-08 18:00     ` [PATCH 3/8] PPS: userland header file for PPS API Rodolfo Giometti
2008-02-08 18:00       ` [PATCH 4/8] PPS: documentation programs and examples Rodolfo Giometti
2008-02-08 18:00         ` [PATCH 5/8] PPS: LinuxPPS clients support Rodolfo Giometti
2008-02-08 18:00           ` [PATCH 6/8] PPS: serial " Rodolfo Giometti

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=20100221192101.GF21778@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=kay.sievers@vrfy.org \
    --cc=lasaine@lvk.cs.msu.su \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mtk.manpages@gmail.com \
    --cc=randy.dunlap@oracle.com \
    --cc=sam@ravnborg.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 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.