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: <Yqil3UDSmoXN3E9M@kroah.com>
Date:   Tue, 14 Jun 2022 17:14:37 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc:     Bard Liao <yung-chuan.liao@...ux.intel.com>,
        alsa-devel@...a-project.org, vkoul@...nel.org,
        vinod.koul@...aro.org, linux-kernel@...r.kernel.org, tiwai@...e.de,
        broonie@...nel.org, srinivas.kandagatla@...aro.org,
        sanyog.r.kale@...el.com, bard.liao@...el.com
Subject: Re: [PATCH 2/2] ASoC: SOF: Intel: add trigger callback into
 sdw_callback

On Tue, Jun 14, 2022 at 09:55:41AM -0500, Pierre-Louis Bossart wrote:
> 
> >> @@ -809,6 +814,10 @@ void hda_set_dai_drv_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *ops)
> >>  		if (!hda_use_tplg_nhlt)
> >>  			ipc4_data->nhlt = intel_nhlt_init(sdev->dev);
> >>  
> >> +#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)
> >> +		sdw_callback.trigger = ipc4_be_dai_common_trigger;
> >> +#endif
> > 
> > #if should not be in .c files if at all possible.  Surely there's a
> > better way here...
> 
> we could use
> 
> if (IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE))
>     sdw_callback.trigger = ipc4_be_dai_common_trigger;
> 
> would that work?

It's more readable, right?  Also easier to maintain over time.

> We try to keep this driver configurable, not all platforms require
> SoundWire or HDaudio, and that 'sdw_callback' ops structure is
> conditionally declared.

Perhaps don't conditionally declare that?  How much does it really save
to do that?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ