All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@osg.samsung.com>
To: Alan Ott <alan@signal11.us>, linux-wpan@vger.kernel.org
Cc: Alexander Aring <aring@mojatatu.com>,
	michael.hennerich@analog.com, h.morris@cascoda.com,
	linuxdev@cascoda.com, varkabhadram@gmail.com
Subject: Re: [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors
Date: Fri, 22 Sep 2017 16:38:33 +0200	[thread overview]
Message-ID: <026307ac-abfa-301c-a4f4-1dc81a3fae7a@osg.samsung.com> (raw)
In-Reply-To: <d70bf39d-0917-36fe-5239-4552ec10185f@signal11.us>

Hello.

On 09/22/2017 04:12 PM, Alan Ott wrote:
> Hi Stefan, it's good to hear from you.

Same goes to you. It has been a while. Pretty fast turnaround time for mrf24 patches this time. :P

> On 09/22/2017 08:13 AM, Stefan Schmidt wrote:
>> Fix format of multi-line comments and long lines.
>>
>> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> 
> Overall, it's pretty churny. More below:
> 
>> ---
>>  drivers/net/ieee802154/mrf24j40.c | 18 +++++++++++-------
>>  1 file changed, 11 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
>> index ee7084b2d52d..e951a191e15d 100644
>> --- a/drivers/net/ieee802154/mrf24j40.c
>> +++ b/drivers/net/ieee802154/mrf24j40.c
>> @@ -569,8 +569,9 @@ static void write_tx_buf_complete(void *context)
>>  }
>>
>>  /* This function relies on an undocumented write method. Once a write command
>> -   and address is set, as many bytes of data as desired can be clocked into
>> -   the device. The datasheet only shows setting one byte at a time. */
>> + * and address is set, as many bytes of data as desired can be clocked into
>> + * the device. The datasheet only shows setting one byte at a time.
>> + */
>>  static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
>>  			const u8 *data, size_t length)
>>  {
>> @@ -578,9 +579,10 @@ static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
>>  	int ret;
>>
>>  	/* Range check the length. 2 bytes are used for the length fields.*/
>> -	if (length > TX_FIFO_SIZE-2) {
>> -		dev_err(printdev(devrec), "write_tx_buf() was passed too large a buffer. Performing short write.\n");
>> -		length = TX_FIFO_SIZE-2;
>> +	if (length > TX_FIFO_SIZE - 2) {
>> +		dev_err(printdev(devrec), "%s: passed buffer to large, short write\n",
>> +			__func__);
>> +		length = TX_FIFO_SIZE - 2;
>>  	}
> 
> Not breaking printouts is a case where long-ish lines are ok. Changing 
> the output to be less clear and useful just to make the line short is a 
> regression in my mind.

You are the native speaker but if I compare the two sentences they do not really look less clear and useful to me.
But well, different perceptions. :)

One thing I wondered when looking at this hunk was if this case can actually happen? Can we really get a length here greater than
TX_FIFO_SIZE-2?

>>
>>  	cmd = MRF24J40_WRITELONG(reg);
>> @@ -1073,7 +1075,8 @@ static int mrf24j40_hw_init(struct mrf24j40 *devrec)
>>  	int ret;
>>
>>  	/* Initialize the device.
>> -		From datasheet section 3.2: Initialization. */
>> +	 * From datasheet section 3.2: Initialization.
>> +	 */
>>  	ret = regmap_write(devrec->regmap_short, REG_SOFTRST, 0x07);
>>  	if (ret)
>>  		goto err_ret;
>> @@ -1374,7 +1377,8 @@ static int mrf24j40_remove(struct spi_device *spi)
>>  	ieee802154_unregister_hw(devrec->hw);
>>  	ieee802154_free_hw(devrec->hw);
>>  	/* TODO: Will ieee802154_free_device() wait until ->xmit() is
>> -	 * complete? */
>> +	 * complete?
>> +	 */
>>
>>  	return 0;
>>  }
>>
> 
> Regarding the comment format, adding extra lines for */ on a two-line 
> comment is a bit overkill.

Well, it simply is the kernel coding style. Imagine multi-line comments outside of net/ and drivers/net/ also have an /* on a new line at
the beginning. :-)

> Sorry to be this way, but I just don't agree with this patch. It just 
> feels like churn to me.

Given the tiny amount of patches mrf24 sees over time I would not go as far as calling this churn as it is highly unlikely to conflict with
anything else pending.

I do not mind dropping this patch if you do not want it, though. No problem from my side.

regards
Stefan Schmidt

  reply	other threads:[~2017-09-22 14:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
2017-09-22 12:13 ` [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned Stefan Schmidt
2017-11-06 15:37   ` Michael Hennerich
2017-11-06 15:39     ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 02/14] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2017-09-22 12:13 ` [PATCH 03/14] ieee802154: at86rf230: use __func__ macro for debug messages Stefan Schmidt
2017-09-22 12:13 ` [PATCH 04/14] ieee802154: atusb: switch from uint8_t to u8 Stefan Schmidt
2017-11-06 15:35   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 05/14] ieee802154: atusb: use __func__ macro for debug messages Stefan Schmidt
2017-11-06 15:35   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 06/14] ieee802154: atusb: fix some kernel coding style errors Stefan Schmidt
2017-11-06 15:36   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 07/14] ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2017-11-06 15:36   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors Stefan Schmidt
2017-09-22 14:12   ` Alan Ott
2017-09-22 14:38     ` Stefan Schmidt [this message]
2017-09-22 12:14 ` [PATCH 09/14] ieee802154: ca8210: " Stefan Schmidt
2017-11-06 15:27   ` Harry Morris
2017-11-06 15:40     ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages Stefan Schmidt
2017-11-06 15:32   ` Harry Morris
2017-11-06 15:40     ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 11/14] ieee802154: cc2520: fix some kernel coding style errors Stefan Schmidt
2017-11-06 15:34   ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages Stefan Schmidt
     [not found]   ` <CAEUmHyZ1oaMjqzMHgNtMg+S2cmq2DvvgAkxBsP6-dkzYp0KyOw@mail.gmail.com>
2017-11-06 15:23     ` Stefan Schmidt
2017-11-06 15:34   ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2017-11-06 15:32   ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 14/14] ieee802154: fakelb: " Stefan Schmidt
2017-11-06 14:25 ` [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt

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=026307ac-abfa-301c-a4f4-1dc81a3fae7a@osg.samsung.com \
    --to=stefan@osg.samsung.com \
    --cc=alan@signal11.us \
    --cc=aring@mojatatu.com \
    --cc=h.morris@cascoda.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=linuxdev@cascoda.com \
    --cc=michael.hennerich@analog.com \
    --cc=varkabhadram@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.