Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Clemens Ladisch <clemens@ladisch.de>, Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Stefan Richter <stefanr@s5r6.in-berlin.de>,
	kbuild test robot <lkp@intel.com>,
	ffado-devel@lists.sf.net, kbuild-all@01.org
Subject: Re: [PATCH 1/7] ALSA: firewire-tascam: add skeleton for TASCAM FireWire series
Date: Sat, 3 Oct 2015 18:57:34 +0900	[thread overview]
Message-ID: <560FA68E.8050501@sakamocchi.jp> (raw)
In-Reply-To: <560F9C6E.70800@ladisch.de>

On 2015年10月03日 18:14, Clemens Ladisch wrote:
> Takashi Sakamoto wrote:
>>>>> 23		data = be32_to_cpu(fw_dev->config_rom[28]);
>>
>> About using 'be32_to_cpu()', the 'config_rom' member actually has 'const
>> u32 *', while in the member caracters in the textual leaf are aligned in
>> big-endian.
> 
> Strictly speaking, strings do not have an endianness.
> 
> Most data in the actual configuration ROM is organized as big-endian 32-
> bit values, so the FireWire core converts _all_ words from big endian to
> CPU endian.  The words that are not actually 32-bit values but strings
> have to be converted back; the correct function for this is cpu_to_be32().

Yes. And I forgot a pair of cpu_to_be32/be32_to_cpu is symmetric each other!
(I'm really a stupid guy, sigh...)

This patch solves the sparce warnings.

$ git diff
diff --git a/sound/firewire/tascam/tascam.c b/sound/firewire/tascam/tascam.c
index ee2f498..6e1087e 100644
--- a/sound/firewire/tascam/tascam.c
+++ b/sound/firewire/tascam/tascam.c
@@ -50,19 +50,19 @@ static int check_name(struct snd_tscm *tscm)
        struct fw_device *fw_dev = fw_parent_device(tscm->unit);
        char vendor[8];
        char model[8];
-       __u32 data;
+       __be32 data;

        /* Retrieve model name. */
-       data = be32_to_cpu(fw_dev->config_rom[28]);
+       data = cpu_to_be32(fw_dev->config_rom[28]);
        memcpy(model, &data, 4);
-       data = be32_to_cpu(fw_dev->config_rom[29]);
+       data = cpu_to_be32(fw_dev->config_rom[29]);
        memcpy(model + 4, &data, 4);
        model[7] = '\0';

        /* Retrieve vendor name. */
-       data = be32_to_cpu(fw_dev->config_rom[23]);
+       data = cpu_to_be32(fw_dev->config_rom[23]);
        memcpy(vendor, &data, 4);
-       data = be32_to_cpu(fw_dev->config_rom[24]);
+       data = cpu_to_be32(fw_dev->config_rom[24]);
        memcpy(vendor + 4, &data, 4);
        vendor[7] = '\0';


> Iwai-san,

Should I re-post this patchset? Or you kindly merge them with your
modification?


Regards

Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2015-10-03  9:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 13:02 [PATCH 0/7 v3] firewire-tascam: new driver for TASCAM FireWire series Takashi Sakamoto
2015-10-01 13:02 ` [PATCH 1/7] ALSA: firewire-tascam: add skeleton " Takashi Sakamoto
2015-10-01 13:54   ` kbuild test robot
2015-10-02 16:24     ` Takashi Iwai
2015-10-02 18:47       ` Clemens Ladisch
2015-10-03  2:34         ` Takashi Sakamoto
2015-10-03  8:51           ` Takashi Iwai
2015-10-03 10:33             ` Stefan Richter
2015-10-03  9:14           ` Clemens Ladisch
2015-10-03  9:57             ` Takashi Sakamoto [this message]
2015-10-03 10:54               ` Stefan Richter
2015-10-04 11:54                 ` Takashi Sakamoto
2015-10-03 16:07               ` Takashi Iwai
2015-10-03 23:33                 ` Takashi Sakamoto
2015-10-01 13:02 ` [PATCH 2/7] ALSA: firewire-tascam: add a structure for model-dependent parameters Takashi Sakamoto
2015-10-01 13:02 ` [PATCH 3/7] ALSA: firewire-tascam: add proc node to show firmware information Takashi Sakamoto
2015-10-01 13:02 ` [PATCH 4/7] ALSA: firewire-tascam: add data block processing layer Takashi Sakamoto
2015-10-01 13:02 ` [PATCH 5/7] ALSA: firewire-tascam: add streaming functionality Takashi Sakamoto
2015-10-01 13:02 ` [PATCH 6/7] ALSA: firewire-tascam: add PCM functionality Takashi Sakamoto
2015-10-01 13:02 ` [PATCH 7/7] ALSA: firewire-tascam: add hwdep interface Takashi Sakamoto

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=560FA68E.8050501@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sf.net \
    --cc=kbuild-all@01.org \
    --cc=lkp@intel.com \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox