From: Takashi Iwai <tiwai@suse.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Baojun Xu <baojun.xu@ti.com>,
tiwai@suse.de, robh+dt@kernel.org, lgirdwood@gmail.com,
perex@perex.cz, pierre-louis.bossart@linux.intel.com,
shenghao-ding@ti.com, navada@ti.com, 13916275206@139.com,
v-hampiholi@ti.com, v-po@ti.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, liam.r.girdwood@intel.com,
yung-chuan.liao@linux.intel.com, broonie@kernel.org,
antheas.dk@gmail.com
Subject: Re: [PATCH v2] ALSA: hda/tas2781: Add speaker id check for ASUS projects
Date: Mon, 21 Oct 2024 09:19:19 +0200 [thread overview]
Message-ID: <8734kpkjns.wl-tiwai@suse.de> (raw)
In-Reply-To: <ZxJVCb13lQ4h2KRD@smile.fi.intel.com>
On Fri, 18 Oct 2024 14:31:05 +0200,
Andy Shevchenko wrote:
>
> On Fri, Oct 18, 2024 at 03:11:18PM +0800, Baojun Xu wrote:
> > + // Speaker id is not valid, use default.
> > + dev_dbg(tas_priv->dev, "Wrong spk_id = %d\n", spk_id);
> > + spk_id = 0;
> > + }
> > + scnprintf(tas_priv->coef_binaryname,
>
> Why 'c' variant? You do not check the return value anyway. So, what's the point?
There is a difference between snprintf() and scnprintf().
With W=1, the compiler (at least the recent gcc version) will warn you
when the string truncation may happen in the former case while not
complaining for the latter.
So, when the truncation is intentional and acceptable (that's
certainly most cases), the use of scnprintf() will result in less
warnings.
Takashi
next prev parent reply other threads:[~2024-10-21 7:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 7:11 [PATCH v2] ALSA: hda/tas2781: Add speaker id check for ASUS projects Baojun Xu
2024-10-18 12:31 ` Andy Shevchenko
2024-10-21 7:19 ` Takashi Iwai [this message]
2024-10-21 8:19 ` Andy Shevchenko
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=8734kpkjns.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=13916275206@139.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=antheas.dk@gmail.com \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=liam.r.girdwood@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=navada@ti.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=robh+dt@kernel.org \
--cc=shenghao-ding@ti.com \
--cc=v-hampiholi@ti.com \
--cc=v-po@ti.com \
--cc=yung-chuan.liao@linux.intel.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