Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp92108lqf; Tue, 26 Mar 2024 15:43:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURyR3+20/PpdWXNrPXkCZDILLQ6iK26O99DpoGy96YnDLqsroN0ESlKp5uaOCqkZ5U5ZA/Jb7nfRkiiVaLTw67UCDQmRlLLj9yZS5mkw== X-Google-Smtp-Source: AGHT+IF7hwd0utPndvafxk8gQGTrEq/Ai5Qz5aJ43XQPit/eXI7C6jc26TT06z37AGa/F5xVGcXi X-Received: by 2002:a05:6358:99a7:b0:17f:4964:3e04 with SMTP id j39-20020a05635899a700b0017f49643e04mr2812884rwb.10.1711493021516; Tue, 26 Mar 2024 15:43:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711493021; cv=pass; d=google.com; s=arc-20160816; b=snOtqWinbyC9tsp+FUU/fAhYiq02NqnfzvrxmnZOo4Uq05DEhRgh3Dut8rh1EbxURU G8tpKf/DQzqZ47uXgGfekK4Gp3TPlaBG/bl+7zerI5i8GeKJ/3JavA9+DVDIrGpb/E9n dWDHfKwjmfxl2rO6Jjv6ixpCWg+FjC7/+v8Hur48d5gpYEGtu+K4mPSaNaJn8+PmY//k gDglkSuwng8HA9bL0iKiWz5AHFhOqoln5T8RwZiD49qR2+JH751RWshDr+H/kz4olQDN 1Fwe2ESbqrYywTOBiRDyM9dC3EjtWansdGVrFbp/vCaBiOASFHNoJIJMTWQnwAIKgh+P J06Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5PP5daBn26UTJaRMlbOYH2e/bYNJse1wR5EoC/D51jg=; fh=3AOqHKLPe687BNoBRUQfJFiQ37iu+2rZIZKbpXZY5EE=; b=tx0Le+v+lo6D09iiqjOa+KbHq5I4pcMoaVxR6e3ZqF5DisuzIp07kG9KoFPo8s0b8T UFH7DlnvrgIyFh1Jdx8ItCaUp9nkL12wqIyt5hK2Z3yoqEMd+t5uxfOacQivRlHUBTPW GqL5/HmjWZWlzdshu0qH8358PJtmSDJD6FU0/T/PIsm/JS0Hl64ZxUkuyv0yabt49srZ 02daU76SqnrCe/YRtCKDhM7eX72sffq0B3x9a0dl4aWUG8s2ZWBQiljAHrCLjT+brYej wsqZwhxOpD8BhRaDSj980LWq+M0fha7MGHhr88PH5TpPD6GC1maR+WEhscC+eC/ViUjq Sn5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ICJtMX3p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120086-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j19-20020a635513000000b005cee178fe54si10344034pgb.222.2024.03.26.15.43.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 15:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120086-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ICJtMX3p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120086-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 79115321ECB for ; Tue, 26 Mar 2024 22:43:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A48B13DDDD; Tue, 26 Mar 2024 22:41:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ICJtMX3p" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6225813E028; Tue, 26 Mar 2024 22:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711492874; cv=none; b=isajWuSbmGMVvJV25wyB6vdZJX/Hi537+VyQKcrTgEhpHNKDQnqbFr2JCR04BIpzrHHDMBb3/j2tqwrcqxJ9xSwndyKqpYC8l568QoFm/b+7tqQVn/OTUtZqfdy83kTmcl0Ck1Azi/A8+YpR1ghOXaNTXra7kD78dShwaxA2DsI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711492874; c=relaxed/simple; bh=fE8YQ0ldH4jAPvC8YbW24he4IxhcXj1g5OmwhFjAj+g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GLOPxDeMUFjWS4XdW8RmxFtfGyNbL1W0DQ/BjOh7ffpdJ2IZ9z2y8brxPXZGEX+SGkVym8WYKmg8TCPTaDqt9gFTg3mP4gx55xg+wjc0xam1gLKPQcwyfXesG/UQEhtM1bND5JQ2cH7R2NwKPwpsQTVH96JdHmtU9M2mZEB1MhU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ICJtMX3p; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A94DC433F1; Tue, 26 Mar 2024 22:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711492873; bh=fE8YQ0ldH4jAPvC8YbW24he4IxhcXj1g5OmwhFjAj+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ICJtMX3pCuiusynEfe3bAP6Lspz0zcyuLbBOka+EOsCaOFZME4FZ4QIKrK/MZdJmq Ctvnh5OIwUz+4zf2REjGVM2wdtuYwLoVkURryHKORb15fiwpv0FTQMJtESTGs4TGQ9 M95cMSdR9qm2j/ow8DdkaA96bSW6B+j3pXIETUi2N1JbBiGG6nS+FatuULN7WX9ApY OEQW8S0LDu+tihl3F/LXp4MYlPtjNGctBOW8AUwWSRImiBVjqWYm1AiepC0fk/OF4a ICeRLsN9MuXhJv/PBCigSpwkmoq065lOs3WVMt19zKcKFsi3X/clDOsIaByQv9Gr8K a1f7cxjjNEj7Q== From: Arnd Bergmann To: llvm@lists.linux.dev, Johannes Berg , Jaroslav Kysela , Takashi Iwai , Nathan Chancellor , Rob Herring Cc: Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , Jakub Kicinski , Dawei Li , linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/9] ALSA: aoa: avoid false-positive format truncation warning Date: Tue, 26 Mar 2024 23:38:07 +0100 Message-Id: <20240326223825.4084412-9-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240326223825.4084412-1-arnd@kernel.org> References: <20240326223825.4084412-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann clang warns about what it interprets as a truncated snprintf: sound/aoa/soundbus/i2sbus/core.c:171:6: error: 'snprintf' will always be truncated; specified size is 6, but format string expands to at least 7 [-Werror,-Wformat-truncation-non-kprintf] The actual problem here is that it does not understand the special %pOFn format string and assumes that it is a pointer followed by the string "OFn", which would indeed not fit. Slightly increasing the size of the buffer to its natural alignment avoids the warning, as it is now long enough for the correct and the incorrect interprations. Fixes: b917d58dcfaa ("ALSA: aoa: Convert to using %pOFn instead of device_node.name") Signed-off-by: Arnd Bergmann --- sound/aoa/soundbus/i2sbus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index b8ff5cccd0c8..5431d2c49421 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -158,7 +158,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, struct device_node *child, *sound = NULL; struct resource *r; int i, layout = 0, rlen, ok = force; - char node_name[6]; + char node_name[8]; static const char *rnames[] = { "i2sbus: %pOFn (control)", "i2sbus: %pOFn (tx)", "i2sbus: %pOFn (rx)" }; -- 2.39.2