Message ID | 20240107151218.933806-4-mirsad.todorovac@alu.unizg.hr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-18886-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp580697dyq; Sun, 7 Jan 2024 07:14:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHwM17DF3MFfWoA/TOrr4ghhQ3xBT/K/6tqnXz1oAbTAiFplLDIdE36bmt+KYMil3s2phJ X-Received: by 2002:a17:907:1007:b0:a23:7467:3257 with SMTP id ox7-20020a170907100700b00a2374673257mr1007062ejb.75.1704640466881; Sun, 07 Jan 2024 07:14:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704640466; cv=none; d=google.com; s=arc-20160816; b=S0+lB2WToYi1wf+pcDtV46yYan1xBW/l38C9+ZFDUO+lzWMxPIqSjKBTc9OJrTP8VG ooBiyVtD9PpVNMj0rQjeOhPWpiGPcFeaXCaWPtl44sJZTwyQL3E+UbK2sI7yanfAYIB3 /YJ1C6gsqGG+0iITqa5xMC+4K/Ssh0ECqC+6/PsXgdhNKO0kZ+LnAHkq1C00g0C8rI54 6xt6WBQHUMzzfnSqbUuaorhmkslLKoDzxr3ExREjt/lRo1y21vaRkxe8fZdBZFCAq6fz +VJG/lnZnm7msFbU8Qnf7QCX14ITj4j4/bIVvfpt+PKijLpVaGnjEpxp+HCUqVV60Cxk tugg== ARC-Message-Signature: i=1; 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:dkim-signature; bh=ndh++ISCVsYIIHWo/+u6xV9tnDH00lNaniDVHxN7iZI=; fh=8rlZcc3w8h+5OhDlEMfudHXh3g6Yp/rTapFoisVAVgA=; b=hWSTHJqIHBK+3c2SyZh6s1XXzv0pCPan7MwMz6Cfr+5w1ZCoFxifFcO4QmKt3NXnph X8JrKlAJah7VRkfdPRaswBEj/SuZec09x7zJXTXVc/fwN5Ducn5tIiB5GIix+ZlKChgn DMqzPRKgZLCd0StJ2jJRI1JBE/j9DjN/x6Gizbu4/grl+UoKA774CMzEY95TLqMOL+av CC+bl7eQ8o4Tfa80goTI8fUyJ8HMm63EUQJk+VI7QWJspmKrMmJMb3qEeQlYvgWvvzHs EZXo7TWEUFwN/Y0msJ8fwMHWj+09IlohIjOJ9VKABCRuHTSyyOVgHUYClKZkLOZQrdir 30Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=K3lWZT7r; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=meAJJHVy; spf=pass (google.com: domain of linux-kernel+bounces-18886-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18886-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id oz5-20020a170906cd0500b00a28c07c85casi2480547ejb.197.2024.01.07.07.14.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 07:14:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18886-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=K3lWZT7r; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=meAJJHVy; spf=pass (google.com: domain of linux-kernel+bounces-18886-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18886-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7955F1F218BC for <ouuuleilei@gmail.com>; Sun, 7 Jan 2024 15:14:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6DB413AF1; Sun, 7 Jan 2024 15:13:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alu.unizg.hr header.i=@alu.unizg.hr header.b="K3lWZT7r"; dkim=pass (2048-bit key) header.d=alu.unizg.hr header.i=@alu.unizg.hr header.b="meAJJHVy" X-Original-To: linux-kernel@vger.kernel.org Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B42413AC3; Sun, 7 Jan 2024 15:13:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alu.unizg.hr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alu.unizg.hr Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id DEFE66017E; Sun, 7 Jan 2024 16:13:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1704640432; bh=UQMDbuI7hDMHLOqvTe8W5mN0lKSzuLSjkDfcH/BL+qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K3lWZT7rZ6eExSqrlRb5/4PAZEvJ247D6e+xfyE0PxOrhpbTxH6oIhWbl1ttTX0ju MoHcbTVcFsY5DBRpHX0uxbOwi8IP3Hw4yscS7qJjqvpGlJk+O9abvYc3X/HJWkjzjm KrSzZ1X2sMjvi3FJ22yCZldnDWFybzHI+Db2wYLRCkTw89Uc/gk1U89G0Y9JxJg0wU QRAfZQ7a3l2NP/0IWuWqt3DbU4WtWBPtwe1nPnsw6ODpPbTh02xElHSbMfx5VjtiXE CoPbglB82xk/Sn3mQBoAIK0i2s/VeOpKnJmVutL0V/yYI0jL4wwmoZb4qq3FfpBa2w sCKiZbt8lJX1Q== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dMbbvhzBhNU3; Sun, 7 Jan 2024 16:13:50 +0100 (CET) Received: from defiant.. (unknown [95.168.121.73]) by domac.alu.hr (Postfix) with ESMTPSA id 602D260171; Sun, 7 Jan 2024 16:13:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1704640430; bh=UQMDbuI7hDMHLOqvTe8W5mN0lKSzuLSjkDfcH/BL+qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=meAJJHVyehXP/Ai4sQQqf/VyhWjBz5BIXpTzSZSF3fWKo/kNZr0+DnJl2e8j/IGTX i0im6A6Ei0kJEo5mjJX/+NPEQpngRDA+pPEOWk4UeVGZ+DAbnZFtU6ldSr3uhqNb4m h8sGZoV7P46MrBZmyRIAIC5OKg6r10dFo9JUU6E9pHtK7gdJ0p1sJoyJ6kV5Aa9z10 1/UGt9v6OESKZ0Q3ysFHApeR/xKCP6XQGOm8uH0DgvZLNqXQVEJZl0P4sOxRPcY8XK eoK1jhk0zqd+v47UOPpkgn2VpcWgpHwzSX05fLISGJ8rucweNPzW6SvjVO9fxIR0nP UqMjgRPwA9yFA== From: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr> To: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>, Mark Brown <broonie@kernel.org>, linux-sound@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Shuah Khan <shuah@kernel.org>, Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr> Subject: [PATCH v1 3/4] ksellftest: alsa: Fix the printf format specifier to unsigned int Date: Sun, 7 Jan 2024 16:12:20 +0100 Message-Id: <20240107151218.933806-4-mirsad.todorovac@alu.unizg.hr> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240107151218.933806-1-mirsad.todorovac@alu.unizg.hr> References: <20240107151218.933806-1-mirsad.todorovac@alu.unizg.hr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787445081886791730 X-GMAIL-MSGID: 1787445081886791730 |
Series |
kselftest: alsa: Fix a couple of format specifiers and function parameters
|
|
Commit Message
Mirsad Todorovac
Jan. 7, 2024, 3:12 p.m. UTC
GCC 13.2.0 compiler issued the following warning:
mixer-test.c:350:80: warning: format ‘%ld’ expects argument of type ‘long int’, \
but argument 5 has type ‘unsigned int’ [-Wformat=]
350 | ksft_print_msg("%s.%d value %ld more than item count %ld\n",
| ~~^
| |
| long int
| %d
351 | ctl->name, index, int_val,
352 | snd_ctl_elem_info_get_items(ctl->info));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| unsigned int
Fixing the format specifier in call to ksft_print_msg() according to the
compiler suggestion silences the warning.
Fixes: 10f2f194663af ("kselftest: alsa: Validate values read from enumerations")
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-sound@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
---
tools/testing/selftests/alsa/mixer-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sun, Jan 07, 2024 at 04:12:20PM +0100, Mirsad Todorovac wrote: > mixer-test.c:350:80: warning: format ‘%ld’ expects argument of type ‘long int’, \ > but argument 5 has type ‘unsigned int’ [-Wformat=] If this is the issue then... > - ksft_print_msg("%s.%d value %ld more than item count %ld\n", > + ksft_print_msg("%s.%d value %ld more than item count %d\n", > ctl->name, index, int_val, > snd_ctl_elem_info_get_items(ctl->info)); ...why are we not using an unsigned format specifier here? I am very suprised this doesn't continue to warn. Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.
On 07. 01. 2024. 16:33, Mark Brown wrote: > On Sun, Jan 07, 2024 at 04:12:20PM +0100, Mirsad Todorovac wrote: > >> mixer-test.c:350:80: warning: format ‘%ld’ expects argument of type ‘long int’, \ >> but argument 5 has type ‘unsigned int’ [-Wformat=] > > If this is the issue then... > >> - ksft_print_msg("%s.%d value %ld more than item count %ld\n", >> + ksft_print_msg("%s.%d value %ld more than item count %d\n", >> ctl->name, index, int_val, >> snd_ctl_elem_info_get_items(ctl->info)); > > ...why are we not using an unsigned format specifier here? I am very > suprised this doesn't continue to warn. I double-checked and there is no warning, but I will fix it as you suggested. > Please submit patches using subject lines reflecting the style for the > subsystem, this makes it easier for people to identify relevant patches. > Look at what existing commits in the area you're changing are doing and > make sure your subject lines visually resemble what they're doing. > There's no need to resubmit to fix this alone. I am just looking at the `git log --oneline tools/testing/selftests/alsa` and I can't seem to get inspiration. I guess I can keep the Acked-by tags. Will the patchwork find the tag in the v1 patch set? Sorry for the lag in [PATCH v1 4/4]. I thought I pressed submit, but I obviously did not. Thanks, Mirsad
On Sun, Jan 07, 2024 at 05:21:00PM +0100, Mirsad Todorovac wrote: > I guess I can keep the Acked-by tags. Will the patchwork find the tag in > the v1 patch set? No, you need to include it.
s/ksellftest/kselftest/
On 07. 01. 2024. 19:14, Mark Brown wrote: > On Sun, Jan 07, 2024 at 05:21:00PM +0100, Mirsad Todorovac wrote: > >> I guess I can keep the Acked-by tags. Will the patchwork find the tag in >> the v1 patch set? > > No, you need to include it. Great. Sent v2 for review. I heard that there is a rule "one version per day or when confirmed"? Nevertheless, these are minor fixes in the error reporting logic (though no change is small enough to bee taken lightly), so I am sending now because I don't know about the load tomorrow. Please find v2 of the patch set on the LKML. Kept two ACKs (code unchnaged), two left to review. Thanks, Mirsad
On 07. 01. 2024. 19:40, Andreas Schwab wrote:
> s/ksellftest/kselftest/
Thx.
Fixed in v2.
Thanks,
Mirsad
diff --git a/tools/testing/selftests/alsa/mixer-test.c b/tools/testing/selftests/alsa/mixer-test.c index df942149c6f6..e3708cc52db7 100644 --- a/tools/testing/selftests/alsa/mixer-test.c +++ b/tools/testing/selftests/alsa/mixer-test.c @@ -347,7 +347,7 @@ static bool ctl_value_index_valid(struct ctl_data *ctl, } if (int_val >= snd_ctl_elem_info_get_items(ctl->info)) { - ksft_print_msg("%s.%d value %ld more than item count %ld\n", + ksft_print_msg("%s.%d value %ld more than item count %d\n", ctl->name, index, int_val, snd_ctl_elem_info_get_items(ctl->info)); return false;