Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4421rwi; Wed, 12 Oct 2022 15:03:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aXmID5OkArNEyJG2BP5yn0kFdYgFUqrFIC1uTlNERoszSeV898gzMHAKMt6bf71Tz4hoj X-Received: by 2002:a05:6402:1393:b0:457:ea9e:ba20 with SMTP id b19-20020a056402139300b00457ea9eba20mr29329733edv.109.1665612180337; Wed, 12 Oct 2022 15:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665612180; cv=none; d=google.com; s=arc-20160816; b=y8lAiPDlzhxDwtTIS7bG+YZnF2tynulmBYebIxmQYyfNFtWzlSXoZET5bHFx3u1Eq1 bojnpHCEO1BhXC3R3L+7adpW+jfNcgzPukz7EnD18vVKUn9NEgMfX1vXT/YugKfBJvNL 8DLCZ0S6RvrKdVO0MG+F7DaJmlVHEiBwindhvZegY/Cccy9mvmIdSqxNvVkEYI4UHxpM 5+XegC/BD68Ezl5dXuFvfApUUK/Uk2GO6L1eaTSlSrVzmmNA8G46oQrOV7IZWNv/UZF6 bezNhCIpCZ3oIPwoh7WJZ2UKoIakkx+cpWiq/SUOnJkuou5mNQcmw9KrZczYEwVlMAS6 7lgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:organization:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=kxHjjRk6nuKc09uvq11CJKCiNJzmHbO8px484MLqscs=; b=Ecud+LLarJeRQ7QZoaU+jbCT69fC7xFiI5JTl1p0re2lbbO9rT6sJlzLA1xVJEBrCw xrhRh6W/TdIPvdgceefMGOd2vNEWtiodPEMOZOpSgpnYHaS0gFp3x6TXTldqTwCKYCnP 72V82xMFl6tp/HJk9fvMNpO7NOkDFk1LPFVMfC9483W/skKTVD5I8JRsH6A1n4be89Py +jHR3spc3+xNTmL9qDtLQGJlgPpYe2nxY29wVPHkHoE7974TlvGIITSE7tWPifKJMrjZ tt1RwY3lqT4IO1PYo91631Y5qvUfWvVQIDmROKexB4FX/gIhL5AlhD6MSd1VAFUtVfu/ ZFAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020aa7cf83000000b00458e43471d5si15209687edx.614.2022.10.12.15.02.31; Wed, 12 Oct 2022 15:03:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbiJLVCc (ORCPT + 99 others); Wed, 12 Oct 2022 17:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiJLVCO (ORCPT ); Wed, 12 Oct 2022 17:02:14 -0400 Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56CD91038 for ; Wed, 12 Oct 2022 14:01:52 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id E38FF20148; Wed, 12 Oct 2022 23:01:49 +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 CBk8J5dCBBeV; Wed, 12 Oct 2022 23:01:49 +0200 (CEST) Received: from begin.home (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 EF1652012C; Wed, 12 Oct 2022 23:01:47 +0200 (CEST) Received: from samy by begin.home with local (Exim 4.96) (envelope-from ) id 1oiirM-00CNqf-20; Wed, 12 Oct 2022 23:01:48 +0200 Date: Wed, 12 Oct 2022 23:01:48 +0200 From: Samuel Thibault To: Osama Muhammad Cc: gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Accessiblity: speakup: specifying the default driver parameters among the module params Message-ID: <20221012210148.di6qxcdproztponz@begin> Mail-Followup-To: Samuel Thibault , Osama Muhammad , gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org References: <20221012204723.110285-1-osmtendev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221012204723.110285-1-osmtendev@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Osama Muhammad, le jeu. 13 oct. 2022 01:47:23 +0500, a ecrit: > +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, > +}; > + > + > static struct var_t vars[] = { > /* DIRECT is put first so that module_param_named can access it easily */ > { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, > @@ -451,10 +460,33 @@ static int softsynth_adjust(struct spk_synth *synth, struct st_var_header *var) We need to make sure that the entries in vars are in the same order, so use [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, etc. to make sure that the indexes are correct. Also add NB_ID as last member of the enum, and use it for the "vars" array length, so we're sure we're not missing anything. > module_param_named(start, synth_soft.startup, short, 0444); > -module_param_named(direct, vars[0].u.n.default_val, int, 0444); > +module_param_named(direct, vars[DIRECT_ID].u.n.default_val, int, 0444); > +module_param_named(caps_start, vars[CAPS_START_ID].u.s.default_val, charp, 0444); > +module_param_named(caps_stop, vars[CAPS_STOP_ID].u.s.default_val, charp, 0444); > +module_param_named(pause, vars[PAUSE_ID].u.n.default_val, int, 0444); > +module_param_named(rate, vars[RATE_ID].u.n.default_val, int, 0444); > +module_param_named(pitch, vars[PITCH_ID].u.n.default_val, int, 0444); > +module_param_named(inflection, vars[INFLECTION_ID].u.n.default_val, int, 0444); > +module_param_named(vol, vars[VOL_ID].u.n.default_val, int, 0444); > +module_param_named(tone, vars[TONE_ID].u.n.default_val, int, 0444); > +module_param_named(punct, vars[PUNCT_ID].u.n.default_val, int, 0444); > +module_param_named(voice, vars[VOICE_ID].u.n.default_val, int, 0444); > +module_param_named(frequency, vars[FREQUENCY_ID].u.n.default_val, int, 0444); Not all vars make sense as parameters: caps_start, caps_stop and pause are not actually tunable, so don't add a parameter for them. Samuel