Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: Baojun Xu <baojun.xu@ti.com>,
	robh+dt@kernel.org, andriy.shevchenko@linux.intel.com,
	lgirdwood@gmail.com, perex@perex.cz, 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, stuart.a.hayhurst@gmail.com
Subject: Re: [PATCH v1] ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects
Date: Mon, 13 Jan 2025 08:33:46 +0300	[thread overview]
Message-ID: <92d30be2-4f77-455a-ae5f-8fe4a5a365ee@stanley.mountain> (raw)
In-Reply-To: <87ldvgtp36.wl-tiwai@suse.de>

On Sun, Jan 12, 2025 at 09:26:37AM +0100, Takashi Iwai wrote:
> 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.
> 

I was just confused by the initial code and wondered if it was
intended to be: if (!strncmp(hid, "INT8866", sizeof("INT8866") - 1)).
This change doesn't affect anything, it's just a clarification.

But the subject "Ignore SUBSYS_ID not found for tas2563 projects" implies
that it's a change.

regards,
dan carpenter

  reply	other threads:[~2025-01-13  5:33 UTC|newest]

Thread overview: 8+ 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 [this message]
2025-01-13  6:41   ` [EXTERNAL] " Xu, Baojun
2025-01-13  7:47     ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2024-12-30  6:49 Baojun Xu
2024-12-30 10:40 ` Takashi Iwai
2025-01-13  8:37 ` 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=92d30be2-4f77-455a-ae5f-8fe4a5a365ee@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --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=robh+dt@kernel.org \
    --cc=shenghao-ding@ti.com \
    --cc=stuart.a.hayhurst@gmail.com \
    --cc=tiwai@suse.de \
    --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