From: Clemens Ladisch <clemens@ladisch.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: alsa-devel@alsa-project.org
Subject: endianness problems in fireworks/bebob_maudio
Date: Sun, 07 Dec 2014 22:24:02 +0100 [thread overview]
Message-ID: <5484C572.7040606@ladisch.de> (raw)
Hi,
sparse complains:
sound/firewire/fireworks/fireworks_transaction.c:127:18: warning: restricted __be32 degrades to integer
t = (struct snd_efw_transaction *)data;
length = min_t(size_t, t->length * sizeof(t->length), length);
't->length' is still a big-endian value. This means that the driver
ends up always using 'length'.
sound/firewire/bebob/bebob_maudio.c:100:17: warning: incorrect type in initializer (different base types)
sound/firewire/bebob/bebob_maudio.c:100:17: expected restricted __be32
sound/firewire/bebob/bebob_maudio.c:100:17: got int
__be32 cues[3] = {
MAUDIO_BOOTLOADER_CUE1,
MAUDIO_BOOTLOADER_CUE2,
MAUDIO_BOOTLOADER_CUE3
};
rcode = fw_run_transaction(device->card, TCODE_WRITE_BLOCK_REQUEST,
device->node_id, device->generation,
device->max_speed, BEBOB_ADDR_REG_REQ,
cues, sizeof(cues));
The three MAUDIO_BOOTLOADER_CUEx values will end up as a different byte
sequence on big-endian machines. The simplest way to have these twelve
bytes unchanged on the bus is to have a twelve-byte array in the driver.
Regards,
Clemens
next reply other threads:[~2014-12-07 21:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-07 21:24 Clemens Ladisch [this message]
2014-12-07 23:45 ` endianness problems in fireworks/bebob_maudio Takashi Sakamoto
2014-12-08 8:09 ` Clemens Ladisch
2014-12-08 9:08 ` Takashi Sakamoto
2015-01-07 15:31 ` [PATCH] ALSA: fireworks: fix an endianness bug for transaction length Takashi Sakamoto
2015-01-07 15:40 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5484C572.7040606@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=o-takashi@sakamocchi.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.