mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nishka Dasgupta <nishkadg.linux@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, straube.linux@gmail.com,
	larry.finger@lwfinger.net, florian.c.schilhabel@googlemail.com,
	colin.king@canonical.com, valdis.kletnieks@vt.edu,
	tiny.windzz@gmail.com
Subject: Re: [PATCH 1/2] staging: rtl8712: r8712_setdatarate_cmd(): Change
Date: Mon, 10 Jun 2019 10:02:27 +0530	[thread overview]
Message-ID: <98b587c9-df5b-0905-ab8f-69a4bae296b0@gmail.com> (raw)
In-Reply-To: <20190607141548.GP31203@kadam>

On 07/06/19 7:45 PM, Dan Carpenter wrote:
> Probably you sent this patch unintentionally.  The subject doesn't make
> any sort of sense.  :P

So the problem with the subject line is that git send-email and vim (as 
configured on my laptop) tend to line-wrap even the subject line. Since 
I have two patches that do the same thing for different functions, I 
felt I should have the driver and the function name in the subject line 
(to avoid confusion between the patches and to allow for easy searching 
later). But that doesn't leave enough space in the subject line for 
"Change return values/type" or any other descriptive message. What 
should I do?


> On Fri, Jun 07, 2019 at 07:36:57PM +0530, Nishka Dasgupta wrote:
>> Change the return values of function r8712_setdatarate_cmd from _SUCCESS
>> and _FAIL to 0 and -ENOMEM respectively.
>> Change the return type of the function from u8 to int to reflect this.
>> Change the call site of the function to check for 0 instead of _SUCCESS.
>> (Checking that the return value != 0 is not necessary; the return value
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> itself can simply be passed into the conditional.)
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



> This is obvious.  No need to mention it in the commit message.

Okay, I'll amend that.

>> diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
>> index b424b8436fcf..761e2ba68a42 100644
>> --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
>> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
>> @@ -1367,7 +1367,7 @@ static int r8711_wx_set_rate(struct net_device *dev,
>>   			datarates[i] = 0xff;
>>   		}
>>   	}
>> -	if (r8712_setdatarate_cmd(padapter, datarates) != _SUCCESS)
>> +	if (r8712_setdatarate_cmd(padapter, datarates))
>>   		ret = -ENOMEM;
>>
>>   	return ret;
> 
> 
> It would be better to write this like so:
> 
> 	ret = r8712_setdatarate_cmd(padapter, datarates);
> 	if (ret)
> 		return ret;
> 
> 	return 0;
> 
> Or you could write it like:
> 
> 	return r8712_setdatarate_cmd(padapter, datarates);

Okay, since this is the only point at which a return happens in this 
function, I can do this.

> Which ever one you prefer is fine
Thanking you,
Nishka

> regards,
> dan carpenter
> 


  reply	other threads:[~2019-06-10  4:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07 14:06 Nishka Dasgupta
2019-06-07 14:06 ` [PATCH 2/2] staging: rtl8712: r8712_createbss_cmd(): Change Nishka Dasgupta
2019-06-07 14:18   ` Dan Carpenter
2019-06-07 14:15 ` [PATCH 1/2] staging: rtl8712: r8712_setdatarate_cmd(): Change Dan Carpenter
2019-06-10  4:32   ` Nishka Dasgupta [this message]
2019-06-10 14:33     ` Dan Carpenter

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=98b587c9-df5b-0905-ab8f-69a4bae296b0@gmail.com \
    --to=nishkadg.linux@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=florian.c.schilhabel@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=larry.finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=straube.linux@gmail.com \
    --cc=tiny.windzz@gmail.com \
    --cc=valdis.kletnieks@vt.edu \
    /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

Powered by JetHome