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 790E0CA5534 for ; Wed, 13 Sep 2023 10:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239676AbjIMKVy (ORCPT ); Wed, 13 Sep 2023 06:21:54 -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 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