All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Greg KH <gregkh@linuxfoundation.org>,
	Nicolas Del Piano <ndel314@gmail.com>
Cc: <devel@driverdev.osuosl.org>, <david.daney@cavium.com>,
	<raluca.oncioiu91@gmail.com>, <linux-kernel@vger.kernel.org>,
	<aaro.koskinen@iki.fi>
Subject: Re: [PATCH] Staging: octeon-usb: fixed a macro coding style issue
Date: Fri, 25 Apr 2014 08:58:06 -0700	[thread overview]
Message-ID: <535A860E.4000007@caviumnetworks.com> (raw)
In-Reply-To: <20140425142133.GA14201@kroah.com>

On 04/25/2014 07:21 AM, Greg KH wrote:
> On Fri, Apr 25, 2014 at 10:48:22AM -0300, Nicolas Del Piano wrote:
>> Fixed a coding style error, macros with complex values should be enclosed in parentheses.
>>
>> Signed-off-by: Nicolas Del Piano <ndel314@gmail.com>
>> ---
>>   drivers/staging/octeon-usb/octeon-hcd.c |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
>> index 8b8ce72..ef3a8ce 100644
>> --- a/drivers/staging/octeon-usb/octeon-hcd.c
>> +++ b/drivers/staging/octeon-usb/octeon-hcd.c
>> @@ -246,7 +246,7 @@ enum cvmx_usb_pipe_flags {
>>   };
>>
>>   /* Normal prefetch that use the pref instruction. */
>> -#define CVMX_PREFETCH(address, offset) asm volatile ("pref %[type], %[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" (0))
>> +#define CVMX_PREFETCH(address, offset) (asm volatile ("pref %[type], %[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" (0)))
>>
>>   /* Maximum number of times to retry failed transactions */
>>   #define MAX_RETRIES		3
>
> Will that actually compile?

No it does not.  Really when changing things like this, you should first 
understand what it is doing.  In the case of this patch, I don't think 
that understanding was present.

It appears that in the case of this patch, Documentation/SubmitChecklist 
was not consulted.  In particular item #2(all sections) was omitted.

Q: Why did I have to waste 15 minutes of my day on this?  Is the patch 
subimtter's time so valuable that standard patch submittal procedures 
cannot be followed?

>
> Why the heck are we using asm in a define in the first place?  Shouldn't
> this be an inline function or something?

You are correct.  It turns out that <linux/prefetch.h> already has such 
a definition.

>
> thanks,
>
> greg k-h
>


  reply	other threads:[~2014-04-25 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25 13:48 [PATCH] Staging: octeon-usb: fixed a macro coding style issue Nicolas Del Piano
2014-04-25 14:21 ` Greg KH
2014-04-25 15:58   ` David Daney [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-04-25 13:40 Nicolas Del Piano
2014-04-25 13:42 ` Levente Kurusa

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=535A860E.4000007@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=david.daney@cavium.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndel314@gmail.com \
    --cc=raluca.oncioiu91@gmail.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 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.