From: Takashi Iwai <tiwai@suse.de>
To: hariconscious@gmail.com
Cc: perex@perex.cz, tiwai@suse.com, khalid@kernel.org,
shuah@kernel.org, david.hunter.linux@gmail.com,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: rawmidi: Fix inconsistent indenting warning reported by smatch
Date: Mon, 01 Dec 2025 16:02:12 +0100 [thread overview]
Message-ID: <87o6oikzyj.wl-tiwai@suse.de> (raw)
In-Reply-To: <20251201144620.18942-2-hariconscious@gmail.com>
On Mon, 01 Dec 2025 15:46:21 +0100,
hariconscious@gmail.com wrote:
>
> From: HariKrishna Sagala <hariconscious@gmail.com>
>
> Fix smatch reported inconsistent indenting warning in rawmidi.
> sound/core/rawmidi.c:2115 alsa_rawmidi_init() warn: inconsistent
> indenting.
> No functional changes were introduced.
>
> Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
> ---
> This patch fixes the below smatch reported warning
> sound/core/rawmidi.c:2115 alsa_rawmidi_init() warn: inconsistent
> indenting.
> Re-ran the smatch to confirm warning is cleared and no functional
> changes were introduced.
Just move "int i" into the for() and drop braces instead -- which is
allowed in the recent versions, and it's much nicer than shifting way
too many texts just for a minor smatch warning.
thanks,
Takashi
>
> Thank you.
>
> sound/core/rawmidi.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
> index 20d36a346cca..5d90341cc18f 100644
> --- a/sound/core/rawmidi.c
> +++ b/sound/core/rawmidi.c
> @@ -2106,25 +2106,25 @@ EXPORT_SYMBOL(snd_rawmidi_set_ops);
>
> static int __init alsa_rawmidi_init(void)
> {
> -
> snd_ctl_register_ioctl(snd_rawmidi_control_ioctl);
> snd_ctl_register_ioctl_compat(snd_rawmidi_control_ioctl);
> #ifdef CONFIG_SND_OSSEMUL
> - { int i;
> - /* check device map table */
> - for (i = 0; i < SNDRV_CARDS; i++) {
> - if (midi_map[i] < 0 || midi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
> - pr_err("ALSA: rawmidi: invalid midi_map[%d] = %d\n",
> - i, midi_map[i]);
> - midi_map[i] = 0;
> - }
> - if (amidi_map[i] < 0 || amidi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
> - pr_err("ALSA: rawmidi: invalid amidi_map[%d] = %d\n",
> - i, amidi_map[i]);
> - amidi_map[i] = 1;
> + {
> + int i;
> + /* check device map table */
> + for (i = 0; i < SNDRV_CARDS; i++) {
> + if (midi_map[i] < 0 || midi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
> + pr_err("ALSA: rawmidi: invalid midi_map[%d] = %d\n",
> + i, midi_map[i]);
> + midi_map[i] = 0;
> + }
> + if (amidi_map[i] < 0 || amidi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
> + pr_err("ALSA: rawmidi: invalid amidi_map[%d] = %d\n",
> + i, amidi_map[i]);
> + amidi_map[i] = 1;
> + }
> }
> }
> - }
> #endif /* CONFIG_SND_OSSEMUL */
> return 0;
> }
>
> base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
> --
> 2.43.0
>
prev parent reply other threads:[~2025-12-01 15:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 14:46 [PATCH] ALSA: rawmidi: Fix inconsistent indenting warning reported by smatch hariconscious
2025-12-01 15:02 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o6oikzyj.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=david.hunter.linux@gmail.com \
--cc=hariconscious@gmail.com \
--cc=khalid@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=shuah@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox