From d271659f968228e956187f5c7837a69a9b7a672e Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Thu, 14 Jan 2021 20:26:48 +0900 Subject: [PATCH] audio/ac97: Fix DEBUG build - Fix VERSION macro in auich.h / auvia.h, used for log_create() in debug.c. - Add string.h to debug.c for strlen(). Change-Id: Iff4878763f49fe5b7e317c47e96ebd79f90725c8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3629 Reviewed-by: Adrien Destugues --- .../kernel/drivers/audio/ac97/auich/auich.h | 2 +- .../kernel/drivers/audio/ac97/auich/debug.c | 27 +++++++------- .../kernel/drivers/audio/ac97/auvia/auvia.h | 36 +++++++++---------- .../kernel/drivers/audio/ac97/auvia/debug.c | 27 +++++++------- 4 files changed, 47 insertions(+), 45 deletions(-) diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h index 0ec3d03abc..2d97a3391f 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h +++ b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h @@ -64,7 +64,7 @@ #define AMD_AMD8111_AC97_DEVICE_ID 0x764d #define AMD_AMD768_AC97_DEVICE_ID 0x7445 -#define VERSION "Version alpha 1, Copyright (c) 2003 Jérôme Duval, compiled on " ## __DATE__ ## " " ## __TIME__ +#define VERSION "Version alpha 1, Copyright (c) 2003 Jérôme Duval, compiled on " __DATE__ " " __TIME__ #define DRIVER_NAME "auich" #define FRIENDLY_NAME "Auich" #define AUTHOR "Jérôme Duval" diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/debug.c b/src/add-ons/kernel/drivers/audio/ac97/auich/debug.c index b396a495c1..ce6b53f156 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auich/debug.c +++ b/src/add-ons/kernel/drivers/audio/ac97/auich/debug.c @@ -7,24 +7,24 @@ * Copyright (c) 2002, Marcus Overhagen * * All rights reserved. - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * - * - Redistributions of source code must retain the above copyright notice, + * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation + * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ @@ -32,8 +32,9 @@ #include -#include #include +#include +#include #include #include diff --git a/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.h b/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.h index 820876467a..3cc0138cdd 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.h +++ b/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.h @@ -2,7 +2,7 @@ * Auvia BeOS Driver for Via VT82xx Southbridge audio * * Copyright (c) 2003, Jerome Duval (jerome.duval@free.fr) - + * This code is derived from software contributed to The NetBSD Foundation * by Tyler C. Sarna * @@ -34,7 +34,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - + #ifndef _DEV_PCI_AUVIA_H_ #define _DEV_PCI_AUVIA_H_ @@ -59,7 +59,7 @@ #define VIATECH_8233_AC97_REV_8235 0x50 #define VIATECH_8233_AC97_REV_8237 0x60 //this is the 5.1 Card in the new Athlon64 boards -#define VERSION "Version alpha 2, Copyright (c) 2003 Jérôme Duval, compiled on " ## __DATE__ ## " " ## __TIME__ +#define VERSION "Version alpha 2, Copyright (c) 2003 Jérôme Duval, compiled on " __DATE__ " " __TIME__ #define DRIVER_NAME "auvia" #define FRIENDLY_NAME "Auvia" #define FRIENDLY_NAME_686 FRIENDLY_NAME" 82C686" @@ -91,7 +91,7 @@ typedef struct _auvia_mem { /* * Streams */ - + typedef struct _auvia_stream { struct _auvia_dev *card; uint8 use; @@ -101,23 +101,23 @@ typedef struct _auvia_stream { uint8 channels; uint32 bufframes; uint8 bufcount; - + uint32 base; - + LIST_ENTRY(_auvia_stream) next; - + void (*inth) (void *); void *inthparam; - + void *dmaops_log_base; void *dmaops_phy_base; area_id dmaops_area; - + auvia_mem *buffer; uint16 blksize; /* in samples */ uint16 trigblk; /* blk on which to trigger inth */ uint16 blkmod; /* Modulo value to wrap trigblk */ - + /* multi_audio */ volatile int64 frames_count; // for play or record volatile bigtime_t real_time; // for play or record @@ -134,22 +134,22 @@ typedef struct _auvia_dev { char name[DEVNAME]; /* used for resources */ pci_info info; device_config config; - + void *ptb_log_base; void *ptb_phy_base; area_id ptb_area; - + sem_id buffer_ready_sem; - + uint32 interrupt_mask; - + LIST_HEAD(, _auvia_stream) streams; - + LIST_HEAD(, _auvia_mem) mems; - + auvia_stream *pstream; auvia_stream *rstream; - + /* multi_audio */ multi_dev multi; } auvia_dev; @@ -160,7 +160,7 @@ extern auvia_dev cards[NUM_CARDS]; status_t auvia_stream_set_audioparms(auvia_stream *stream, uint8 channels, uint8 b16, uint32 sample_rate); status_t auvia_stream_commit_parms(auvia_stream *stream); -status_t auvia_stream_get_nth_buffer(auvia_stream *stream, uint8 chan, uint8 buf, +status_t auvia_stream_get_nth_buffer(auvia_stream *stream, uint8 chan, uint8 buf, char** buffer, size_t *stride); void auvia_stream_start(auvia_stream *stream, void (*inth) (void *), void *inthparam); void auvia_stream_halt(auvia_stream *stream); diff --git a/src/add-ons/kernel/drivers/audio/ac97/auvia/debug.c b/src/add-ons/kernel/drivers/audio/ac97/auvia/debug.c index 2ff087bed2..07bdfb1787 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auvia/debug.c +++ b/src/add-ons/kernel/drivers/audio/ac97/auvia/debug.c @@ -7,24 +7,24 @@ * Copyright (c) 2002, Marcus Overhagen * * All rights reserved. - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * - * - Redistributions of source code must retain the above copyright notice, + * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation + * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ @@ -32,8 +32,9 @@ #include -#include #include +#include +#include #include #include