public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: "Alexis R. Cortes" <alexis.cortes@ti.com>
Cc: "'Peter Stuge'" <peter@stuge.se>,
	gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, brian.quach@ti.com,
	jorge.llamas@ti.com
Subject: Re: [PATCH] usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP Hardware
Date: Wed, 1 Aug 2012 16:32:15 -0700	[thread overview]
Message-ID: <20120801233215.GD7564@xanatos> (raw)
In-Reply-To: <007b01cd702f$1b5e4870$521ad950$@cortes@ti.com>

On Wed, Aug 01, 2012 at 04:46:27PM -0500, Alexis R. Cortes wrote:
> Hi Sarah,
> 
> Sure!! I'll update the patch's description and will send another patch in a
> few moments.
> 
> As an additional comment, I ran the 'checkpatch.pl' script and verified
> there were no errors before submitting the patch. I only got a few Warnings
> related to the line limits. 

Can you break the code up a bit so the line limit warnings don't appear?
The long line warnings are really indicative of a deeper problem,
usually that the parent function has gotten much too long, and should be
broken into smaller functions.

The only exception to the long line rule (and one that checkpatch
doesn't usually complain about) is that we don't break up lines in the
middle of strings.  It makes searching for the strings later much
harder.  So either leave the really long string line, or break it up
into two xhci_dbg statements.

In general, warnings from checkpatch.pl stop my patch application and
submission work flow, so I don't accept patches with warnings.

For instance:

			if (xhci->quirks & XHCI_COMP_MODE_QUIRK) {
				if (xhci->port_status_u0 != ((1 << xhci->num_usb3_ports)-1)) {
					if ((temp & PORT_PLS_MASK) == XDEV_U0) {
						xhci->port_status_u0 |= 1 << wIndex;
						if (xhci->port_status_u0 == ((1 << xhci->num_usb3_ports)-1)) {
							del_timer_sync(&xhci->comp_mode_recovery_timer);
							xhci_dbg(xhci, "Compliance Mode Recovery Timer Deleted. "
                                                                       "All USB3 ports have entered U0 at least once.\n");
                                               }
                                       }
                               }
                       }

Could be broken out into a new function, like so:

void xhci_del_comp_mod_timer(struct xhci_hcd *xhci)
{
	unsigned int all_ports_seen_u0 = ((1 << xhci->num_usb3_ports)-1));
	boolean this_port_in_u0 = ((temp & PORT_PLS_MASK) == XDEV_U0);

	if (!(xhci->quirks & XHCI_COMP_MODE_QUIRK))
		return;

	if (xhci->port_status_u0 != all_ports_seen_u0 && this_port_in_u0) {
		xhci->port_status_u0 |= 1 << wIndex;
		if (xhci->port_status_u0 == all_ports_seen_u0) {
			del_timer_sync(&xhci->comp_mode_recovery_timer);
			xhci_dbg(xhci, "All USB3 ports have entered U0 at least once.\n");
			xhci_dbg(xhci, "Compliance Mode Recovery Timer Deleted.\n");
		}
	}
}

Then you can call that new function in the ugly long indent-heavy function
in xhci-hub.c.

Sarah Sharp

  parent reply	other threads:[~2012-08-01 23:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 19:04 [PATCH] usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP Hardware Alexis R. Cortes
2012-08-01 20:01 ` Peter Stuge
2012-08-01 21:18   ` Sarah Sharp
     [not found]     ` <007b01cd702f$1b5e4870$521ad950$@cortes@ti.com>
2012-08-01 23:32       ` Sarah Sharp [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-08-01 22:36 Alexis R. Cortes
2012-08-01 23:23 ` Peter Stuge
2012-08-01 23:51 ` Sarah Sharp
2012-07-31 22:48 Alexis R. Cortes
2012-07-31 23:18 ` Greg KH
2012-07-31 21:19 Alexis Cortes
2012-07-31 21:38 ` Greg KH
     [not found]   ` <50186206.0730b60a.069d.6df1SMTPIN_ADDED@mx.google.com>
2012-07-31 23:16     ` 'Greg KH'

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=20120801233215.GD7564@xanatos \
    --to=sarah.a.sharp@linux.intel.com \
    --cc=alexis.cortes@ti.com \
    --cc=brian.quach@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jorge.llamas@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter@stuge.se \
    /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