* Serial: Initial refactor
@ Okash Khawaja
` Samuel Thibault
0 siblings, 1 reply; 8+ messages in thread
From: Okash Khawaja @ UTC (permalink / raw)
To: Samuel Thibault
Cc: John Covici, David Borowski,
Speakup is a screen review system for Linux.
Hi Samuel,
>From previous email:
"You will notice calls to spk_serial_out() in spk_do_catch_up() and
spk_synth_flush(). Actually the very first step of your work could be
to add a serial_out() method to drivers, which for now would be set
to spk_serial_out() in all drivers, and make spk_do_catch_up() and
spk_synth_flush() call the method instead of spk_serial_out(). Direct
calls to spk_serial_out() within drivers could be converted into calling
the method too, so that switching methods will be trivial."
So I am wondering if it will be possible to restrict the changes to
speakup_dummy while we test the new implementation using tty->ops->write?
That means a transitional phase where we have both, the existing serial io
for other drivers and new implementation for dummy driver. Or is that what
you meant?
Thanks,
Okash
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Serial: Initial refactor
Serial: Initial refactor Okash Khawaja
@ ` Samuel Thibault
` Okash Khawaja
0 siblings, 1 reply; 8+ messages in thread
From: Samuel Thibault @ UTC (permalink / raw)
To: Okash Khawaja
Cc: John Covici, David Borowski,
Speakup is a screen review system for Linux.
Okash Khawaja, on Fri 18 Nov 2016 07:07:33 +0000, wrote:
> "You will notice calls to spk_serial_out() in spk_do_catch_up() and
> spk_synth_flush(). Actually the very first step of your work could be
> to add a serial_out() method to drivers, which for now would be set
> to spk_serial_out() in all drivers, and make spk_do_catch_up() and
> spk_synth_flush() call the method instead of spk_serial_out(). Direct
> calls to spk_serial_out() within drivers could be converted into calling
> the method too, so that switching methods will be trivial."
>
> So I am wondering if it will be possible to restrict the changes to
> speakup_dummy while we test the new implementation using tty->ops->write? That
> means a transitional phase where we have both, the existing serial io for other
> drivers and new implementation for dummy driver. Or is that what you meant?
That's what I meant :)
Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Serial: Initial refactor
` Samuel Thibault
@ ` Okash Khawaja
` Samuel Thibault
0 siblings, 1 reply; 8+ messages in thread
From: Okash Khawaja @ UTC (permalink / raw)
To: Samuel Thibault
Cc: John Covici, David Borowski,
Speakup is a screen review system for Linux.
Cool. So we start with spk_serial_out() by replacing it with a wrapper
wherever it is used in speakup_dummy?
For first pass, here's what I am thinking (from your suggestion but using
uglier function names which parallel existing ones):
- add spk_serial_out2() wrapper which delegates to spk_serial_out()
- add spk_synth_flush2() which is same as spk_synth_flush() but calls
spk_serial_out2() instead
- add spk_do_catch_up2() which is same as spk_do_catch_up() but calls
spk_serial_out2() instead
- in speakup_dummy replace calls to above functions with their *2()
alternative
Is that fine?
Thanks,
Okash
On Fri, Nov 18, 2016 at 7:44 AM, Samuel Thibault <
samuel.thibault@ens-lyon.org> wrote:
> Okash Khawaja, on Fri 18 Nov 2016 07:07:33 +0000, wrote:
> > "You will notice calls to spk_serial_out() in spk_do_catch_up() and
> > spk_synth_flush(). Actually the very first step of your work could be
> > to add a serial_out() method to drivers, which for now would be set
> > to spk_serial_out() in all drivers, and make spk_do_catch_up() and
> > spk_synth_flush() call the method instead of spk_serial_out(). Direct
> > calls to spk_serial_out() within drivers could be converted into calling
> > the method too, so that switching methods will be trivial."
> >
> > So I am wondering if it will be possible to restrict the changes to
> > speakup_dummy while we test the new implementation using
> tty->ops->write? That
> > means a transitional phase where we have both, the existing serial io
> for other
> > drivers and new implementation for dummy driver. Or is that what you
> meant?
>
> That's what I meant :)
>
> Samuel
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Serial: Initial refactor
` Okash Khawaja
@ ` Samuel Thibault
` Okash Khawaja
0 siblings, 1 reply; 8+ messages in thread
From: Samuel Thibault @ UTC (permalink / raw)
To: Okash Khawaja
Cc: John Covici, David Borowski,
Speakup is a screen review system for Linux.
Okash Khawaja, on Fri 18 Nov 2016 09:20:08 +0000, wrote:
> Cool. So we start with spk_serial_out() by replacing it with a wrapper wherever
> it is used in speakup_dummy?
By replacing it with calling serial_out method, i.e. call synth->serial_out.
And in all drivers for now, use spk_serial_out for that method.
Then you can write an spk_serial_out2 which just calls spk_serial_out,
and make the dummy driver use that for the serial_out method instead of
spk_serial_out.
> - add spk_synth_flush2() which is same as spk_synth_flush() but calls
> spk_serial_out2() instead
> - add spk_do_catch_up2() which is same as spk_do_catch_up() but calls
> spk_serial_out2() instead
No, we don't want to define new functions for these, just make them call
the serial_out of the synth.
Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Serial: Initial refactor
` Samuel Thibault
@ ` Okash Khawaja
` David
0 siblings, 1 reply; 8+ messages in thread
From: Okash Khawaja @ UTC (permalink / raw)
To: Samuel Thibault
Cc: John Covici, David Borowski,
Speakup is a screen review system for Linux.
Got it, thanks
> On 18 Nov 2016, at 12:39, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
>
> Okash Khawaja, on Fri 18 Nov 2016 09:20:08 +0000, wrote:
>> Cool. So we start with spk_serial_out() by replacing it with a wrapper wherever
>> it is used in speakup_dummy?
>
> By replacing it with calling serial_out method, i.e. call synth->serial_out.
> And in all drivers for now, use spk_serial_out for that method.
>
> Then you can write an spk_serial_out2 which just calls spk_serial_out,
> and make the dummy driver use that for the serial_out method instead of
> spk_serial_out.
>
>> - add spk_synth_flush2() which is same as spk_synth_flush() but calls
>> spk_serial_out2() instead
>> - add spk_do_catch_up2() which is same as spk_do_catch_up() but calls
>> spk_serial_out2() instead
>
> No, we don't want to define new functions for these, just make them call
> the serial_out of the synth.
>
> Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Serial: Initial refactor
` Okash Khawaja
@ ` David
` Okash Khawaja
` Samuel Thibault
0 siblings, 2 replies; 8+ messages in thread
From: David @ UTC (permalink / raw)
To: Okash Khawaja
Cc: Samuel Thibault, John Covici,
Speakup is a screen review system for Linux.
Just add a few #defines in an #include file and there is no code
change. #define spk_serial_out spk_serial_out2 etc.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Serial: Initial refactor
` David
@ ` Okash Khawaja
` Samuel Thibault
1 sibling, 0 replies; 8+ messages in thread
From: Okash Khawaja @ UTC (permalink / raw)
To: David
Cc: Samuel Thibault, John Covici,
Speakup is a screen review system for Linux.
Hi David,
Thanks. I'm personally averse to #defines although open to discuss.
Okash
> On 18 Nov 2016, at 14:43, David <david.a.borowski@gmail.com> wrote:
>
> Just add a few #defines in an #include file and there is no code
> change. #define spk_serial_out spk_serial_out2 etc.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Serial: Initial refactor
` David
` Okash Khawaja
@ ` Samuel Thibault
1 sibling, 0 replies; 8+ messages in thread
From: Samuel Thibault @ UTC (permalink / raw)
To: David
Cc: Okash Khawaja, John Covici, Speakup is a screen review system for Linux.
David, on Fri 18 Nov 2016 09:43:28 -0500, wrote:
> Just add a few #defines in an #include file and there is no code
> change. #define spk_serial_out spk_serial_out2 etc.
It makes the code more complex for no benefit.
Changing the code is cheap. Making the code more complex costs a lot on
the long run.
Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~ UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
Serial: Initial refactor Okash Khawaja
` Samuel Thibault
` Okash Khawaja
` Samuel Thibault
` Okash Khawaja
` David
` Okash Khawaja
` Samuel Thibault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).