Re: [PATCH 5/5] ACPI/EC: Cleanup coding style.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, October 22, 2014 05:59:59 AM Zheng, Lv wrote:
> Hi, Rafael
> 
> > From: linux-acpi-owner@xxxxxxxxxxxxxxx [mailto:linux-acpi-owner@xxxxxxxxxxxxxxx] On Behalf Of Zheng, Lv
> > Sent: Wednesday, October 22, 2014 1:06 PM
> > 
> > Hi, Rafael
> > 
> > > From: linux-acpi-owner@xxxxxxxxxxxxxxx [mailto:linux-acpi-owner@xxxxxxxxxxxxxxx] On Behalf Of Rafael J. Wysocki
> > > Sent: Tuesday, October 21, 2014 9:29 PM
> > >
> > > On Tuesday, October 14, 2014 02:24:01 PM Lv Zheng wrote:
> > > > This patch cleans up the following coding style issues that are detected by
> > > > scripts/checkpatch.pl:
> > > >  ERROR: code indent should use tabs where possible
> > > >  ERROR: "foo * bar" should be "foo *bar"
> > > >  WARNING: Missing a blank line after declarations
> > > >  WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
> > > >  WARNING: void function return statements are not generally useful
> > > >  WARNING: else is not generally useful after a break or return
> > > >  WARNING: break is not useful after a goto or return
> > > >  WARNING: braces {} are not necessary for single statement blocks
> > > >  WARNING: line over 80 characters
> > > >  WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
> > > > No functional changes.
> > > >
> > > > Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx>
> > > > ---
> > > >  drivers/acpi/ec.c |   58 ++++++++++++++++++++++++++++-------------------------
> > > >  1 file changed, 31 insertions(+), 27 deletions(-)
> > > >
> > > > diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> > > > index d993df6..5f4e6c6 100644
> > > > --- a/drivers/acpi/ec.c
> > > > +++ b/drivers/acpi/ec.c
> > > > @@ -128,12 +128,13 @@ static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
> > > >  static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
> > > >
> > > >  /* --------------------------------------------------------------------------
> > > > -                             Transaction Management
> > > > -   -------------------------------------------------------------------------- */
> > > > + *                           Transaction Management
> > > > + * -------------------------------------------------------------------------- */
> > > >
> > > >  static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
> > > >  {
> > > >  	u8 x = inb(ec->command_addr);
> > > > +
> > > >  	pr_debug("EC_SC(R) = 0x%2.2x "
> > > >  		 "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n",
> > > >  		 x,
> > > > @@ -148,6 +149,7 @@ static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
> > > >  static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
> > > >  {
> > > >  	u8 x = inb(ec->data_addr);
> > > > +
> > > >  	pr_debug("EC_DATA(R) = 0x%2.2x\n", x);
> > > >  	return x;
> > > >  }
> > > > @@ -189,6 +191,7 @@ static int ec_transaction_completed(struct acpi_ec *ec)
> > > >  {
> > > >  	unsigned long flags;
> > > >  	int ret = 0;
> > > > +
> > > >  	spin_lock_irqsave(&ec->lock, flags);
> > > >  	if (ec->curr && (ec->curr->flags & ACPI_EC_COMMAND_COMPLETE))
> > > >  		ret = 1;
> > > > @@ -288,6 +291,7 @@ static int ec_poll(struct acpi_ec *ec)
> > > >  {
> > > >  	unsigned long flags;
> > > >  	int repeat = 5; /* number of command restarts */
> > > > +
> > > >  	while (repeat--) {
> > > >  		unsigned long delay = jiffies +
> > > >  			msecs_to_jiffies(ec_delay);
> > > > @@ -320,6 +324,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
> > > >  {
> > > >  	unsigned long tmp;
> > > >  	int ret = 0;
> > > > +
> > > >  	if (EC_FLAGS_MSI)
> > > >  		udelay(ACPI_EC_MSI_UDELAY);
> > > >  	/* start transaction */
> > > > @@ -347,6 +352,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
> > > >  {
> > > >  	int status;
> > > >  	u32 glk;
> > > > +
> > > >  	if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
> > > >  		return -EINVAL;
> > > >  	if (t->rdata)
> > > > @@ -374,7 +380,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
> > > >  	/* check if we received SCI during transaction */
> > > >  	ec_check_sci_sync(ec, acpi_ec_read_status(ec));
> > > >  	if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
> > > > -		msleep(1);
> > > > +		msleep(20);
> > >
> > > This is a functional change, so I've dropped it from the patch (it didn't apply for
> > > me anyway).  Please send it as a separate patch with an appropriate changelog if
> > > you want to make it.
> > 
> > OK. I'll split this as a separate patch.
> 
> I saw the rest of the diff blocks are merged.
> So since no strict requirement on doing this besides of the checkpatch.pl warning.
> I'll stop doing this.

OK, thanks.

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux