public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Luis de Bethencourt <luis@debethencourt.com>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	paul.gortmaker@windriver.com, eunb.song@samsung.com,
	aaro.koskinen@iki.fi, devel@driverdev.osuosl.org
Subject: Re: [PATCH v2] staging: octeon: Fix checkpatch warnings
Date: Thu, 27 Nov 2014 08:34:00 -0800	[thread overview]
Message-ID: <1417106040.1135.1.camel@perches.com> (raw)
In-Reply-To: <20141127161432.GA32577@ks395439.kimsufi.com>

On Thu, 2014-11-27 at 17:18 +0100, Luis de Bethencourt wrote:
> Fixing 80 character limit warnings in octeon/ethernet-rx.c

Hello again Luis.

Another thing you might consider is to  align
multiple line statements to the appropriate
open parenthesis.

> diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
[]
> @@ -126,13 +127,15 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
>  
>  			if (*ptr == 0xd5) {
>  				/*
> -				  printk_ratelimited("Port %d received 0xd5 preamble\n", work->ipprt);
> +				  printk_ratelimited("Port %d received 0xd5 preamble\n",
> +					  work->ipprt);
>  				 */

This is in a commented out block, but this
would look better like:

		printk_ratelimited("format",
				   args...);


> @@ -212,17 +215,20 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
>  		did_work_request = 0;
>  		if (work == NULL) {
>  			union cvmx_pow_wq_int wq_int;
> +
>  			wq_int.u64 = 0;
>  			wq_int.s.iq_dis = 1 << pow_receive_group;
>  			wq_int.s.wq_int = 1 << pow_receive_group;
>  			cvmx_write_csr(CVMX_POW_WQ_INT, wq_int.u64);
>  			break;
>  		}
> -		pskb = (struct sk_buff **)(cvm_oct_get_buffer_ptr(work->packet_ptr) - sizeof(void *));
> +		pskb = (struct sk_buff **)(cvm_oct_get_buffer_ptr(work->packet_ptr) -
> +			sizeof(void *));

cvm_oct_get_buffer_ptr returns a void pointer
so it doesn't need a cast.

a possible fix is just to remove the cast

		pskb = cvm_oct_get_buffer_ptr(work->packet_ptr) - sizeof(void *);

>  		prefetch(pskb);

If the cast type above to a ** is to be believed,
maybe this should be prefetch(*pskb)

If you do these, they should be separate patches.


  reply	other threads:[~2014-11-27 16:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 16:18 [PATCH v2] staging: octeon: Fix checkpatch warnings Luis de Bethencourt
2014-11-27 16:34 ` Joe Perches [this message]
2014-11-27 17:27   ` Luis de Bethencourt
2014-11-28 10:29 ` Dan Carpenter
2014-11-28 13:30   ` Luis de Bethencourt
2014-11-28 14:14     ` Dan Carpenter
2014-11-28 14:26       ` Luis de Bethencourt

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=1417106040.1135.1.camel@perches.com \
    --to=joe@perches.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=devel@driverdev.osuosl.org \
    --cc=eunb.song@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis@debethencourt.com \
    --cc=paul.gortmaker@windriver.com \
    /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