---
drivers/firewire/net.c | 48 +++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 7a4d1a478e33..1fbf62ef793c 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -86,14 +86,14 @@ struct rfc2734_header {
#define fwnet_set_hdr_dgl(dgl) ((dgl) << 16)
static inline void fwnet_make_uf_hdr(struct rfc2734_header *hdr,
- unsigned ether_type)
+ unsigned int ether_type)
{
hdr->w0 = fwnet_set_hdr_lf(RFC2374_HDR_UNFRAG)
| fwnet_set_hdr_ether_type(ether_type);
}
static inline void fwnet_make_ff_hdr(struct rfc2734_header *hdr,
- unsigned ether_type, unsigned dg_size, unsigned dgl)
+ unsigned int ether_type, unsigned int dg_size, unsigned int dgl)
{
hdr->w0 = fwnet_set_hdr_lf(RFC2374_HDR_FIRSTFRAG)
| fwnet_set_hdr_dg_size(dg_size)
@@ -102,7 +102,7 @@ static inline void fwnet_make_ff_hdr(struct rfc2734_header *hdr,
}
static inline void fwnet_make_sf_hdr(struct rfc2734_header *hdr,
- unsigned lf, unsigned dg_size, unsigned fg_off, unsigned dgl)
+ unsigned int lf, unsigned int dg_size, unsigned int fg_off, unsigned int dgl)
{
hdr->w0 = fwnet_set_hdr_lf(lf)
| fwnet_set_hdr_dg_size(dg_size)
@@ -142,15 +142,15 @@ struct fwnet_device {
struct fw_iso_context *broadcast_rcv_context;
struct fw_iso_buffer broadcast_rcv_buffer;
void **broadcast_rcv_buffer_ptrs;
- unsigned broadcast_rcv_next_ptr;
- unsigned num_broadcast_rcv_ptrs;
- unsigned rcv_buffer_size;
+ unsigned int broadcast_rcv_next_ptr;
+ unsigned int num_broadcast_rcv_ptrs;
+ unsigned int rcv_buffer_size;
/*
* This value is the maximum unfragmented datagram size that can be
* sent by the hardware. It already has the GASP overhead and the
* unfragmented datagram header overhead calculated into it.
*/
- unsigned broadcast_xmt_max_payload;
+ unsigned int broadcast_xmt_max_payload;
u16 broadcast_xmt_datagramlabel;
/*
@@ -176,13 +176,13 @@ struct fwnet_peer {
/* guarded by dev->lock */
struct list_head pd_list; /* received partial datagrams */
- unsigned pdg_size; /* pd_list size */
+ unsigned int pdg_size; /* pd_list size */
u16 datagram_label; /* outgoing datagram label */
u16 max_payload; /* includes RFC2374_FRAG_HDR_SIZE overhead */
int node_id;
int generation;
- unsigned speed;
+ unsigned int speed;
};
/* This is our task struct. It's used for the packet complete callback. */
@@ -207,7 +207,7 @@ struct fwnet_packet_task {
*/
static int fwnet_header_create(struct sk_buff *skb, struct net_device *net,
unsigned short type, const void *daddr,
- const void *saddr, unsigned len)
+ const void *saddr, unsigned int len)
{
struct fwnet_header *h;
@@ -273,10 +273,10 @@ static const struct header_ops fwnet_header_ops = {
/* FIXME: is this correct for all cases? */
static bool fwnet_frag_overlap(struct fwnet_partial_datagram *pd,
- unsigned offset, unsigned len)
+ unsigned int offset, unsigned int len)
{
struct fwnet_fragment_info *fi;
- unsigned end = offset + len;
+ unsigned int end = offset + len;
list_for_each_entry(fi, &pd->fi_list, fi_link)
if (offset < fi->offset + fi->len && end > fi->offset)
@@ -287,7 +287,7 @@ static bool fwnet_frag_overlap(struct fwnet_partial_datagram *pd,
/* Assumes that new fragment does not overlap any existing fragments */
static struct fwnet_fragment_info *fwnet_frag_new(
- struct fwnet_partial_datagram *pd, unsigned offset, unsigned len)
+ struct fwnet_partial_datagram *pd, unsigned int offset, unsigned int len)
{
struct fwnet_fragment_info *fi, *fi2, *new;
struct list_head *list;
@@ -350,8 +350,8 @@ static struct fwnet_fragment_info *fwnet_frag_new(
}
static struct fwnet_partial_datagram *fwnet_pd_new(struct net_device *net,
- struct fwnet_peer *peer, u16 datagram_label, unsigned dg_size,
- void *frag_buf, unsigned frag_off, unsigned frag_len)
+ struct fwnet_peer *peer, u16 datagram_label, unsigned int dg_size,
+ void *frag_buf, unsigned int frag_off, unsigned int frag_len)
{
struct fwnet_partial_datagram *new;
struct fwnet_fragment_info *fi;
@@ -413,7 +413,7 @@ static void fwnet_pd_delete(struct fwnet_partial_datagram *old)
static bool fwnet_pd_update(struct fwnet_peer *peer,
struct fwnet_partial_datagram *pd, void *frag_buf,
- unsigned frag_off, unsigned frag_len)
+ unsigned int frag_off, unsigned int frag_len)
{
if (fwnet_frag_new(pd, frag_off, frag_len) == NULL)
return false;
@@ -466,7 +466,7 @@ static struct fwnet_peer *fwnet_peer_find_by_node_id(struct fwnet_device *dev,
}
/* See IEEE 1394-2008 table 6-4, table 8-8, table 16-18. */
-static unsigned fwnet_max_payload(unsigned max_rec, unsigned speed)
+static unsigned int fwnet_max_payload(unsigned int max_rec, unsigned int speed)
{
max_rec = min(max_rec, speed + 8);
max_rec = clamp(max_rec, 8U, 11U); /* 512...4096 */
@@ -562,7 +562,7 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
struct sk_buff *skb;
struct net_device *net = dev->netdev;
struct rfc2734_header hdr;
- unsigned lf;
+ unsigned int lf;
unsigned long flags;
struct fwnet_peer *peer;
struct fwnet_partial_datagram *pd;
@@ -1075,7 +1075,7 @@ static int fwnet_fifo_start(struct fwnet_device *dev)
static void __fwnet_broadcast_stop(struct fwnet_device *dev)
{
- unsigned u;
+ unsigned int u;
if (dev->broadcast_state != FWNET_BROADCAST_ERROR) {
for (u = 0; u < FWNET_ISO_PAGE_COUNT; u++)
@@ -1103,12 +1103,12 @@ static int fwnet_broadcast_start(struct fwnet_device *dev)
{
struct fw_iso_context *context;
int retval;
- unsigned num_packets;
- unsigned max_receive;
+ unsigned int num_packets;
+ unsigned int max_receive;
struct fw_iso_packet packet;
unsigned long offset;
void **ptrptr;
- unsigned u;
+ unsigned int u;
if (dev->broadcast_state != FWNET_BROADCAST_ERROR)
return 0;
@@ -1141,7 +1141,7 @@ static int fwnet_broadcast_start(struct fwnet_device *dev)
for (u = 0; u < FWNET_ISO_PAGE_COUNT; u++) {
void *ptr;
- unsigned v;
+ unsigned int v;
ptr = kmap(dev->broadcast_rcv_buffer.pages[u]);
for (v = 0; v < num_packets / FWNET_ISO_PAGE_COUNT; v++)
@@ -1229,7 +1229,7 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net)
struct fwnet_device *dev = netdev_priv(net);
__be16 proto;
u16 dest_node;
- unsigned max_payload;
+ unsigned int max_payload;
u16 dg_size;
u16 *datagram_label_ptr;
struct fwnet_packet_task *ptask;
--
2.34.1
Hi,
Thanks for your sending the patch.
On Tue, Oct 03, 2023 at 09:16:50PM +0000, Kai Bosch wrote:
> ---
> drivers/firewire/net.c | 48 +++++++++++++++++++++---------------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
As long as I know, the coding style of Linux kernel[1] does not forbidden
brief expression of 'unsigned int' (= just 'unsigned'). Furthermore,
in C language specification, 'unsigned' and 'unsigned int' are the
same[2]. I have no functional change over the patch.
If the intension of patch is in the point of human readability, please
note it in the commit comment. It is the most important for the kind of
change.
I'm waiting for your next post.
[1] Linux kernel coding style
https://www.kernel.org/doc/html/v4.10/process/coding-style.html
[2] See '6.7.2 Type specifiers' in ISO/IEC 9899:1999, so called 'C99'.
Regards
Takashi Sakamoto
Hello Takashi,
Yes, this was indeed meant to improve human readability and in my
future submissions i will note this in the commit comment.
It was my first submission and i thought a good point to start was to
go through the warnings that heck_patch.pl will produce on any given c
file and improve on that.
Sorry if i went about this the wrong way.
Kind regards
Kai Bosch