From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 6A29D1EFBD4; Sun, 21 Oct 2018 18:03:30 -0400 (EDT) Authentication-Results: befuddled.reisers.ca; dkim=pass (2048-bit key; unprotected) header.d=gregn.net header.i=@gregn.net header.b="WqdzoxgY"; dkim-atps=neutral Received: from vserver.gregn.net (vserver.gregn.net [174.136.110.154]) by befuddled.reisers.ca (Postfix) with ESMTPS id 32C591EFB6B for ; Sun, 21 Oct 2018 18:03:28 -0400 (EDT) Received: from vbox.gregn.net (unknown [IPv6:2001:470:d:6c5:e156:c79e:cdc8:75a9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by vserver.gregn.net (Postfix) with ESMTPSA id 3E0E0371C; Sun, 21 Oct 2018 15:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gregn.net; s=default; t=1540159426; bh=4vP8ZeHMZYyxOeLom43G1RCWwPf3f1GIpvLGbx14dGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WqdzoxgYAZxWWG9aOYZg/5fJ0Ima9BXgSJ8fku78Nlf6yg00IxW0ttRUkj+UKU7yW nN4k+FkFoV3/zIG/9+j5YDVLGnhH8yJcdiPjR2AclEZ1Fn7tgmO8BgsaZQJ+rg2Oez ewIy9VLLedB/pdVJSKM7GXUGYJO4WEOI5MopDO6xmhzzu8lN/PuwYLZTvAD9ZeJpVr fPW9HWhC92UBXdBCIi4vu6WxsoWYir4DVyrOZeXx8FjVhqsOznRD12KusFwOy4EV0g 7R2DErkcO7xpzTx1A3kjw6mAnLeNHJrYgVAnBGHeBQFhrWsT+1w0VjKe4PhS521FmM VOBcfWzK/YJaw== Received: from greg by vbox.gregn.net with local (Exim 4.84_2) (envelope-from ) id 1gELoe-0001tL-B0; Sun, 21 Oct 2018 15:03:20 -0700 Date: Sun, 21 Oct 2018 15:03:20 -0700 From: Gregory Nowak To: "Speakup is a screen review system for Linux." Subject: Re: [PATCH] staging: speakup: refactor synths array to use a list Message-ID: <20181021220320.GA7142@gregn.net> References: <20181021174338.a2wgpnvz4vusmva7@function> <20181021205030.rsucn7vqdamoxtwr@function> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181021205030.rsucn7vqdamoxtwr@function> X-PGP-Key: http://www.gregn.net/pubkey.asc User-Agent: Mutt/1.5.23 (2014-03-12) X-Virus-Scanned: clamav-milter 0.100.1 at vserver X-Virus-Status: Clean X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2018 22:03:30 -0000 On Sun, Oct 21, 2018 at 10:50:30PM +0200, Samuel Thibault wrote: > Ah, the changes were based on 4.15 indeed, here is a version rebased on > 4.18 Hmmm, the top line of the attached patch still says: "Index: linux-4.15/drivers/staging/speakup/speakup_soft.c" Greg > > Samuel > Index: linux-4.15/drivers/staging/speakup/speakup_soft.c > =================================================================== > --- linux-4.15.orig/drivers/staging/speakup/speakup_soft.c > +++ linux-4.15/drivers/staging/speakup/speakup_soft.c > @@ -214,12 +214,15 @@ static ssize_t softsynthx_read(struct fi > DEFINE_WAIT(wait); > > spin_lock_irqsave(&speakup_info.spinlock, flags); > + synth_soft.alive = 1; > while (1) { > prepare_to_wait(&speakup_event, &wait, TASK_INTERRUPTIBLE); > - if (!unicode) > - synth_buffer_skip_nonlatin1(); > - if (!synth_buffer_empty() || speakup_info.flushing) > - break; > + if (synth_current() == &synth_soft) { > + if (!unicode) > + synth_buffer_skip_nonlatin1(); > + if (!synth_buffer_empty() || speakup_info.flushing) > + break; > + } > spin_unlock_irqrestore(&speakup_info.spinlock, flags); > if (fp->f_flags & O_NONBLOCK) { > finish_wait(&speakup_event, &wait); > @@ -239,6 +242,8 @@ static ssize_t softsynthx_read(struct fi > > /* Keep 3 bytes available for a 16bit UTF-8-encoded character */ > while (chars_sent <= count - bytes_per_ch) { > + if (synth_current() != &synth_soft) > + break; > if (speakup_info.flushing) { > speakup_info.flushing = 0; > ch = '\x18'; > @@ -335,7 +340,8 @@ static unsigned int softsynth_poll(struc > poll_wait(fp, &speakup_event, wait); > > spin_lock_irqsave(&speakup_info.spinlock, flags); > - if (!synth_buffer_empty() || speakup_info.flushing) > + if (synth_current() == &synth_soft && > + (!synth_buffer_empty() || speakup_info.flushing)) > ret = EPOLLIN | EPOLLRDNORM; > spin_unlock_irqrestore(&speakup_info.spinlock, flags); > return ret; > Index: linux-4.15/drivers/staging/speakup/spk_priv.h > =================================================================== > --- linux-4.15.orig/drivers/staging/speakup/spk_priv.h > +++ linux-4.15/drivers/staging/speakup/spk_priv.h > @@ -81,6 +81,7 @@ int synth_request_region(unsigned long s > int synth_release_region(unsigned long start, unsigned long n); > int synth_add(struct spk_synth *in_synth); > void synth_remove(struct spk_synth *in_synth); > +struct spk_synth *synth_current(void); > > extern struct speakup_info_t speakup_info; > > Index: linux-4.15/drivers/staging/speakup/synth.c > =================================================================== > --- linux-4.15.orig/drivers/staging/speakup/synth.c > +++ linux-4.15/drivers/staging/speakup/synth.c > @@ -495,4 +495,10 @@ void synth_remove(struct spk_synth *in_s > } > EXPORT_SYMBOL_GPL(synth_remove); > > +struct spk_synth *synth_current(void) > +{ > + return synth; > +} > +EXPORT_SYMBOL_GPL(synth_current); > + > short spk_punc_masks[] = { 0, SOME, MOST, PUNC, PUNC | B_SYM }; > _______________________________________________ > Speakup mailing list > Speakup@linux-speakup.org > http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup -- web site: http://www.gregn.net gpg public key: http://www.gregn.net/pubkey.asc skype: gregn1 (authorization required, add me to your contacts list first) If we haven't been in touch before, e-mail me before adding me to your contacts. -- Free domains: http://www.eu.org/ or mail dns-manager@EU.org