From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: i1480: endian question
Date: Mon, 22 Feb 2010 04:56:34 +0000 [thread overview]
Message-ID: <20100222045634.GB4853@bicker> (raw)
I'm trying to use smatch to find endian issues.
drivers/uwb/i1480/dfu/usb.c
120 result = usb_control_msg(
121 i1480_usb->usb_dev, usb_sndctrlpipe(i1480_usb->usb_dev, 0),
122 0xf0, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
123 cpu_to_le16(memory_address & 0xffff),
124 cpu_to_le16((memory_address >> 16) & 0xffff),
125 i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */);
Is it right to use cpu_to_le16() here? I think it should be cpu endian
here because we call cpu_to_le16() inside the usb_control_msg() function.
Also in the i1480_usb_read() function:
drivers/uwb/i1480/dfu/usb.c
166 result = usb_control_msg(
167 i1480_usb->usb_dev, usb_rcvctrlpipe(i1480_usb->usb_dev, 0),
168 0xf0, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
169 cpu_to_le16(itr_addr & 0xffff),
170 cpu_to_le16((itr_addr >> 16) & 0xffff),
171 i1480->cmd_buf + itr, itr_size,
172 100 /* FIXME: arbitrary */);
regards,
dan carpenter
next reply other threads:[~2010-02-22 4:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-22 4:56 Dan Carpenter [this message]
2010-02-22 19:33 ` i1480: endian question Inaky Perez-Gonzalez
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=20100222045634.GB4853@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/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.