lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 25 Apr 2014 08:58:06 -0700
From:	David Daney <ddaney@...iumnetworks.com>
To:	Greg KH <gregkh@...uxfoundation.org>,
	Nicolas Del Piano <ndel314@...il.com>
CC:	<devel@...verdev.osuosl.org>, <david.daney@...ium.com>,
	<raluca.oncioiu91@...il.com>, <linux-kernel@...r.kernel.org>,
	<aaro.koskinen@....fi>
Subject: Re: [PATCH] Staging: octeon-usb: fixed a macro coding style issue

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@...il.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
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ