Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3166331rdb; Wed, 13 Sep 2023 04:21:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvcVKek986FLLT1/J/a6ZC9fYcVNhTbzIN3s/D9fxG1FI4jeUPJIDT/mL1KZRhw59xRS/i X-Received: by 2002:a05:6a20:100c:b0:141:d640:794a with SMTP id gs12-20020a056a20100c00b00141d640794amr1830614pzc.39.1694604119139; Wed, 13 Sep 2023 04:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694604119; cv=none; d=google.com; s=arc-20160816; b=mftYkf8kPFNVNFhimBYbHFBxPkhv/BCIVLPBrkQfjlBa6Ua1v1mOgHEyj50AUfzBsH abppBr9iRALEp3DGfho0Dfsr4v7SE1vdb3xggp9B2PcdmQspXEQnergf+aqvH5Dz7N4p WYfEkcckeyPjLPtFlpz7+nCSo9PiJNYdnTel4FDbplp6TMptvai+FbB8zTV3hhOmiDvr 3/hm8N4H9OgUrsT/NgxswCQ+1QdiYYjeqM1uWvCD8YmQevAYBcRG7tQAp1BBflmHL1Mt w/WyRMzuvDsDU8t8c1z73wlOBhy8PxDQeuJKmKsaOLqovD5ayX5UQUUVAGi8EBM5SV72 ouwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature; bh=DMvt8YhFOsGC5oPhl5vhZwMZHMmUIcMLTPIDo6/nEvQ=; fh=qFaALbBt1QgH5RXR+8JEF9594x/XLADWDsk7ayyNnj8=; b=FG8DRK2O+m7qoNIKOI2mUZFjJQizLWkT4PtvlwG1H7hO9Rd4tpIFoL1TXXYr172lYU VpvVuKV0Kv0IhUkkOMqF6jJJ8bU2BPv8tdFCmAjTuaFYqguRswKMWdJmOYrf3eW1kkXj GyhXsftiEX+RvyVLUN9AZsWMUqfM8Vu6Qqu9shnbv0fa0EzIcKfKl0/kdLm+rE9KaOUz KLdbI9bPMTBRRSOgR0yPIQrQAAzbs+gM2NeN1w/G4UZMzzVIIaOL8LdtZCZH7YVlG2Kn 9mcxRP0f72W5FmC+HGcrr6KQliEouccl0MJlBG9AexWnty9PnivkwRLzWIxAEvvCxfc1 DQiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=sIlLC2RI; dkim=neutral (no key) header.i=@suse.de header.b=clIClBwZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id mh9-20020a17090b4ac900b0026831f63e8csi1471028pjb.52.2023.09.13.04.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=sIlLC2RI; dkim=neutral (no key) header.i=@suse.de header.b=clIClBwZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 531D382878CF; Wed, 13 Sep 2023 03:22:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239672AbjIMKVx (ORCPT + 99 others); Wed, 13 Sep 2023 06:21:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239645AbjIMKVw (ORCPT ); Wed, 13 Sep 2023 06:21:52 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D39271989 for ; Wed, 13 Sep 2023 03:21:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 95B2E218DF; Wed, 13 Sep 2023 10:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694600507; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DMvt8YhFOsGC5oPhl5vhZwMZHMmUIcMLTPIDo6/nEvQ=; b=sIlLC2RIyXHsQdQPFT1KdLuPEdOrDERzG0lb+LvHksG4sFUiXEt5d5Pxl6AJrmkwK0055w 0tYbkDybCnXi+UAMEcnZXxacglDQ+Vei2TH6p0MTCeRSBNRPqd18bOGfd7OAB5rpMsFZWy hit464w7HkxqdQI19SfoJr1EchrLMo4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694600507; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DMvt8YhFOsGC5oPhl5vhZwMZHMmUIcMLTPIDo6/nEvQ=; b=clIClBwZbIvc/W0T4kJS8eaZGo6t8oQfjjZhdeWsFwKjHS4gJQKGkaugWDdt0j5WwDj0D4 5kQVkGIrdfqFr5Cg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 611C513440; Wed, 13 Sep 2023 10:21:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id T9nVFjuNAWUGYgAAMHmgww (envelope-from ); Wed, 13 Sep 2023 10:21:47 +0000 Date: Wed, 13 Sep 2023 12:21:46 +0200 Message-ID: <87cyym4blx.wl-tiwai@suse.de> From: Takashi Iwai To: Peter Ujfalusi Cc: tiwai@suse.com, perex@perex.cz, arnd@arndb.de, masahiroy@kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, maciej.szmigiero@oracle.com Subject: Re: [PATCH] ALSA: usb-audio: mixer: Remove temporary string use in parse_clock_source_unit In-Reply-To: <20230913093933.24564-1-peter.ujfalusi@linux.intel.com> References: <20230913093933.24564-1-peter.ujfalusi@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 03:22:01 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email On Wed, 13 Sep 2023 11:39:33 +0200, Peter Ujfalusi wrote: > > The kctl->id.name can be directly passed to snd_usb_copy_string_desc() and > if the string has been fetched the suffix can be appended with the > append_ctl_name() call. > The temporary name string becomes redundant and can be removed. > > This change will also fixes the following compiler warning/error (W=1): > > sound/usb/mixer.c: In function ?parse_audio_unit?: > sound/usb/mixer.c:1972:29: error: ? Validity? directive output may be truncated writing 9 bytes into a region of size between 1 and 44 [-Werror=format-truncation=] > 1972 | "%s Validity", name); > | ^~~~~~~~~ > In function ?parse_clock_source_unit?, > inlined from ?parse_audio_unit? at sound/usb/mixer.c:2892:10: > sound/usb/mixer.c:1971:17: note: ?snprintf? output between 10 and 53 bytes into a destination of size 44 > 1971 | snprintf(kctl->id.name, sizeof(kctl->id.name), > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1972 | "%s Validity", name); > | ~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > The warnings got brought to light by a recent patch upstream: > commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1") > > Signed-off-by: Peter Ujfalusi Thanks, applied now. Takashi