public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Will Cunningham <wjcunningham7@gmail.com>
Cc: johan@kernel.org, devel@driverdev.osuosl.org, elder@kernel.org,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	elder@linaro.org, joe@perches.com
Subject: Re: [PATCH v2] Staging: greybus: usb: Fixed a coding style error
Date: Tue, 2 Apr 2019 09:07:19 +0300	[thread overview]
Message-ID: <20190402060719.GD32590@kadam> (raw)
In-Reply-To: <20190401142208.GA12744@titus.pi.local>

On Mon, Apr 01, 2019 at 10:22:08AM -0400, Will Cunningham wrote:
> Line was >80 characters.
> 
> Signed-off-by: Will Cunningham <wjcunningham7@gmail.com>
> ---
> Changes in v2:
>  - Created a tmp variable to shorten line length.
> ---
>  drivers/staging/greybus/usb.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/greybus/usb.c b/drivers/staging/greybus/usb.c
> index 1c246c73a085..c09793b48850 100644
> --- a/drivers/staging/greybus/usb.c
> +++ b/drivers/staging/greybus/usb.c
> @@ -163,14 +163,14 @@ static int gb_usb_probe(struct gbphy_device *gbphy_dev,
>  	struct gb_usb_device *gb_usb_dev;
>  	struct usb_hcd *hcd;
>  	int retval;
> +	u16 tmp;
>  
>  	hcd = usb_create_hcd(&usb_gb_hc_driver, dev, dev_name(dev));
>  	if (!hcd)
>  		return -ENOMEM;
>  
> -	connection = gb_connection_create(gbphy_dev->bundle,
> -					  le16_to_cpu(gbphy_dev->cport_desc->id),
> -					  NULL);
> +	tmp = le16_to_cpu(gbphy_dev->cport_desc->id);
> +	connection = gb_connection_create(gbphy_dev->bundle, tmp, NULL);


"tmp" is the wrong name...  :/

Like Joe said, it's doesn't help readability to introduce one time use
temporary variables just to make the line lengths shorter.  This line is
81 characters.  It's fine.  Just leave the original as is.

regards,
dan carpenter


      parent reply	other threads:[~2019-04-02  6:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 14:22 [PATCH v2] Staging: greybus: usb: Fixed a coding style error Will Cunningham
2019-04-01 14:25 ` Alex Elder
2019-04-02  6:07 ` Dan Carpenter [this message]

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=20190402060719.GD32590@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=elder@kernel.org \
    --cc=elder@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wjcunningham7@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox