From: Takashi Iwai <tiwai@suse.de>
To: "Xu, Baojun" <baojun.xu@ti.com>
Cc: Takashi Iwai <tiwai@suse.de>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"perex@perex.cz" <perex@perex.cz>,
"Ding, Shenghao" <shenghao-ding@ti.com>,
"Navada Kanyana, Mukund" <navada@ti.com>,
"13916275206@139.com" <13916275206@139.com>,
"Hampiholi, Vallabha" <v-hampiholi@ti.com>,
"P O, Vijeth" <v-po@ti.com>,
"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"liam.r.girdwood@intel.com" <liam.r.girdwood@intel.com>,
"yung-chuan.liao@linux.intel.com"
<yung-chuan.liao@linux.intel.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"antheas.dk@gmail.com" <antheas.dk@gmail.com>,
"stuart.a.hayhurst@gmail.com" <stuart.a.hayhurst@gmail.com>,
"dan.carpenter@linaro.org" <dan.carpenter@linaro.org>
Subject: Re: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects
Date: Mon, 13 Jan 2025 08:47:12 +0100 [thread overview]
Message-ID: <87ldvf2m0v.wl-tiwai@suse.de> (raw)
In-Reply-To: <311e99af8c6d4041ac2c19b115a8c0ab@ti.com>
On Mon, 13 Jan 2025 07:41:02 +0100,
Xu, Baojun wrote:
>
> > ________________________________________
> > From: Takashi Iwai <tiwai@suse.de>
> > Sent: 12 January 2025 16:26
> > To: Xu, Baojun
> > Cc: tiwai@suse.de; robh+dt@kernel.org; andriy.shevchenko@linux.intel.com; lgirdwood@gmail.com; perex@perex.cz; Ding, Shenghao; Navada Kanyana, Mukund; 13916275206@139.com; Hampiholi, Vallabha; P O, Vijeth; 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; stuart.a.hayhurst@gmail.com; dan.carpenter@linaro.org
> > Subject: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects
> >
> > On Sat, 11 Jan 2025 10: 57: 28 +0100, Baojun Xu wrote: > > Driver will return error if no SUBSYS_ID found in BIOS(acpi). > It will cause error in tas2563 projects, which have no SUBSYS_ID. > Change strncmp to strcmp to avoid warning
> > ZjQcmQRYFpfptBannerStart
> > This message was sent from outside of Texas Instruments.
> > Do not click links or open attachments unless you recognize the source of this email and know the content is safe.
> > <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!vxdrHfwF_qfzogYE_xtoX7lTozH70XOKA0HRu-ioBvUvCv8QNkmAsR1WurvR9Zlh7GmU7A$>
> > Report Suspicious
> >
> > ZjQcmQRYFpfptBannerEnd
> >
> > On Sat, 11 Jan 2025 10:57:28 +0100,
> > Baojun Xu wrote:
> > >
> > > Driver will return error if no SUBSYS_ID found in BIOS(acpi).
> > > It will cause error in tas2563 projects, which have no SUBSYS_ID.
> > > Change strncmp to strcmp to avoid warning for weird length.
> >
> > I don't understand the logic.
> > The use of strncmp() there already matches only with the exact string
> > "INT8866", not the substring, because you use sizeof("INT8866") which
> > is 8 including the NUL-terminator.
> > The only merit of strncmp() in this case is that it can be used for an
> > unterminated char array.
> >
> > In which situation do you see the problem and how does your patch
> > improve / fix it? Please give a more concrete example.
> >
>
> Because it will have Smatch Static Checker warning:
>
> sound/pci/hda/tas2781_hda_i2c.c:146 tas2781_read_acpi()
> warn: strncmp() with weird length: 7 vs 8
>
> sound/pci/hda/tas2781_hda_i2c.c
> 144 if (IS_ERR(sub)) {
> 145 /* No subsys id in older tas2563 projects. */
> --> 146 if (!strncmp(hid, "INT8866", sizeof("INT8866")))
>
> This patch will avoid this warning, and this hid will be a null terminated
> "INT8866", so have no different when this code was go through.
Ah, so your change is only about the last line in the sentence.
The former two lines describe what the current driver already does.
As the driver behavior won't change, your current patch subject and
description are way too confusing. Please rephrase them and
resubmit. It's nothing but just a code refactoring that eventually
shuts up the Smatch warning, after all.
thanks,
Takashi
next prev parent reply other threads:[~2025-01-13 7:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-11 9:57 [PATCH v1] ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects Baojun Xu
2025-01-12 8:26 ` Takashi Iwai
2025-01-13 5:33 ` Dan Carpenter
2025-01-13 6:41 ` [EXTERNAL] " Xu, Baojun
2025-01-13 7:47 ` Takashi Iwai [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-30 6:49 Baojun Xu
2025-01-13 8:37 ` Andy Shevchenko
2025-01-13 8:45 ` [EXTERNAL] " Xu, Baojun
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=87ldvf2m0v.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=dan.carpenter@linaro.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=robh+dt@kernel.org \
--cc=shenghao-ding@ti.com \
--cc=stuart.a.hayhurst@gmail.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