mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] ALSA: Improve style of pnp_device_id array terminators
Date: Tue, 9 Jun 2026 21:20:15 +0200	[thread overview]
Message-ID: <aihnGSmBPNjccGKR@monoceros> (raw)
In-Reply-To: <15b9f06b-952b-4c55-aea3-fd64f456d30e@perex.cz>

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

On Tue, Jun 09, 2026 at 08:38:57PM +0200, Jaroslav Kysela wrote:
> On 6/9/26 18:46, Uwe Kleine-König (The Capable Hub) wrote:
> > To match how device-id array terminators look like for other device
> > types drop `.id = ""` from it and let the compiler care for zeroing the
> > entry.
> > 
> > There are no changes in the compiled drivers, only the source looks
> > nicer.
> 
> It's not true. Unless the matching and lookup functions are not changed,
> there's difference between NULL pointer and pointer to an empty string.
> 
> See match_device in drivers/pnp/driver.c - "while (*drv_id->id)". Your
> change will cause NULL pointer dereference.

That's an easy but wrong diagnosis that I fell for first, too. Note that
.id is not a pointer but a char array.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-06-09 19:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 16:46 Uwe Kleine-König (The Capable Hub)
2026-06-09 18:38 ` Jaroslav Kysela
2026-06-09 19:20   ` Uwe Kleine-König (The Capable Hub) [this message]
2026-06-09 19:26     ` Jaroslav Kysela
2026-06-10  7:25 ` Takashi Iwai

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=aihnGSmBPNjccGKR@monoceros \
    --to=u.kleine-koenig@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --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

all inboxes | Powered by JetHome®