Re: [PATCH] staging: Fix spacing between function name and parentheses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Even if you use checkpath you _should_ understand what you are changing. The output of checkpatch merely there to help.

In this case you can see that this is a macro just a few lines up in the code.

On 11 Oct 2014 11:46, "Sudip Mukherjee" <sudipm.mukherjee@xxxxxxxxx> wrote:
I agree. But in my opinion checkpatch is here to help us fix style
problems , but we should not blindly act on checkpatch warnings.

thanks
sudip

On Sat, Oct 11, 2014 at 1:57 PM, Peter Senna Tschudin
<peter.senna@xxxxxxxxx> wrote:
> I think that, in this case, checkpatch.pl contributed:
>
> $ ./scripts/checkpatch.pl -f drivers/staging/octeon-usb/octeon-hcd.c
> WARNING: space prohibited between function name and open parenthesis '('
> #415: FILE: drivers/staging/octeon-usb/octeon-hcd.c:415:
> +                       if (c.s.field op (value)) {                         \
>
>
> On Sat, Oct 11, 2014 at 8:11 AM, Dave Tian <dave.jing.tian@xxxxxxxxx> wrote:
>> Agreed - that is why I mentioned the patch is neither right nor useful:)
>>
>> -daveti
>>
>>
>> On Oct 11, 2014, at 2:08 PM, Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx> wrote:
>>
>>> Hi Dave,
>>> It will work. But my point of saying that was  c.s.field ==(value) is
>>> again not according to the style.
>>>
>>> thanks
>>> sudip
>>>
>>> On Sat, Oct 11, 2014 at 10:53 AM, Dave Tian <dave.jing.tian@xxxxxxxxx> wrote:
>>>> It also works as value is surrounded by (), though I do not think the patch itself is right or useful.
>>>>
>>>> Dave Tian
>>>> dave.jing.tian@xxxxxxxxx
>>>>
>>>>
>>>>
>>>> On Oct 11, 2014, at 12:58 PM, Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx> wrote:
>>>>
>>>>> On Fri, Oct 10, 2014 at 09:55:48PM -0400, Nicholas Krause wrote:
>>>>>> Fixes checkpatch coding style warning about unneeded space
>>>>>> between function name an parentheses.
>>>>>>
>>>>>> Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
>>>>>> ---
>>>>>> Untested
>>>>>> 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 5f9db4c..bbeb0cc 100644
>>>>>> --- a/drivers/staging/octeon-usb/octeon-hcd.c
>>>>>> +++ b/drivers/staging/octeon-usb/octeon-hcd.c
>>>>>> @@ -412,7 +412,7 @@ struct octeon_hcd {
>>>>>>             type c;                                                     \
>>>>>>             while (1) {                                                 \
>>>>>>                     c.u32 = __cvmx_usb_read_csr32(usb, address);        \
>>>>>> -                    if (c.s.field op (value)) {                         \
>>>>>> +                    if (c.s.field op(value)) {                          \
>>>>>
>>>>> have you read the code before modifying it?
>>>>> this is not a function.
>>>>> have you seen how CVMX_WAIT_FOR_FIELD32 is being called?
>>>>> on every call of CVMX_WAIT_FOR_FIELD32 op is the operator "=="
>>>>> so when called the macro will be c.s.field == (value).
>>>>> if your patch is applied then it will become c.s.field ==(value) .. will that be correct ?
>>>>>
>>>>> thanks
>>>>> sudip
>>>>>
>>>>>>                             result = 0;                                 \
>>>>>>                             break;                                      \
>>>>>>                     } else if (cvmx_get_cycle() > done) {               \
>>>>>> --
>>>>>> 1.9.1
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Kernelnewbies mailing list
>>>>>> Kernelnewbies@xxxxxxxxxxxxxxxxx
>>>>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>>>
>>>>> _______________________________________________
>>>>> Kernelnewbies mailing list
>>>>> Kernelnewbies@xxxxxxxxxxxxxxxxx
>>>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>>
>>
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies@xxxxxxxxxxxxxxxxx
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>
> --
> Peter

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux