LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: Harvey Harrison <harvey.harrison@gmail.com>,
Sam Ravnborg <sam@ravnborg.org>,
linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
linuxppc-dev@ozlabs.org, Kristian Hoegsberg <krh@bitplanet.net>,
Jarod Wilson <jwilson@redhat.com>
Subject: [PATCH 2/2] firewire: endianess annotations
Date: Sat, 23 Feb 2008 12:24:57 +0100 (CET) [thread overview]
Message-ID: <tkrat.99ed7585f5c25d58@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.e2bfb30f2c0ae70a@s5r6.in-berlin.de>
Kills warnings from 'make C=1 CHECKFLAGS="-D__CHECK_ENDIAN__" modules':
drivers/firewire/fw-transaction.c:771:10: warning: incorrect type in assignment (different base types)
drivers/firewire/fw-transaction.c:771:10: expected unsigned int [unsigned] [usertype] <noident>
drivers/firewire/fw-transaction.c:771:10: got restricted unsigned int [usertype] <noident>
drivers/firewire/fw-transaction.h:93:10: warning: incorrect type in assignment (different base types)
drivers/firewire/fw-transaction.h:93:10: expected unsigned int [unsigned] [usertype] <noident>
drivers/firewire/fw-transaction.h:93:10: got restricted unsigned int [usertype] <noident>
drivers/firewire/fw-ohci.c:1490:8: warning: restricted degrades to integer
drivers/firewire/fw-ohci.c:1490:35: warning: restricted degrades to integer
drivers/firewire/fw-ohci.c:1516:5: warning: cast to restricted type
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: sparclinux@vger.kernel.org
Cc: linuxppc-dev@ozlabs.org
---
drivers/firewire/fw-ohci.c | 4 ++--
drivers/firewire/fw-transaction.c | 2 +-
drivers/firewire/fw-transaction.h | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
Index: linux/drivers/firewire/fw-ohci.c
===================================================================
--- linux.orig/drivers/firewire/fw-ohci.c
+++ linux/drivers/firewire/fw-ohci.c
@@ -1487,7 +1487,7 @@ static int handle_ir_dualbuffer_packet(s
void *p, *end;
int i;
- if (db->first_res_count > 0 && db->second_res_count > 0) {
+ if (db->first_res_count != 0 && db->second_res_count != 0) {
if (ctx->excess_bytes <= le16_to_cpu(db->second_req_count)) {
/* This descriptor isn't done yet, stop iteration. */
return 0;
@@ -1513,7 +1513,7 @@ static int handle_ir_dualbuffer_packet(s
memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
i += ctx->base.header_size;
ctx->excess_bytes +=
- (le32_to_cpu(*(u32 *)(p + 4)) >> 16) & 0xffff;
+ (le32_to_cpu(*(__le32 *)(p + 4)) >> 16) & 0xffff;
p += ctx->base.header_size + 4;
}
ctx->header_length = i;
Index: linux/drivers/firewire/fw-transaction.c
===================================================================
--- linux.orig/drivers/firewire/fw-transaction.c
+++ linux/drivers/firewire/fw-transaction.c
@@ -751,7 +751,7 @@ handle_topology_map(struct fw_card *card
void *payload, size_t length, void *callback_data)
{
int i, start, end;
- u32 *map;
+ __be32 *map;
if (!TCODE_IS_READ_REQUEST(tcode)) {
fw_send_response(card, request, RCODE_TYPE_ERROR);
Index: linux/drivers/firewire/fw-transaction.h
===================================================================
--- linux.orig/drivers/firewire/fw-transaction.h
+++ linux/drivers/firewire/fw-transaction.h
@@ -85,12 +85,12 @@
static inline void
fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
{
- u32 *dst = _dst;
- u32 *src = _src;
+ u32 *dst = _dst;
+ __be32 *src = _src;
int i;
for (i = 0; i < size / 4; i++)
- dst[i] = cpu_to_be32(src[i]);
+ dst[i] = be32_to_cpu(src[i]);
}
static inline void
--
Stefan Richter
-=====-==--- --=- =-===
http://arcgraph.de/sr/
next prev parent reply other threads:[~2008-02-23 11:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-20 22:03 sparse - make __CHECK_ENDIAN__ default enabled? Sam Ravnborg
2008-02-20 22:18 ` Harvey Harrison
2008-02-23 11:23 ` [PATCH 0/2] firewire: endinaness warnings (was Re: sparse - make __CHECK_ENDIAN__ default enabled?) Stefan Richter
2008-02-23 11:24 ` [PATCH 1/2] firewire: endianess fix Stefan Richter
2008-02-23 11:36 ` Stefan Richter
2008-02-23 12:12 ` Stefan Richter
2008-03-01 12:36 ` Stefan Richter
2008-02-27 19:58 ` Jarod Wilson
2008-02-27 20:08 ` Stefan Richter
2008-02-27 20:21 ` Jarod Wilson
2008-02-28 2:40 ` Benjamin Herrenschmidt
2008-02-28 3:21 ` Jarod Wilson
2008-02-28 6:25 ` Benjamin Herrenschmidt
2008-02-28 18:42 ` Jarod Wilson
2008-02-28 23:26 ` Benjamin Herrenschmidt
2008-02-29 5:48 ` Jarod Wilson
2008-02-29 6:00 ` Benjamin Herrenschmidt
2008-02-29 11:26 ` Paul Mackerras
2008-02-29 11:52 ` Stefan Richter
2008-02-29 21:49 ` Benjamin Herrenschmidt
2008-02-29 15:34 ` Jarod Wilson
2008-03-03 9:19 ` Gabriel Paubert
2008-03-03 14:35 ` Stefan Richter
2008-03-05 22:59 ` Gabriel Paubert
2008-03-05 23:26 ` Stefan Richter
2008-03-06 20:23 ` Gabriel Paubert
2008-02-28 3:33 ` Jarod Wilson
2008-02-28 2:41 ` Benjamin Herrenschmidt
2008-02-28 8:41 ` Stefan Richter
2008-02-23 11:24 ` Stefan Richter [this message]
2008-03-01 5:23 ` [PATCH 0/2] firewire: endinaness warnings (was Re: sparse - make __CHECK_ENDIAN__ default enabled?) Jarod Wilson
2008-02-20 22:39 ` sparse - make __CHECK_ENDIAN__ default enabled? Harvey Harrison
2008-02-20 22:51 ` Sam Ravnborg
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=tkrat.99ed7585f5c25d58@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=harvey.harrison@gmail.com \
--cc=jwilson@redhat.com \
--cc=krh@bitplanet.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=linuxppc-dev@ozlabs.org \
--cc=sam@ravnborg.org \
--cc=sparclinux@vger.kernel.org \
--subject='Re: [PATCH 2/2] firewire: endianess annotations' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).