From: Mark Brown <broonie@kernel.org> To: Alexander Heinrich <hallo@alexanderheinrich.de> Cc: tiwai@suse.de, perex@perex.cz, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH v2] kselftest/alsa: Fix -Wformat compiler warnings Date: Fri, 24 Mar 2023 16:33:17 +0000 [thread overview] Message-ID: <ZB3Qzes5fpFhmazb@sirena.org.uk> (raw) In-Reply-To: <20230324160158.4076-1-hallo@alexanderheinrich.de> [-- Attachment #1: Type: text/plain, Size: 894 bytes --] On Fri, Mar 24, 2023 at 05:01:58PM +0100, Alexander Heinrich wrote: > For the string to int conversion functions, the return values for the test cases > in pcm-test.conf are non-negative and in the range of unsigned int, so I just > cast them to unsigned int. That sounds like you're masking some issue rather than fixing it, but... > Please let me know if I can further improve on my patch (it is my first)! It might be easier to split the different kinds of change up into separate patches, it'd make it easier to follow what's going on. > + phys_width = snd_pcm_format_physical_width(format); > + if (phys_width < 0) > + ksft_exit_fail_msg("Unknown PCM format\n"); > samples = realloc(samples, (rate * channels * > - snd_pcm_format_physical_width(format)) / 8); > + (unsigned int)phys_width) / 8); ...this isn't a formatting function, it's realloc()? [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org> To: Alexander Heinrich <hallo@alexanderheinrich.de> Cc: tiwai@suse.de, linux-kernel-mentees@lists.linuxfoundation.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, perex@perex.cz Subject: Re: [PATCH v2] kselftest/alsa: Fix -Wformat compiler warnings Date: Fri, 24 Mar 2023 16:33:17 +0000 [thread overview] Message-ID: <ZB3Qzes5fpFhmazb@sirena.org.uk> (raw) In-Reply-To: <20230324160158.4076-1-hallo@alexanderheinrich.de> [-- Attachment #1.1: Type: text/plain, Size: 894 bytes --] On Fri, Mar 24, 2023 at 05:01:58PM +0100, Alexander Heinrich wrote: > For the string to int conversion functions, the return values for the test cases > in pcm-test.conf are non-negative and in the range of unsigned int, so I just > cast them to unsigned int. That sounds like you're masking some issue rather than fixing it, but... > Please let me know if I can further improve on my patch (it is my first)! It might be easier to split the different kinds of change up into separate patches, it'd make it easier to follow what's going on. > + phys_width = snd_pcm_format_physical_width(format); > + if (phys_width < 0) > + ksft_exit_fail_msg("Unknown PCM format\n"); > samples = realloc(samples, (rate * channels * > - snd_pcm_format_physical_width(format)) / 8); > + (unsigned int)phys_width) / 8); ...this isn't a formatting function, it's realloc()? [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 201 bytes --] _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2023-03-24 16:33 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-03-24 16:01 [PATCH v2] kselftest/alsa: Fix -Wformat compiler warnings Alexander Heinrich 2023-03-24 16:01 ` Alexander Heinrich 2023-03-24 16:33 ` Mark Brown [this message] 2023-03-24 16:33 ` Mark Brown
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=ZB3Qzes5fpFhmazb@sirena.org.uk \ --to=broonie@kernel.org \ --cc=hallo@alexanderheinrich.de \ --cc=linux-kernel-mentees@lists.linuxfoundation.org \ --cc=linux-kselftest@vger.kernel.org \ --cc=perex@perex.cz \ --cc=shuah@kernel.org \ --cc=tiwai@suse.de \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.