From: Alexander Wigen <alex@wigen.net>
To: Joe Perches <joe@perches.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] via-velocity: Codestyle fixes
Date: Thu, 28 Oct 2010 15:02:47 +1000 [thread overview]
Message-ID: <201010281502.47977.alex@wigen.net> (raw)
In-Reply-To: <1288239318.1836.7.camel@Joe-Laptop>
Hi Joe,
Thanks for that very quick review, this is my first kernel patch.
On Thu, 28 Oct 2010, you wrote:
> On Thu, 2010-10-28 at 13:48 +1000, alex@wigen.net wrote:
> > From: Alexander Wigen <alex@wigen.net>
> > @@ -1542,7 +1542,7 @@ static int velocity_alloc_rx_buf(struct
> > velocity_info *vptr, int idx)
> >
> > * Fill in the descriptor to match
> > */
> >
> > - *((u32 *) & (rd->rdesc0)) = 0;
> > + *((u32 *) &(rd->rdesc0)) = 0;
>
> I think this style change isn't really that good.
> rdesc0 is:
>
> struct rdesc0 {
> __le16 RSR; /* Receive status */
> __le16 len; /* bits 0--13; bit 15 - owner */
> };
>
> I think it more sensible to either set the fields
> in the struct to 0 or to memset the struct to 0.
Not sure what is best so I reverted the change.
> > @@ -1681,7 +1681,7 @@ static int velocity_init_td_ring(struct
> > velocity_info *vptr)
> >
> > static void velocity_free_dma_rings(struct velocity_info *vptr)
> > {
> >
> > const int size = vptr->options.numrx * sizeof(struct rx_desc) +
> >
> > - vptr->options.numtx * sizeof(struct tx_desc) * vptr->tx.numq;
> > + vptr->options.numtx * sizeof(struct tx_desc) *vptr->tx.numq;
>
> If checkpatch warns about this, it's wrong.
It does produce a error acctually, but I have reverted the change:
drivers/net/via-velocity.c:1684: ERROR: space prohibited after that '*'
(ctx:WxW)
>
> > @@ -2477,24 +2477,24 @@ static struct net_device_stats
> > *velocity_get_stats(struct net_device *dev)
> >
> > dev->stats.rx_errors = vptr->mib_counter[HW_MIB_ifRxErrorPkts];
> > dev->stats.rx_length_errors =
> > vptr->mib_counter[HW_MIB_ifInRangeLengthErrors];
> >
> > -// unsigned long rx_dropped; /* no space in linux buffers */
> > +/* unsigned long rx_dropped; /* no space in linux buffers */
>
> why not just remove all these commented-out lines?
Done.
> > @@ -2957,7 +2957,7 @@ static int velocity_set_wol(struct velocity_info
> > *vptr)
> >
> > memcpy(arp->ar_tip, vptr->ip_addr, 4);
> >
> > crc = wol_calc_crc((sizeof(struct arp_packet) + 7) / 8, buf,
> >
> > - (u8 *) & mask_pattern[0][0]);
> > + (u8 *) &mask_pattern[0][0]);
>
> perhaps just (u8 *)mask_pattern?
>
> > @@ -3454,7 +3453,7 @@ static const struct ethtool_ops
> > velocity_ethtool_ops = {
> >
> > .set_wol = velocity_ethtool_set_wol,
> > .get_msglevel = velocity_get_msglevel,
> > .set_msglevel = velocity_set_msglevel,
> >
> > - .set_sg = ethtool_op_set_sg,
> > + .set_sg = ethtool_op_set_sg,
>
> bad alignment?
Sorry, wrong editor tab width.
Cheers,
Alexander Wigen
next prev parent reply other threads:[~2010-10-28 5:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 3:48 [PATCH] via-velocity: Codestyle fixes alex
2010-10-28 4:15 ` Joe Perches
2010-10-28 5:02 ` Alexander Wigen [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-10-28 5:00 alex
2010-10-28 14:34 ` Bob Beers
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=201010281502.47977.alex@wigen.net \
--to=alex@wigen.net \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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 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).