[alsa-devel] [PATCH 1/8] ALSA: Replace timespec with timespec64
kbuild test robot
lkp at intel.com
Thu Apr 26 10:15:32 CEST 2018
Hi Baolin,
I love your patch! Yet something to improve:
[auto build test ERROR on v4.17-rc2]
[also build test ERROR on next-20180424]
[cannot apply to sound/for-next asoc/for-next arm-soc/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Baolin-Wang/Fix-year-2038-issue-for-sound-subsystem/20180426-010145
config: sh-ecovec24_defconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sh
Note: the linux-review/Baolin-Wang/Fix-year-2038-issue-for-sound-subsystem/20180426-010145 HEAD 53cdcc389f07bdd923be240cdb746a97de063301 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
sound/core/pcm_lib.c: In function 'update_audio_tstamp':
>> sound/core/pcm_lib.c:256:54: error: passing argument 2 of 'timespec_equal' from incompatible pointer type [-Werror=incompatible-pointer-types]
if (!timespec_equal(&runtime->status->audio_tstamp, audio_tstamp)) {
^~~~~~~~~~~~
In file included from include/linux/time.h:73:0,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from include/linux/workqueue.h:9,
from include/linux/srcu.h:34,
from include/linux/notifier.h:16,
from include/linux/memory_hotplug.h:7,
from include/linux/mmzone.h:777,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from sound/core/pcm_lib.c:23:
include/linux/time32.h:59:19: note: expected 'const struct timespec *' but argument is of type 'struct timespec64 *'
static inline int timespec_equal(const struct timespec *a,
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/timespec_equal +256 sound/core/pcm_lib.c
^1da177e Linus Torvalds 2005-04-16 222
3179f620 Pierre-Louis Bossart 2015-02-13 223 static void update_audio_tstamp(struct snd_pcm_substream *substream,
ac8bbfea Baolin Wang 2018-04-24 224 struct timespec64 *curr_tstamp,
ac8bbfea Baolin Wang 2018-04-24 225 struct timespec64 *audio_tstamp)
3179f620 Pierre-Louis Bossart 2015-02-13 226 {
3179f620 Pierre-Louis Bossart 2015-02-13 227 struct snd_pcm_runtime *runtime = substream->runtime;
3179f620 Pierre-Louis Bossart 2015-02-13 228 u64 audio_frames, audio_nsecs;
ac8bbfea Baolin Wang 2018-04-24 229 struct timespec64 driver_tstamp;
3179f620 Pierre-Louis Bossart 2015-02-13 230
3179f620 Pierre-Louis Bossart 2015-02-13 231 if (runtime->tstamp_mode != SNDRV_PCM_TSTAMP_ENABLE)
3179f620 Pierre-Louis Bossart 2015-02-13 232 return;
3179f620 Pierre-Louis Bossart 2015-02-13 233
3179f620 Pierre-Louis Bossart 2015-02-13 234 if (!(substream->ops->get_time_info) ||
3179f620 Pierre-Louis Bossart 2015-02-13 235 (runtime->audio_tstamp_report.actual_type ==
3179f620 Pierre-Louis Bossart 2015-02-13 236 SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT)) {
3179f620 Pierre-Louis Bossart 2015-02-13 237
3179f620 Pierre-Louis Bossart 2015-02-13 238 /*
3179f620 Pierre-Louis Bossart 2015-02-13 239 * provide audio timestamp derived from pointer position
3179f620 Pierre-Louis Bossart 2015-02-13 240 * add delay only if requested
3179f620 Pierre-Louis Bossart 2015-02-13 241 */
3179f620 Pierre-Louis Bossart 2015-02-13 242
3179f620 Pierre-Louis Bossart 2015-02-13 243 audio_frames = runtime->hw_ptr_wrap + runtime->status->hw_ptr;
3179f620 Pierre-Louis Bossart 2015-02-13 244
3179f620 Pierre-Louis Bossart 2015-02-13 245 if (runtime->audio_tstamp_config.report_delay) {
3179f620 Pierre-Louis Bossart 2015-02-13 246 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
3179f620 Pierre-Louis Bossart 2015-02-13 247 audio_frames -= runtime->delay;
3179f620 Pierre-Louis Bossart 2015-02-13 248 else
3179f620 Pierre-Louis Bossart 2015-02-13 249 audio_frames += runtime->delay;
3179f620 Pierre-Louis Bossart 2015-02-13 250 }
3179f620 Pierre-Louis Bossart 2015-02-13 251 audio_nsecs = div_u64(audio_frames * 1000000000LL,
3179f620 Pierre-Louis Bossart 2015-02-13 252 runtime->rate);
ac8bbfea Baolin Wang 2018-04-24 253 *audio_tstamp = ns_to_timespec64(audio_nsecs);
3179f620 Pierre-Louis Bossart 2015-02-13 254 }
ac8bbfea Baolin Wang 2018-04-24 255
20e3f985 Henrik Eriksson 2017-11-21 @256 if (!timespec_equal(&runtime->status->audio_tstamp, audio_tstamp)) {
ac8bbfea Baolin Wang 2018-04-24 257 runtime->status->audio_tstamp =
ac8bbfea Baolin Wang 2018-04-24 258 timespec64_to_timespec(*audio_tstamp);
ac8bbfea Baolin Wang 2018-04-24 259 runtime->status->tstamp = timespec64_to_timespec(*curr_tstamp);
20e3f985 Henrik Eriksson 2017-11-21 260 }
3179f620 Pierre-Louis Bossart 2015-02-13 261
ac8bbfea Baolin Wang 2018-04-24 262
3179f620 Pierre-Louis Bossart 2015-02-13 263 /*
3179f620 Pierre-Louis Bossart 2015-02-13 264 * re-take a driver timestamp to let apps detect if the reference tstamp
3179f620 Pierre-Louis Bossart 2015-02-13 265 * read by low-level hardware was provided with a delay
3179f620 Pierre-Louis Bossart 2015-02-13 266 */
ac8bbfea Baolin Wang 2018-04-24 267 snd_pcm_gettime(substream->runtime, &driver_tstamp);
3179f620 Pierre-Louis Bossart 2015-02-13 268 runtime->driver_tstamp = driver_tstamp;
3179f620 Pierre-Louis Bossart 2015-02-13 269 }
3179f620 Pierre-Louis Bossart 2015-02-13 270
:::::: The code at line 256 was first introduced by commit
:::::: 20e3f985bb875fea4f86b04eba4b6cc29bfd6b71 ALSA: pcm: update tstamp only if audio_tstamp changed
:::::: TO: Henrik Eriksson <henrik.eriksson at axis.com>
:::::: CC: Takashi Iwai <tiwai at suse.de>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 15699 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180426/73cc4178/attachment-0001.bin>
More information about the Alsa-devel
mailing list