lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZJ1mUmI7wOhp710M@smile.fi.intel.com>
Date:   Thu, 29 Jun 2023 14:09:06 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        Oder Chiou <oder_chiou@...ltek.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Subject: Re: [PATCH v1 2/3] ASoC: rt5677: Use device_get_match_data()

On Thu, Jun 29, 2023 at 11:56:10AM +0100, Mark Brown wrote:
> On Thu, Jun 29, 2023 at 01:46:02PM +0300, Andy Shevchenko wrote:

...

> > +	rt5677->type = (enum rt5677_type)(uintptr_t)device_get_match_data(dev);

> Double casts, always a sign of a successful simplification! :P

Unfortunate of the C language and use of plain numbers when
pointers are required. :-( I feel your pain.

> > +	if (rt5677->type == 0)
> >  		return -EINVAL;
> > -	}

I would prefer to see in the ID table something like

	.compatible = "foo", .data = &codec[RT5677],

but in this driver it seems it will require quite a refactoring.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ