From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C18FC4332F for ; Sat, 15 Oct 2022 21:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbiJOVaT (ORCPT ); Sat, 15 Oct 2022 17:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbiJOVaP (ORCPT ); Sat, 15 Oct 2022 17:30:15 -0400 Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04720DF13 for ; Sat, 15 Oct 2022 14:30:14 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id EA3FB2010E; Sat, 15 Oct 2022 23:30:12 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r8jX9eZX9SiD; Sat, 15 Oct 2022 23:30:12 +0200 (CEST) Received: from begin (lfbn-bor-1-376-208.w109-215.abo.wanadoo.fr [109.215.91.208]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id B0B1A20109; Sat, 15 Oct 2022 23:30:12 +0200 (CEST) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1ojojU-001Tsz-1S; Sat, 15 Oct 2022 23:30:12 +0200 Date: Sat, 15 Oct 2022 23:30:12 +0200 From: Samuel Thibault To: Osama Muhammad Cc: gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Accessiblity: speakup: specifying the default driver parameters among the module params Message-ID: <20221015213012.zctcugroxehxtjim@begin> Mail-Followup-To: Samuel Thibault , Osama Muhammad , gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org References: <20221013223024.22708-1-osmtendev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221013223024.22708-1-osmtendev@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Osama Muhammad, le ven. 14 oct. 2022 03:30:24 +0500, a ecrit: > This is an enhancement which allows to specify the default driver > parameters among the module parameters. > > Adding default variables to the speakup_soft module > allows to easily set that at boot, rather than > setting the sys variables after boot. > More details can be found here: > https://github.com/linux-speakup/speakup/issues/7 > > Signed-off-by: Osama Muhammad > > --- > > Changes since v1: > - Added NB_ID as the last member of enum default_vars_id. > - Added NB_ID as the size of array vars. > - Made sure that that the enteries in vars are in correct order. Thanks! It looks almost good to me now. > --- > drivers/accessibility/speakup/speakup_soft.c | 57 ++++++++++++++------ > 1 file changed, 42 insertions(+), 15 deletions(-) > > diff --git a/drivers/accessibility/speakup/speakup_soft.c b/drivers/accessibility/speakup/speakup_soft.c > index 28c8f60370cf..5d8e2c1e7f4c 100644 > --- a/drivers/accessibility/speakup/speakup_soft.c > +++ b/drivers/accessibility/speakup/speakup_soft.c > @@ -33,21 +33,30 @@ static struct miscdevice synth_device, synthu_device; > static int init_pos; > static int misc_registered; > > -static struct var_t vars[] = { > + > +enum default_vars_id { > + DIRECT_ID = 0, CAPS_START_ID, CAPS_STOP_ID, > + PAUSE_ID, RATE_ID, PITCH_ID, INFLECTION_ID, > + VOL_ID, TONE_ID, PUNCT_ID, VOICE_ID, > + FREQUENCY_ID, V_LAST_VAR_ID, > + NB_ID > +}; > + > + > +static struct var_t vars[NB_ID] = { > /* DIRECT is put first so that module_param_named can access it easily */ > - { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, > - You can now remove the comment, since now the ordering is not important. Samuel