Skip to content

Commit

Permalink
es1370: Fix print formats by using format macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmlr committed Aug 17, 2020
1 parent 4f11ee9 commit 2e4840b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 23 deletions.
13 changes: 8 additions & 5 deletions src/add-ons/kernel/drivers/audio/ac97/es1370/es1370.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ es1370_stream_commit_parms(es1370_stream *stream)
es1370_reg_write_32(&card->config, ES1370_REG_DAC2_FRAMEADR & 0xff, (uint32)stream->buffer->phy_base);
es1370_reg_write_32(&card->config, ES1370_REG_DAC2_FRAMECNT & 0xff, ((stream->blksize * stream->bufcount) >> 2) - 1);
es1370_reg_write_32(&card->config, ES1370_REG_DAC2_SCOUNT & 0xff, stream->bufframes - 1);
LOG(("es1370_stream_commit_parms %ld %ld\n", ((stream->blksize * stream->bufcount) >> 2) - 1, (stream->blksize / frame_size) - 1));
LOG(("es1370_stream_commit_parms %" B_PRId32 " %" B_PRId32 "\n",
((stream->blksize * stream->bufcount) >> 2) - 1,
(stream->blksize / frame_size) - 1));
}

return B_OK;
Expand Down Expand Up @@ -447,8 +449,9 @@ es1370_setup(es1370_dev * card)
card->config.irq = card->info.u.h0.interrupt_line;
card->config.type = 0;

PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %lx\n", card->name, card->info.device_id,
card->info.revision, card->info.u.h0.subsystem_id, card->config.base));
PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %" B_PRIx32
"\n", card->name, card->info.device_id, card->info.revision,
card->info.u.h0.subsystem_id, card->config.base));

cmd = (*pci->read_pci_config)(card->info.bus, card->info.device, card->info.function, PCI_command, 2);
PRINT(("PCI command before: %x\n", cmd));
Expand Down Expand Up @@ -482,7 +485,7 @@ es1370_setup(es1370_dev * card)

snooze(50000); // 50 ms

PRINT(("installing interrupt : %lx\n", card->config.irq));
PRINT(("installing interrupt : %" B_PRIu32 "\n", card->config.irq));
err = install_io_interrupt_handler(card->config.irq, es1370_int, card, 0);
if (err != B_OK) {
PRINT(("failed to install interrupt\n"));
Expand Down Expand Up @@ -556,7 +559,7 @@ init_driver(void)
}
#endif
if (es1370_setup(&cards[num_cards])) {
PRINT(("Setup of es1370 %ld failed\n", num_cards+1));
PRINT(("Setup of es1370 %" B_PRId32 " failed\n", num_cards+1));
#ifdef __HAIKU__
(*pci->unreserve_device)(info.bus, info.device, info.function,
DRIVER_NAME, &cards[num_cards]);
Expand Down
34 changes: 22 additions & 12 deletions src/add-ons/kernel/drivers/audio/ac97/es1370/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static status_t
es1370_create_controls_list(multi_dev *multi)
{
multi->control_count = 0;
PRINT(("multi->control_count %lu\n", multi->control_count));
PRINT(("multi->control_count %" B_PRIu32 "\n", multi->control_count));
return B_OK;
}

Expand All @@ -189,7 +189,8 @@ es1370_get_mix(es1370_dev *card, multi_mix_value_info * mmvi)
for (i = 0; i < mmvi->item_count; i++) {
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("es1370_get_mix : invalid control id requested : %li\n", id));
PRINT(("es1370_get_mix : invalid control id requested : %" B_PRId32
"\n", id));
continue;
}
control = &card->multi.controls[id];
Expand Down Expand Up @@ -228,7 +229,8 @@ es1370_set_mix(es1370_dev *card, multi_mix_value_info * mmvi)
for (i = 0; i < mmvi->item_count; i++) {
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("es1370_set_mix : invalid control id requested : %li\n", id));
PRINT(("es1370_set_mix : invalid control id requested : %" B_PRId32
"\n", id));
continue;
}
control = &card->multi.controls[id];
Expand All @@ -238,7 +240,8 @@ es1370_set_mix(es1370_dev *card, multi_mix_value_info * mmvi)
if (i+1<mmvi->item_count) {
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
PRINT(("es1370_set_mix : invalid control id requested : %li\n", id));
PRINT(("es1370_set_mix : invalid control id requested : %"
B_PRId32 "\n", id));
} else {
control2 = &card->multi.controls[id];
if (control2->mix_control.master != control->mix_control.id)
Expand Down Expand Up @@ -453,7 +456,8 @@ es1370_get_description(es1370_dev *card, multi_description *data)
// channel, second, third, ..., followed by output bus
// channels and input bus channels and finally auxillary channels,

LOG(("request_channel_count = %d\n",data->request_channel_count));
LOG(("request_channel_count = %" B_PRId32 "\n",
data->request_channel_count));
if (data->request_channel_count >= size) {
LOG(("copying data\n"));
memcpy(data->channels, card->multi.chans, size * sizeof(card->multi.chans[0]));
Expand Down Expand Up @@ -534,13 +538,19 @@ es1370_get_buffers(es1370_dev *card, multi_buffer_list *data)
{
uint8 i, j, pchannels, rchannels, bufcount;

LOG(("flags = %#x\n",data->flags));
LOG(("request_playback_buffers = %#x\n",data->request_playback_buffers));
LOG(("request_playback_channels = %#x\n",data->request_playback_channels));
LOG(("request_playback_buffer_size = %#x\n",data->request_playback_buffer_size));
LOG(("request_record_buffers = %#x\n",data->request_record_buffers));
LOG(("request_record_channels = %#x\n",data->request_record_channels));
LOG(("request_record_buffer_size = %#x\n",data->request_record_buffer_size));
LOG(("flags = %#" B_PRIx32 "\n",data->flags));
LOG(("request_playback_buffers = %" B_PRId32 "\n",
data->request_playback_buffers));
LOG(("request_playback_channels = %" B_PRId32 "\n",
data->request_playback_channels));
LOG(("request_playback_buffer_size = %#" B_PRIx32 "\n",
data->request_playback_buffer_size));
LOG(("request_record_buffers = %" B_PRId32 "\n",
data->request_record_buffers));
LOG(("request_record_channels = %" B_PRId32 "\n",
data->request_record_channels));
LOG(("request_record_buffer_size = %#" B_PRIx32 "\n",
data->request_record_buffer_size));

pchannels = card->pstream->channels;
rchannels = card->rstream->channels;
Expand Down
15 changes: 9 additions & 6 deletions src/add-ons/kernel/drivers/audio/ac97/es1370/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name)
area_id areaid;
status_t rv;

LOG(("allocating %d bytes for %s\n",size,name));
LOG(("allocating %" B_PRIuSIZE " bytes for %s\n", size, name));

size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
Expand All @@ -94,8 +94,8 @@ alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name)
*log = logadr;
if (phy)
*phy = pe.address;
LOG(("area = %d, size = %d, log = %#08X, phy = %#08X\n", areaid, size,
logadr, pe.address));
LOG(("area = %" B_PRId32 ", size = %" B_PRIuSIZE ", log = %p, phy = %#08"
B_PRIxPHYSADDR "\n", areaid, size, logadr, pe.address));
return areaid;
}

Expand All @@ -113,7 +113,8 @@ map_mem(void **log, phys_addr_t phy, size_t size, const char *name)
void *mapadr;
area_id area;

LOG(("mapping physical address %p with %#x bytes for %s\n",phy,size,name));
LOG(("mapping physical address %" B_PRIxPHYSADDR " with %" B_PRIxSIZE
" bytes for %s\n", phy, size, name));

offset = (uint32)phy & (B_PAGE_SIZE - 1);
phyadr = phy - offset;
Expand All @@ -122,8 +123,10 @@ map_mem(void **log, phys_addr_t phy, size_t size, const char *name)
B_READ_AREA | B_WRITE_AREA, &mapadr);
*log = (uint8 *)mapadr + offset;

LOG(("physical = %p, logical = %p, offset = %#x, phyadr = %p, mapadr = %p, size = %#x, area = %#x\n",
phy, *log, offset, phyadr, mapadr, size, area));
LOG(("physical = %" B_PRIxPHYSADDR ", logical = %p, offset = %" B_PRIu32
", phyadr = %" B_PRIxPHYSADDR ", mapadr = %p, size = %" B_PRIxSIZE
", area = %" B_PRId32 "\n", phy, *log, offset, phyadr, mapadr, size,
area));

return area;
}

0 comments on commit 2e4840b

Please sign in to comment.