linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Lan Tianyu <tianyu.lan@intel.com>,
	lenb@kernel.org, linux-usb@vger.kernel.org,
	linux-acpi@vger.kernel.org, stern@rowland.harvard.edu
Subject: Re: [PATCH 2/3] USB/ACPI: Add usb port's acpi power control in the xhci PORT_POWER feature request process.
Date: Wed, 13 Jun 2012 13:53:29 -0700	[thread overview]
Message-ID: <20120613205329.GA5597@xanatos> (raw)
In-Reply-To: <20120613193038.GA6312@kroah.com>

On Wed, Jun 13, 2012 at 12:30:38PM -0700, Greg KH wrote:
> On Mon, Jun 11, 2012 at 10:24:33AM +0800, Lan Tianyu wrote:
> > +
> > +			if (usb_acpi_power_manageable(hcd->self.root_hub,
> > +					wIndex + 1))
> 
> Why +1?  If you have to do this everywhere, then do it only in the
> function, so you can be 0 based properly.
> 
> Also, minor coding style nit, please rewrite as:
> 			if (usb_acpi_power_manageable(hcd->self.root_hub,
> 						      wIndex + 1))

This is an arbitrarily applied rule, and I don't follow it in the xHCI
driver.  The code indentation should be left at the default indentation
in the xHCI driver.  Let's keep the code style in the driver consistent,
please.

I don't understand why people want to move the trailing arguments to
align with the function parenthesis.  I can see that it might add to
readability for some people, but it's just more work on both the
developer's and maintainer's side.

Checkpatch will complain about mixed tabs and spaces, so that's more
work for me to edit my git pre-commit hook when the checkpatch error
stops git-am.  Plus the developer has to actually pause and think about
indentation, rather than letting their editor take care of it.

I'm not even sure when you would want the alignment rule applied.  In
all function calls with trailing arguments?  That seems really
excessive.

> Or even better yet, use a temp variable for the value returned and then
> check that, it's clearer and easier to read, right?

A temp variable would be fine until that function can just be
refactored.  The case statements should really just be broken out into
separate functions.

Sarah Sharp

  reply	other threads:[~2012-06-13 20:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11  2:24 [PATCH 0/3] USB/ACPI: Add usb port power off mechanism Lan Tianyu
     [not found] ` <1339381474-17413-1-git-send-email-tianyu.lan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2012-06-11  2:24   ` [PATCH 1/3] xhci: Add clear PORT_POWER feature process in the xhci_hub_control() Lan Tianyu
2012-06-11  2:24 ` [PATCH 2/3] USB/ACPI: Add usb port's acpi power control in the xhci PORT_POWER feature request process Lan Tianyu
2012-06-13 19:30   ` Greg KH
2012-06-13 20:53     ` Sarah Sharp [this message]
2012-06-13 21:00       ` Greg KH
     [not found]     ` <20120613193038.GA6312-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-06-13 21:10       ` Alan Stern
2012-06-13 21:35         ` Sarah Sharp
2012-06-14  7:22       ` Lan Tianyu
2012-06-14 15:44         ` Greg KH
2012-06-15  7:05           ` Lan Tianyu
2012-06-11  2:24 ` [PATCH 3/3] usb : Add sysfs files to control usb port's power Lan Tianyu
2012-06-11 14:12   ` Alan Stern
     [not found]   ` <1339381474-17413-4-git-send-email-tianyu.lan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2012-06-13 19:33     ` Greg KH
     [not found]       ` <20120613193323.GB6312-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-06-13 21:15         ` Alan Stern
2012-06-13 21:46           ` Greg KH
2012-06-14 13:57             ` Alan Stern
2012-06-14 14:35               ` 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=20120613205329.GA5597@xanatos \
    --to=sarah.a.sharp@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tianyu.lan@intel.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;
as well as URLs for NNTP newsgroup(s).