Re: [PATCH] staging/media: Use dev_ printks in go7007/s2250-loader.c

2012-11-05 Thread Toshiaki Yamane
On Tue, Nov 6, 2012 at 12:25 AM, Joe Perches  wrote:
> On Mon, 2012-11-05 at 16:22 +0100, Greg Kroah-Hartman wrote:
>> On Mon, Nov 05, 2012 at 07:11:11AM -0800, Joe Perches wrote:
>> > On Mon, 2012-11-05 at 14:11 +0100, Greg Kroah-Hartman wrote:
>> > > On Mon, Nov 05, 2012 at 08:34:42PM +0900, YAMANE Toshiaki wrote:
>> > > > fixed below checkpatch warnings.
>> > > > - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then 
>> > > > pr_err(...  to printk(KERN_ERR ...
>> > > > - WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
>> > > > pr_info(...  to printk(KERN_INFO ...
>> > > >
>> > > > Signed-off-by: YAMANE Toshiaki 
>> > > > ---
>> > > >  drivers/staging/media/go7007/s2250-loader.c |   35 
>> > > > ++-
>> > > >  1 file changed, 18 insertions(+), 17 deletions(-)
>> > >
>> > > Please note that I don't touch the drivers/staging/media/* files, so
>> > > copying me on these patches doesn't do anything :)
>> >
>> > Maybe:
>> >
>> >  MAINTAINERS |1 +
>> >  1 files changed, 1 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/MAINTAINERS b/MAINTAINERS
>> > index b062349..542a541 100644
>> > --- a/MAINTAINERS
>> > +++ b/MAINTAINERS
>> > @@ -6906,6 +6906,7 @@ T:git 
>> > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
>> >  L: de...@driverdev.osuosl.org
>> >  S: Supported
>> >  F: drivers/staging/
>> > +X: drivers/staging/media/
>>
>> Sure, that would be good, care to resend it with a signed-off-by: so I
>> can apply it?
>
> It was just a nudge.
>
> You're the nominal staging maintainer, if you choose not to
> work on a specific directory under staging, I think you can
> mark it in MAINTAINERS just as easily yourself.

Thanks for all.

I wait Mauro-san will pick the patches.
And I will send the patches to the correct destination from the next time.


-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/media: Use dev_ printks in go7007/s2250-loader.c

2012-11-05 Thread Toshiaki Yamane
On Mon, Nov 5, 2012 at 10:11 PM, Greg Kroah-Hartman  wrote:
> On Mon, Nov 05, 2012 at 08:34:42PM +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch warnings.
>> - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then 
>> pr_err(...  to printk(KERN_ERR ...
>> - WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
>> pr_info(...  to printk(KERN_INFO ...
>>
>> Signed-off-by: YAMANE Toshiaki 
>> ---
>>  drivers/staging/media/go7007/s2250-loader.c |   35 
>> ++-
>>  1 file changed, 18 insertions(+), 17 deletions(-)
>
> Please note that I don't touch the drivers/staging/media/* files, so
> copying me on these patches doesn't do anything :)

Thanks for your follow-up.

I tried to check in get_maintainer.pl...
Do I need to be re-sent to the address "Mauro Carvalho Chehab
"?


-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c

2012-10-25 Thread Toshiaki Yamane
On Tue, Oct 23, 2012 at 4:52 AM, Greg Kroah-Hartman  wrote:
> On Wed, Oct 10, 2012 at 09:20:59PM +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch warning.
>> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
>> pr_warn(...  to printk(KERN_WARNING ...
>>
>> and added pr_fmt.
>>
>> Signed-off-by: YAMANE Toshiaki 
>> ---
>>  drivers/staging/comedi/drivers/gsc_hpdi.c |   31 
>> +++--
>>  1 file changed, 16 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c 
>> b/drivers/staging/comedi/drivers/gsc_hpdi.c
>> index abff660..30a27fd 100644
>> --- a/drivers/staging/comedi/drivers/gsc_hpdi.c
>> +++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
>> @@ -45,6 +45,8 @@ support could be added to this driver.
>>
>>  */
>>
>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>> +
>>  #include 
>>  #include "../comedidev.h"
>>  #include 
>> @@ -107,8 +109,7 @@ enum hpdi_registers {
>>  int command_channel_valid(unsigned int channel)
>>  {
>>   if (channel == 0 || channel > 6) {
>> - printk(KERN_WARNING
>> -"gsc_hpdi: bug! invalid cable command channel\n");
>> + pr_warn("bug! invalid cable command channel\n");
>>   return 0;
>>   }
>>   return 1;
>> @@ -553,7 +554,7 @@ static int hpdi_attach(struct comedi_device *dev, struct 
>> comedi_devconfig *it)
>>   int i;
>>   int retval;
>>
>> - printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
>> + dev_warn(dev->class_dev, "gsc_hpdi\n");
>
> What is this warning about?
>
>>
>>   if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
>>   return -ENOMEM;
>> @@ -582,17 +583,17 @@ static int hpdi_attach(struct comedi_device *dev, 
>> struct comedi_devconfig *it)
>>   } while (pcidev != NULL);
>>   }
>>   if (dev->board_ptr == NULL) {
>> - printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
>> + dev_warn(dev->class_dev, "no hpdi card found\n");
>>   return -EIO;
>>   }
>>
>> - printk(KERN_WARNING
>> -"gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
>> -pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>> + dev_warn(dev->class_dev,
>> +  "found %s on bus %i, slot %i\n", board(dev)->name,
>> +  pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>>
>>   if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
>> - printk(KERN_WARNING
>> -" failed enable PCI device and request regions\n");
>> + dev_warn(dev->class_dev,
>> +  " failed enable PCI device and request regions\n");
>>   return -EIO;
>>   }
>>   pci_set_master(pcidev);
>> @@ -613,7 +614,7 @@ static int hpdi_attach(struct comedi_device *dev, struct 
>> comedi_devconfig *it)
>>   ioremap(priv(dev)->hpdi_phys_iobase,
>>   pci_resource_len(pcidev, HPDI_BADDRINDEX));
>>   if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
>> - printk(KERN_WARNING " failed to remap io memory\n");
>> + dev_warn(dev->class_dev, "failed to remap io memory\n");
>>   return -ENOMEM;
>>   }
>>
>> @@ -625,13 +626,13 @@ static int hpdi_attach(struct comedi_device *dev, 
>> struct comedi_devconfig *it)
>>   /*  get irq */
>>   if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
>>   dev->driver->driver_name, dev)) {
>> - printk(KERN_WARNING
>> -" unable to allocate irq %u\n", pcidev->irq);
>> + dev_warn(dev->class_dev,
>> +  "unable to allocate irq %u\n", pcidev->irq);
>>   return -EINVAL;
>>   }
>>   dev->irq = pcidev->irq;
>>
>> - printk(KERN_WARNING " irq %u\n", dev->irq);
>> + dev_warn(dev->class_dev, "irq %u\n", dev->irq);
>
> Again a warning?  Shouldn't most of these be debugging lines instead?
>
> greg k-h

Only two points above should be in debugging line?
Should it modify dev_dbg on 589 also?

>> - printk(KERN_WARNING
>> -"gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
>> -pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>> + dev_warn(dev->class_dev,
>> +  "found %s on bus %i, slot %i\n", board(dev)->name,
>> +  pcidev->bus->number, PCI_SLOT(pcidev->devfn));

I am grad to tell me why.

And I will resend the patch only two points are in debugging line.

-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c

2012-10-24 Thread Toshiaki Yamane
On Thu, Oct 25, 2012 at 11:43 AM, Greg Kroah-Hartman
 wrote:
> On Thu, Oct 25, 2012 at 11:23:13AM +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch warning.
>> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
>> pr_warn(...  to printk(KERN_WARNING ...
>>
>> some of them have been replaced by dev_dbg or pr_debug,
>> and added pr_fmt.
>>
>> Signed-off-by: YAMANE Toshiaki 
>
> This patch doesn't apply, can you redo it against the next linux-next
> release and resend it?

Yes, thanks.


-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] staging/sbe-2t3e3: Use netdev_ printks in main.c

2012-10-23 Thread Toshiaki Yamane
On Wed, Oct 24, 2012 at 1:15 PM, Greg Kroah-Hartman
 wrote:
> On Wed, Oct 24, 2012 at 12:05:28PM +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch warning.
>> - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then 
>> pr_err(...  to printk(KERN_ERR ...
>>
>> Signed-off-by: YAMANE Toshiaki 
>
> I never got the 3/3 patch in this series :(

I know!
# thanks, I will learn more ways to send patch

-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/comedi: Use dev_ printks in drivers/vmk80xx.c

2012-10-23 Thread Toshiaki Yamane
On Tue, Oct 23, 2012 at 4:45 AM, Greg Kroah-Hartman  wrote:
> Note, when you resend please enumerate what version of the patch this
> is, otherwise I can get very confused.

Sorry, I am going to watch out for it from the next.


-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/comedi: Use dev_ printks in drivers/usbdux.c

2012-10-14 Thread Toshiaki Yamane
On Sun, Oct 14, 2012 at 10:38 PM, YAMANE Toshiaki  wrote:
> fixed below checkpatch warning.
> - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then 
> pr_err(...  to printk(KERN_ERR ...
>
> Signed-off-by: YAMANE Toshiaki 
> ---
>  drivers/staging/comedi/drivers/usbdux.c |   10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/usbdux.c 
> b/drivers/staging/comedi/drivers/usbdux.c
> index b536bba..46c5bfb 100644
> --- a/drivers/staging/comedi/drivers/usbdux.c
> +++ b/drivers/staging/comedi/drivers/usbdux.c
> @@ -2386,14 +2386,12 @@ static int usbdux_attach_usb(struct comedi_device 
> *dev,
> down(&start_stop_sem);
> this_usbduxsub = usb_get_intfdata(uinterf);
> if (!this_usbduxsub || !this_usbduxsub->probed) {
> -   printk(KERN_ERR
> -  "comedi%d: usbdux: error: attach_usb failed, not 
> connected\n",
> -  dev->minor);
> +   dev_err(&uinterf->dev,
> +   "usbdux: error: attach_usb failed, not connected\n");
> ret = -ENODEV;
> } else if (this_usbduxsub->attached) {
> -   printk(KERN_ERR
> -  "comedi%d: usbdux: error: attach_usb failed, already 
> attached\n",
> -  dev->minor);
> +   dev_err(&uinterf->dev,
> +   "error: attach_usb failed, already attached\n");
> ret = -ENODEV;
> } else
> ret = usbdux_attach_common(dev, this_usbduxsub);
> --
> 1.7.9.5
>

I cannot judge which is better or not ...

-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/comedi: Use dev_ printks in drivers/adl_pci8164.c

2012-10-05 Thread Toshiaki Yamane
On Fri, Oct 5, 2012 at 6:15 PM, Ian Abbott  wrote:
> On 2012-10-05 01:07, YAMANE Toshiaki wrote:
>>
>> fixed below checkpatch warning.
>> - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then
>> pr_err(...  to printk(KERN_ERR ...
>>
>> Signed-off-by: YAMANE Toshiaki 
>> ---
>>   drivers/staging/comedi/drivers/adl_pci8164.c |   12 ++--
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/adl_pci8164.c
>> b/drivers/staging/comedi/drivers/adl_pci8164.c
>> index 05e06e7..6dbe465 100644
>> --- a/drivers/staging/comedi/drivers/adl_pci8164.c
>> +++ b/drivers/staging/comedi/drivers/adl_pci8164.c
>> @@ -89,9 +89,9 @@ static void adl_pci8164_insn_read(struct comedi_device
>> *dev,
>> }
>>
>> data[0] = inw(dev->iobase + axis_reg + offset);
>> -   printk(KERN_DEBUG "comedi: pci8164 %s read -> "
>> - "%04X:%04X on axis
>> %s\n",
>> -   action, data[0], data[1], axisname);
>> +   dev_dbg(dev->class_dev,
>> + "comedi: pci8164 %s read -> %04X:%04X on axis %s\n",
>> + action, data[0], data[1], axisname);
>>   }
>
>
> The "comedi: " prefix is superfluous, so should be removed.  The dev_dbg()
> call will emit the word "comedi" twice already without the extra prefix.
>
>
>>
>>   static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
>> @@ -170,9 +170,9 @@ static void adl_pci8164_insn_out(struct comedi_device
>> *dev,
>>
>> outw(data[0], dev->iobase + axis_reg + offset);
>>
>> -   printk(KERN_DEBUG "comedi: pci8164 %s write -> "
>> -   "%04X:%04X on axis %s\n",
>> -   action, data[0], data[1], axisname);
>> +   dev_dbg(dev->class_dev,
>> + "comedi: pci8164 %s write -> %04X:%04X on axis %s\n",
>> + action, data[0], data[1], axisname);
>>
>>   }
>
>
> Same here.

Ian-san,

Thank you for pointing out my mistakes.
I will try to fix it.

-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/comedi: Use dev_ printks in drivers/me_daq.c

2012-10-05 Thread Toshiaki Yamane
On Fri, Oct 5, 2012 at 6:08 PM, Ian Abbott  wrote:
> On 2012-10-05 01:07, YAMANE Toshiaki wrote:
>>
>> fixed below checkpatch warnings.
>> - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then
>> pr_err(...  to printk(KERN_ERR ...
>> - WARNING: quoted string split across lines
>>
>> Signed-off-by: YAMANE Toshiaki 
>> ---
>>   drivers/staging/comedi/drivers/me_daq.c |   26
>> +++---
>>   1 file changed, 15 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/me_daq.c
>> b/drivers/staging/comedi/drivers/me_daq.c
>> index 2ce0b14..0d85729 100644
>> --- a/drivers/staging/comedi/drivers/me_daq.c
>> +++ b/drivers/staging/comedi/drivers/me_daq.c
>> @@ -384,8 +384,8 @@ static int me_ai_insn_read(struct comedi_device *dev,
>> (readw(dev_private->me_regbase +
>>ME_READ_AD_FIFO) ^ 0x800) & 0x0FFF;
>> } else {
>> -   printk(KERN_ERR "comedi%d: Cannot get single value\n",
>> -  dev->minor);
>> +   dev_err(dev->class_dev, "comedi%d: Cannot get single
>> value\n",
>> +   dev->minor);
>
>
> There is no need for the "comedi%d: " prefix as dev_??? already puts the
> device name in the message.  Just use:
>
> dev_err(dev->class_dev, "Cannot get single value\n");
>
>
>> return -EIO;
>> }
>>
>> @@ -566,8 +566,8 @@ static int me2600_xilinx_download(struct comedi_device
>> *dev,
>> if (value & 0x20) {
>> /* Disable interrupt */
>> writel(0x00, dev_private->plx_regbase + PLX_INTCSR);
>> -   printk(KERN_ERR "comedi%d: Xilinx download failed\n",
>> -  dev->minor);
>> +   dev_err(dev->class_dev, "comedi%d: Xilinx download
>> failed\n",
>> +   dev->minor);
>> return -EIO;
>> }
>>
>> @@ -654,8 +654,9 @@ static int me_attach_pci(struct comedi_device *dev,
>> struct pci_dev *pcidev)
>>
>> /* Enable PCI device and request PCI regions */
>> if (comedi_pci_enable(pcidev, dev->board_name) < 0) {
>> -   printk(KERN_ERR "comedi%d: Failed to enable PCI device and
>> "
>> -  "request regions\n", dev->minor);
>> +   dev_err(dev->class_dev,
>> +   "comedi%d: Failed to enable PCI device and request
>> regions\n",
>> +   dev->minor);
>> return -EIO;
>> }
>>
>> @@ -666,7 +667,8 @@ static int me_attach_pci(struct comedi_device *dev,
>> struct pci_dev *pcidev)
>> ioremap(plx_regbase_tmp, plx_regbase_size_tmp);
>> dev_private->plx_regbase_size = plx_regbase_size_tmp;
>> if (!dev_private->plx_regbase) {
>> -   printk("comedi%d: Failed to remap I/O memory\n",
>> dev->minor);
>> +   dev_err(dev->class_dev,
>> +   "comedi%d: Failed to remap I/O memory\n",
>> dev->minor);
>> return -ENOMEM;
>> }
>>
>> @@ -676,11 +678,13 @@ static int me_attach_pci(struct comedi_device *dev,
>> struct pci_dev *pcidev)
>> swap_regbase_size_tmp = pci_resource_len(pcidev, 5);
>>
>> if (!swap_regbase_tmp)
>> -   printk(KERN_ERR "comedi%d: Swap not present\n",
>> dev->minor);
>> +   dev_err(dev->class_dev,
>> +   "comedi%d: Swap not present\n", dev->minor);
>>
>> /*-- Workaround start
>> ---*/
>> if (plx_regbase_tmp & 0x0080) {
>> -   printk(KERN_ERR "comedi%d: PLX-Bug detected\n",
>> dev->minor);
>> +   dev_err(dev->class_dev,
>> +   "comedi%d: PLX-Bug detected\n", dev->minor);
>>
>> if (swap_regbase_tmp) {
>> regbase_tmp = plx_regbase_tmp;
>> @@ -716,8 +720,8 @@ static int me_attach_pci(struct comedi_device *dev,
>> struct pci_dev *pcidev)
>> dev_private->me_regbase_size = me_regbase_size_tmp;
>> dev_private->me_regbase = ioremap(me_regbase_tmp,
>> me_regbase_size_tmp);
>> if (!dev_private->me_regbase) {
>> -   printk(KERN_ERR "comedi%d: Failed to remap I/O memory\n",
>> -  dev->minor);
>> +   dev_err(dev->class_dev,
>> +   "comedi%d: Failed to remap I/O memory\n",
>> dev->minor);
>> return -ENOMEM;
>> }
>
>
> And the same sort of thing for all of those.

Ian-san,

Thank you for pointing out my mistakes.
I will try to fix it.


-- 

Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] Fix line over 80 character issue and space before tabs issue in trace.h

2012-10-02 Thread Toshiaki Yamane
On Tue, Oct 2, 2012 at 9:23 PM, Dan Carpenter  wrote:
> On Tue, Oct 02, 2012 at 08:54:48PM +0900, YAMANE Toshiaki wrote:
>> fixed some checkpatch warnings.
>>
>> -WARNING: line over 80 characters
>> -WARNING: please, no space before tabs
>>
>
> These looked nicer in the original, sorry.

I will destroy this patch series.
thanks.


YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] Add parenthesis to macros with complex values in trace.h

2012-10-02 Thread Toshiaki Yamane
On Tue, Oct 2, 2012 at 9:21 PM, Dan Carpenter  wrote:
> On Tue, Oct 02, 2012 at 08:54:28PM +0900, YAMANE Toshiaki wrote:
>> fixed some checkpatch below error.
>> -ERROR: Macros with complex values should be enclosed in parenthesis
>>
>> Signed-off-by: Toshiaki Yamane 
>> ---
>>  drivers/staging/rts_pstor/trace.h |4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/rts_pstor/trace.h 
>> b/drivers/staging/rts_pstor/trace.h
>> index 740999c..a34493c 100644
>> --- a/drivers/staging/rts_pstor/trace.h
>> +++ b/drivers/staging/rts_pstor/trace.h
>> @@ -78,8 +78,8 @@ do {   
>>  \
>>   goto label;
>>  \
>>  } while (0)
>>  #else
>> -#define TRACE_RET(chip, ret) return ret
>> -#define TRACE_GOTO(chip, label)  goto label
>> +#define TRACE_RET(chip, ret) return(ret)
>> +#define TRACE_GOTO(chip, label)  goto(label)
>
> This will cause a compile error.
>
> There is no need to do this, checkpatch.pl is wrong here.

I will destroy this patch series.
thanks.


YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] Fix trailing whitespace in trace.h

2012-10-02 Thread Toshiaki Yamane
On Tue, Oct 2, 2012 at 9:12 PM, Andy Shevchenko
 wrote:
> On Tue, 2012-10-02 at 20:53 +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch error.
>>
>> -ERROR: trailing whitespace
>>
>> Signed-off-by: Toshiaki Yamane 
>> ---
>>  drivers/staging/rts_pstor/trace.h |2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/rts_pstor/trace.h 
>> b/drivers/staging/rts_pstor/trace.h
>> index cf60a1b..740999c 100644
>> --- a/drivers/staging/rts_pstor/trace.h
>> +++ b/drivers/staging/rts_pstor/trace.h
>> @@ -39,7 +39,7 @@ static inline char *filename(char *path)
>>   while (*ptr != '\0') {
>>   if ((*ptr == '\\') || (*ptr == '/'))
>>   path = ptr + 1;
>> -
>> +
>>   ptr++;
>>   }
>
> For me it seems total filename() function could be squeezed to just 
> strrchr(path, '/') + 1;
> Moreover there is already basename() in the lib/dynamic_debug.c you
> could rename, export and reuse.

I will destroy this patch series.
thanks.


YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging/rts_pstor: Use pr_ or dev_ printks in rtsx.c

2012-09-16 Thread Toshiaki Yamane
fixed some checkpatch warnings.
-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
-WARNING: quoted string split across lines

And added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/rtsx.c |  106 --
 1 file changed, 57 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c
index 5fb05a2..213829e 100644
--- a/drivers/staging/rts_pstor/rtsx.c
+++ b/drivers/staging/rts_pstor/rtsx.c
@@ -20,6 +20,8 @@
  *   No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -170,14 +172,14 @@ static int queuecommand_lck(struct scsi_cmnd *srb,
 
/* check for state-transition errors */
if (chip->srb != NULL) {
-   printk(KERN_ERR "Error in %s: chip->srb = %p\n",
+   dev_err(&dev->pci->dev, "Error in %s: chip->srb = %p\n",
__func__, chip->srb);
return SCSI_MLQUEUE_HOST_BUSY;
}
 
/* fail the command if we are disconnecting */
if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) {
-   printk(KERN_INFO "Fail command during disconnect\n");
+   dev_info(&dev->pci->dev, "Fail command during disconnect\n");
srb->result = DID_NO_CONNECT << 16;
done(srb);
return 0;
@@ -204,14 +206,14 @@ static int command_abort(struct scsi_cmnd *srb)
struct rtsx_dev *dev = host_to_rtsx(host);
struct rtsx_chip *chip = dev->chip;
 
-   printk(KERN_INFO "%s called\n", __func__);
+   dev_info(&dev->pci->dev, "%s called\n", __func__);
 
scsi_lock(host);
 
/* Is this command still active? */
if (chip->srb != srb) {
scsi_unlock(host);
-   printk(KERN_INFO "-- nothing to abort\n");
+   dev_info(&dev->pci->dev, "-- nothing to abort\n");
return FAILED;
}
 
@@ -230,8 +232,9 @@ static int command_abort(struct scsi_cmnd *srb)
 static int device_reset(struct scsi_cmnd *srb)
 {
int result = 0;
+   struct rtsx_dev *dev = host_to_rtsx(srb->device->host);
 
-   printk(KERN_INFO "%s called\n", __func__);
+   dev_info(&dev->pci->dev, "%s called\n", __func__);
 
return result < 0 ? FAILED : SUCCESS;
 }
@@ -240,8 +243,9 @@ static int device_reset(struct scsi_cmnd *srb)
 static int bus_reset(struct scsi_cmnd *srb)
 {
int result = 0;
+   struct rtsx_dev *dev = host_to_rtsx(srb->device->host);
 
-   printk(KERN_INFO "%s called\n", __func__);
+   dev_info(&dev->pci->dev, "%s called\n", __func__);
 
return result < 0 ? FAILED : SUCCESS;
 }
@@ -303,14 +307,15 @@ static int rtsx_acquire_irq(struct rtsx_dev *dev)
 {
struct rtsx_chip *chip = dev->chip;
 
-   printk(KERN_INFO "%s: chip->msi_en = %d, pci->irq = %d\n",
-   __func__, chip->msi_en, dev->pci->irq);
+   dev_info(&dev->pci->dev, "%s: chip->msi_en = %d, pci->irq = %d\n",
+__func__, chip->msi_en, dev->pci->irq);
 
if (request_irq(dev->pci->irq, rtsx_interrupt,
chip->msi_en ? 0 : IRQF_SHARED,
CR_DRIVER_NAME, dev)) {
-   printk(KERN_ERR "rtsx: unable to grab IRQ %d, "
-  "disabling device\n", dev->pci->irq);
+   dev_err(&dev->pci->dev,
+   "rtsx: unable to grab IRQ %d, disabling device\n",
+   dev->pci->irq);
return -1;
}
 
@@ -347,10 +352,10 @@ static int rtsx_suspend(struct pci_dev *pci, pm_message_t 
state)
struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci);
struct rtsx_chip *chip;
 
-   printk(KERN_INFO "Ready to suspend\n");
+   dev_info(&dev->pci->dev, "Ready to suspend\n");
 
if (!dev) {
-   printk(KERN_ERR "Invalid memory\n");
+   dev_err(&dev->pci->dev, "Invalid memory\n");
return 0;
}
 
@@ -386,10 +391,10 @@ static int rtsx_resume(struct pci_dev *pci)
struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci);
struct rtsx_chip *chip;
 
-   printk(KERN_INFO "Ready to resume\n");
+   dev_info(&dev->pci->dev, "Ready to resume\n");
 
if (!dev) {
-   printk(KERN_ERR "Invalid memory\n");
+   dev_err(&dev->pci

Re: [PATCH 1/2] staging/vme: Use pr_ printks in vme_user.c

2012-09-12 Thread Toshiaki Yamane
On Wed, Sep 12, 2012 at 4:08 AM, Greg Kroah-Hartman
 wrote:
> On Tue, Sep 11, 2012 at 04:16:14PM +0900, Toshiaki Yamane wrote:
>> The below checkpatch warnings was fixed,
>>
>> -WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
>> -WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
>> -WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
>
> A lot of these can be using dev_* instead of the pr_* functions, right?
> Please convert to using them wherever possible.
>
> Because of that, I can't take this patch, sorry.  Care to redo it?

Yes. Is this collect?

I must use dev_* procedure when the following conditions are met:
- If I have access to struct device object by the argument of the procedure
- Except for the right: struct net_device, etc.

Otherwise, I must use pr_* procedure.


Regards,

YAMANE Toshiaki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] staging/vme: Use dev_ printks in vme_user.c

2012-09-11 Thread Toshiaki Yamane
The below checkpatch warnings was fixed,

-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
-WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |   32 ++--
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 1e3311d..206c37b 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -172,7 +172,7 @@ static int vme_user_open(struct inode *inode, struct file 
*file)
mutex_lock(&image[minor].mutex);
/* Allow device to be opened if a resource is needed and allocated. */
if (minor < CONTROL_MINOR && image[minor].resource == NULL) {
-   printk(KERN_ERR "No resources allocated for device\n");
+   dev_err(image[minor].device, "No resources allocated for 
device\n");
err = -EINVAL;
goto err_res;
}
@@ -227,13 +227,13 @@ static ssize_t resource_to_user(int minor, char __user 
*buf, size_t count,
(unsigned long)copied);
if (retval != 0) {
copied = (copied - retval);
-   printk(KERN_INFO "User copy failed\n");
+   dev_info(image[minor].device, "User copy failed\n");
return -EINVAL;
}
 
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   dev_info(image[minor].device, "Currently don't support large 
transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_read to do the transfer */
@@ -267,7 +267,7 @@ static ssize_t resource_from_user(unsigned int minor, const 
char __user *buf,
image[minor].kern_buf, copied, *ppos);
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   dev_info(image[minor].device, "Currently don't support large 
transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_write to do the transfer */
@@ -288,7 +288,7 @@ static ssize_t buffer_to_user(unsigned int minor, char 
__user *buf,
retval = __copy_to_user(buf, image_ptr, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   dev_warn(image[minor].device, "Partial copy to userspace\n");
} else
retval = count;
 
@@ -307,7 +307,7 @@ static ssize_t buffer_from_user(unsigned int minor, const 
char __user *buf,
retval = __copy_from_user(image_ptr, buf, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   dev_warn(image[minor].device, "Partial copy to userspace\n");
} else
retval = count;
 
@@ -478,7 +478,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_from_user(&irq_req, argp,
sizeof(struct vme_irq_id));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from 
userspace\n");
+   dev_warn(image[minor].device, "Partial copy 
from userspace\n");
return -EFAULT;
}
 
@@ -505,8 +505,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_to_user(argp, &master,
sizeof(struct vme_master));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy to "
-   "userspace\n");
+   dev_warn(image[minor].device, "Partial copy to 
userspace\n");
return -EFAULT;
}
 
@@ -517,8 +516,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
 
copied = copy_from_user(&master, argp, sizeof(master));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from "
-   "userspace\n");
+

[PATCH 1/2] staging/vme: Use pr_ printks in vme_user.c

2012-09-11 Thread Toshiaki Yamane
The below checkpatch warnings was fixed,

-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

and added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |   37 ++--
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 0170788..1e3311d 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -629,11 +631,10 @@ static int __init vme_user_init(void)
 {
int retval = 0;
 
-   printk(KERN_INFO "VME User Space Access Driver\n");
+   pr_info("VME User Space Access Driver\n");
 
if (bus_num == 0) {
-   printk(KERN_ERR "%s: No cards, skipping registration\n",
-   driver_name);
+   pr_err("No cards, skipping registration\n");
retval = -ENODEV;
goto err_nocard;
}
@@ -642,8 +643,8 @@ static int __init vme_user_init(void)
 * in future revisions if that ever becomes necessary.
 */
if (bus_num > VME_USER_BUS_MAX) {
-   printk(KERN_ERR "%s: Driver only able to handle %d buses\n",
-   driver_name, VME_USER_BUS_MAX);
+   pr_err("Driver only able to handle %d buses\n",
+  VME_USER_BUS_MAX);
bus_num = VME_USER_BUS_MAX;
}
 
@@ -683,8 +684,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 
/* Save pointer to the bridge device */
if (vme_user_bridge != NULL) {
-   printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
-   driver_name);
+   pr_err("Driver can only be loaded for 1 device\n");
err = -EINVAL;
goto err_dev;
}
@@ -707,8 +707,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS,
driver_name);
if (err) {
-   printk(KERN_WARNING "%s: Error getting Major Number %d for "
-   "driver.\n", driver_name, VME_MAJOR);
+   pr_warn("Error getting Major Number %d for driver.\n",
+   VME_MAJOR);
goto err_region;
}
 
@@ -718,7 +718,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
vme_user_cdev->owner = THIS_MODULE;
err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
if (err) {
-   printk(KERN_WARNING "%s: cdev_all failed\n", driver_name);
+   pr_warn("cdev_all failed\n");
goto err_char;
}
 
@@ -732,16 +732,14 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
image[i].resource = vme_slave_request(vme_user_bridge,
VME_A24, VME_SCT);
if (image[i].resource == NULL) {
-   printk(KERN_WARNING "Unable to allocate slave "
-   "resource\n");
+   pr_warn("Unable to allocate slave resource\n");
goto err_slave;
}
image[i].size_buf = PCI_BUF_SIZE;
image[i].kern_buf = vme_alloc_consistent(image[i].resource,
image[i].size_buf, &image[i].pci_buf);
if (image[i].kern_buf == NULL) {
-   printk(KERN_WARNING "Unable to allocate memory for "
-   "buffer\n");
+   pr_warn("Unable to allocate memory for buffer\n");
image[i].pci_buf = 0;
vme_slave_free(image[i].resource);
err = -ENOMEM;
@@ -758,15 +756,13 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
image[i].resource = vme_master_request(vme_user_bridge,
VME_A32, VME_SCT, VME_D32);
if (image[i].resource == NULL) {
-   printk(KERN_WARNING "Unable to allocate master "
-   "resource\n");
+   pr_warn("Unable to allocate master resource\n");
goto err_master;
}
image[i].size_buf = PCI_BUF_SIZE;
image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
if (image[i].kern_buf == NULL) {
-   p

[PATCH] staging/rts_pstor: remove braces {} in rtsx_scsi.c

2012-09-08 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/rtsx_scsi.c |  403 ++---
 1 file changed, 168 insertions(+), 235 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx_scsi.c 
b/drivers/staging/rts_pstor/rtsx_scsi.c
index f2e5842..4f6b00a 100644
--- a/drivers/staging/rts_pstor/rtsx_scsi.c
+++ b/drivers/staging/rts_pstor/rtsx_scsi.c
@@ -135,9 +135,9 @@ void scsi_show_command(struct scsi_cmnd *srb)
default: what = "(unknown command)"; unknown_cmd = 1; break;
}
 
-   if (srb->cmnd[0] != TEST_UNIT_READY) {
+   if (srb->cmnd[0] != TEST_UNIT_READY)
RTSX_DEBUGP("Command %s (%d bytes)\n", what, srb->cmd_len);
-   }
+
if (unknown_cmd) {
RTSX_DEBUGP("");
for (i = 0; i < srb->cmd_len && i < 16; i++)
@@ -317,11 +317,11 @@ static int inquiry(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
};
 
if (CHECK_LUN_MODE(chip, SD_MS_2LUN)) {
-   if (chip->lun2card[lun] == SD_CARD) {
+   if (chip->lun2card[lun] == SD_CARD)
inquiry_string = inquiry_sd;
-   } else {
+   else
inquiry_string = inquiry_ms;
-   }
+
} else if (CHECK_LUN_MODE(chip, SD_MS_1LUN)) {
inquiry_string = inquiry_sdms;
} else {
@@ -329,9 +329,8 @@ static int inquiry(struct scsi_cmnd *srb, struct rtsx_chip 
*chip)
}
 
buf = vmalloc(scsi_bufflen(srb));
-   if (buf == NULL) {
+   if (buf == NULL)
TRACE_RET(chip, TRANSPORT_ERROR);
-   }
 
 #ifdef SUPPORT_MAGIC_GATE
if ((chip->mspro_formatter_enable) &&
@@ -340,23 +339,21 @@ static int inquiry(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
if (chip->mspro_formatter_enable)
 #endif
{
-   if (!card || (card == MS_CARD)) {
+   if (!card || (card == MS_CARD))
pro_formatter_flag = 1;
-   }
}
 
if (pro_formatter_flag) {
-   if (scsi_bufflen(srb) < 56) {
+   if (scsi_bufflen(srb) < 56)
sendbytes = (unsigned char)(scsi_bufflen(srb));
-   } else {
+   else
sendbytes = 56;
-   }
+
} else {
-   if (scsi_bufflen(srb) < 36) {
+   if (scsi_bufflen(srb) < 36)
sendbytes = (unsigned char)(scsi_bufflen(srb));
-   } else {
+   else
sendbytes = 36;
-   }
}
 
if (sendbytes > 8) {
@@ -371,9 +368,8 @@ static int inquiry(struct scsi_cmnd *srb, struct rtsx_chip 
*chip)
}
 
if (pro_formatter_flag) {
-   if (sendbytes > 36) {
+   if (sendbytes > 36)
memcpy(buf + 36, formatter_inquiry_str, sendbytes - 36);
-   }
}
 
scsi_set_resid(srb, 0);
@@ -467,9 +463,8 @@ static int request_sense(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
buf = vmalloc(scsi_bufflen(srb));
-   if (buf == NULL) {
+   if (buf == NULL)
TRACE_RET(chip, TRANSPORT_ERROR);
-   }
 
tmp = (unsigned char *)sense;
memcpy(buf, tmp, scsi_bufflen(srb));
@@ -494,15 +489,15 @@ static void ms_mode_sense(struct rtsx_chip *chip, u8 cmd,
 
if (cmd == MODE_SENSE) {
sys_info_offset = 8;
-   if (data_size > 0x68) {
+   if (data_size > 0x68)
data_size = 0x68;
-   }
+
buf[i++] = 0x67;  /* Mode Data Length */
} else {
sys_info_offset = 12;
-   if (data_size > 0x6C) {
+   if (data_size > 0x6C)
data_size = 0x6C;
-   }
+
buf[i++] = 0x00;  /* Mode Data Length (MSB) */
buf[i++] = 0x6A;  /* Mode Data Length (LSB) */
}
@@ -520,11 +515,11 @@ static void ms_mode_sense(struct rtsx_chip *chip, u8 cmd,
}
 
/* WP */
-   if (check_card_wp(chip, lun)) {
+   if (check_card_wp(chip, lun))
buf[i++] = 0x80;
-   } else {
+   else
buf[i++] = 0x00;
-   }
+
} else {
buf[i++] = 0x00;/* MediaType */
buf[i++] = 0x00;/* WP */
@@ -545,11 +540,10 @@ static void ms_mode_sense(struct rtsx_chip *chip, u8 cmd,
if (data_size >= 11)
buf[i++] = 0x00;/* No Access Control */

[PATCH 57/57] staging/rts_pstor: remove braces {} in sd.c (release_sd_card)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index c1f293a..c6a581c 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -4552,19 +4552,16 @@ int release_sd_card(struct rtsx_chip *chip)
memset(sd_card->raw_scr, 0, 8);
 
retval = sd_power_off_card3v3(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (CHECK_PID(chip, 0x5209)) {
retval = sd_change_bank_voltage(chip, SD_IO_3V3);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
-   if (CHK_SD30_SPEED(sd_card)) {
+   if (CHK_SD30_SPEED(sd_card))
RTSX_WRITE_REG(chip, SD30_DRIVE_SEL, 0x07, 
chip->sd30_drive_sel_3v3);
-   }
 
RTSX_WRITE_REG(chip, OCPPARA2, SD_OCP_THD_MASK, 
chip->sd_400mA_ocp_thd);
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 56/57] staging/rts_pstor: remove braces {} in sd.c (sd_power_off_card3v3)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index cf054b6..c1f293a 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -4504,26 +4504,23 @@ int sd_power_off_card3v3(struct rtsx_chip *chip)
int retval;
 
retval = disable_card_clock(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_WRITE_REG(chip, CARD_OE, SD_OUTPUT_EN, 0);
 
if (!chip->ft2_fast_mode) {
retval = card_power_off(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
wait_timeout(50);
}
 
if (chip->asic_code) {
retval = sd_pull_ctl_disable(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
RTSX_WRITE_REG(chip, FPGA_PULL_CTL,
FPGA_SD_PULL_CTL_BIT | 0x20, FPGA_SD_PULL_CTL_BIT);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 55/57] staging/rts_pstor: remove braces {} in sd.c (sd_hw_rst)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 3fd1cce..cf054b6 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -4452,9 +4452,8 @@ int sd_hw_rst(struct scsi_cmnd *srb, struct rtsx_chip 
*chip)
switch (srb->cmnd[1] & 0x0F) {
case 0:
 #ifdef SUPPORT_SD_LOCK
-   if (0x64 == srb->cmnd[9]) {
+   if (0x64 == srb->cmnd[9])
sd_card->sd_lock_status |= SD_SDR_RST;
-   }
 #endif
retval = reset_sd_card(chip);
if (retval != STATUS_SUCCESS) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 54/57] staging/rts_pstor: remove braces {} in sd.c (sd_execute_write_data)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   90 
 1 file changed, 35 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 39f23f0..3fd1cce 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -4093,20 +4093,18 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 
cmd_idx = srb->cmnd[2] & 0x3F;
-   if (srb->cmnd[1] & 0x04) {
+   if (srb->cmnd[1] & 0x04)
send_cmd12 = 1;
-   }
-   if (srb->cmnd[1] & 0x02) {
+
+   if (srb->cmnd[1] & 0x02)
standby = 1;
-   }
-   if (srb->cmnd[1] & 0x01) {
+
+   if (srb->cmnd[1] & 0x01)
acmd = 1;
-   }
 
data_len = ((u32)srb->cmnd[7] << 16) | ((u32)srb->cmnd[8] << 8) | 
srb->cmnd[9];
arg = ((u32)srb->cmnd[3] << 24) | ((u32)srb->cmnd[4] << 16) |
@@ -4127,75 +4125,66 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
sd_card->last_rsp_type = rsp_type;
 
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 
 #ifdef SUPPORT_SD_LOCK
if ((sd_card->sd_lock_status & SD_LOCK_1BIT_MODE) == 0) {
if (CHK_MMC_8BIT(sd_card)) {
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, 
SD_BUS_WIDTH_8);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
+
} else if (CHK_SD(sd_card) || CHK_MMC_4BIT(sd_card)) {
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, 
SD_BUS_WIDTH_4);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
}
}
 #else
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, SD_BUS_WIDTH_4);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 #endif
 
if (data_len < 512) {
retval = ext_sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, data_len,
SD_RSP_TYPE_R1, NULL, 0, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Write_Cmd_Failed);
-   }
}
 
if (standby) {
retval = sd_select_card(chip, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Write_Cmd_Failed);
-   }
}
 
if (acmd) {
retval = ext_sd_send_cmd_get_rsp(chip, APP_CMD, 
sd_card->sd_addr,
SD_RSP_TYPE_R1, NULL, 0, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Write_Cmd_Failed);
-   }
}
 
retval = ext_sd_send_cmd_get_rsp(chip, cmd_idx, arg, rsp_type,
sd_card->rsp, rsp_len, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Write_Cmd_Failed);
-   }
 
if (data_len <= 512) {
u16 i;
u8 *buf;
 
buf = kmalloc(data_len, GFP_KERNEL);
-   if (buf == NULL) {
+   if (buf == NULL)
TRACE_RET(chip, TRANSPORT_ERROR);
-   }
 
rtsx_stor_get_xfer_buf(buf, data_len, srb);
 
 #ifdef SUPPORT_SD_LOCK
-   if (cmd_idx == LOCK_UNLOCK) {
+   if (cmd_idx == LOCK_UNLOCK)
lock_cmd_type = buf[0] & 0x0F;
-   }
 #endif
 
if (data_len > 256) {
@@ -4287,11 +4276,11 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
rtsx_init_cmd(chip);
-   if (CHECK_PID(chip, 0x5209)) {
+   if (CHECK_PID(chip, 0x5209))
rtsx_add_

[PATCH 53/57] staging/rts_pstor: remove braces {} in sd.c (sd_execute_read_data)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   71 +++-
 1 file changed, 27 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index ccd6f88..39f23f0 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3872,20 +3872,18 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 
cmd_idx = srb->cmnd[2] & 0x3F;
-   if (srb->cmnd[1] & 0x04) {
+   if (srb->cmnd[1] & 0x04)
send_cmd12 = 1;
-   }
-   if (srb->cmnd[1] & 0x02) {
+
+   if (srb->cmnd[1] & 0x02)
standby = 1;
-   }
-   if (srb->cmnd[1] & 0x01) {
+
+   if (srb->cmnd[1] & 0x01)
acmd = 1;
-   }
 
data_len = ((u32)srb->cmnd[7] << 16) | ((u32)srb->cmnd[8] << 8) | 
srb->cmnd[9];
 
@@ -3897,19 +3895,17 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
sd_card->last_rsp_type = rsp_type;
 
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 
 #ifdef SUPPORT_SD_LOCK
if ((sd_card->sd_lock_status & SD_LOCK_1BIT_MODE) == 0) {
-   if (CHK_MMC_8BIT(sd_card)) {
+   if (CHK_MMC_8BIT(sd_card))
bus_width = SD_BUS_WIDTH_8;
-   } else if (CHK_SD(sd_card) || CHK_MMC_4BIT(sd_card)) {
+   else if (CHK_SD(sd_card) || CHK_MMC_4BIT(sd_card))
bus_width = SD_BUS_WIDTH_4;
-   } else {
+   else
bus_width = SD_BUS_WIDTH_1;
-   }
} else {
bus_width = SD_BUS_WIDTH_4;
}
@@ -3921,24 +3917,21 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
if (data_len < 512) {
retval = ext_sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, data_len,
SD_RSP_TYPE_R1, NULL, 0, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Read_Cmd_Failed);
-   }
}
 
if (standby) {
retval = sd_select_card(chip, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Read_Cmd_Failed);
-   }
}
 
if (acmd) {
retval = ext_sd_send_cmd_get_rsp(chip, APP_CMD, 
sd_card->sd_addr,
SD_RSP_TYPE_R1, NULL, 0, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Read_Cmd_Failed);
-   }
}
 
if (data_len <= 512) {
@@ -3957,9 +3950,8 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
cmd[4] = srb->cmnd[6];
 
buf = kmalloc(data_len, GFP_KERNEL);
-   if (buf == NULL) {
+   if (buf == NULL)
TRACE_RET(chip, TRANSPORT_ERROR);
-   }
 
retval = sd_read_data(chip, SD_TM_NORMAL_READ, cmd, 5, byte_cnt,
   blk_cnt, bus_width, buf, data_len, 2000);
@@ -4014,56 +4006,48 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
retval = ext_sd_get_rsp(chip, rsp_len, sd_card->rsp, rsp_type);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Read_Cmd_Failed);
-   }
 
if (standby) {
retval = sd_select_card(chip, 1);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Read_Cmd_Failed);
-   }
}
 
if (send_cmd12) {
retval = ext_sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION,
0, SD_RSP_TYPE_R1b, NULL, 0, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Read_Cmd_Failed);
-   }
}
 
if (data_len < 512) {
retval = ext_sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, 0x200,
   

[PATCH 52/57] staging/rts_pstor: remove braces {} in sd.c (sd_execute_no_data)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   41 +++-
 1 file changed, 15 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 23090cb..ccd6f88 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3757,9 +3757,8 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 
if (sd_card->pre_cmd_err) {
sd_card->pre_cmd_err = 0;
@@ -3768,12 +3767,11 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
cmd_idx = srb->cmnd[2] & 0x3F;
-   if (srb->cmnd[1] & 0x02) {
+   if (srb->cmnd[1] & 0x02)
standby = 1;
-   }
-   if (srb->cmnd[1] & 0x01) {
+
+   if (srb->cmnd[1] & 0x01)
acmd = 1;
-   }
 
arg = ((u32)srb->cmnd[3] << 24) | ((u32)srb->cmnd[4] << 16) |
((u32)srb->cmnd[5] << 8) | srb->cmnd[6];
@@ -3786,64 +3784,56 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
sd_card->last_rsp_type = rsp_type;
 
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 
 #ifdef SUPPORT_SD_LOCK
if ((sd_card->sd_lock_status & SD_LOCK_1BIT_MODE) == 0) {
if (CHK_MMC_8BIT(sd_card)) {
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, 
SD_BUS_WIDTH_8);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
+
} else if (CHK_SD(sd_card) || CHK_MMC_4BIT(sd_card)) {
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, 
SD_BUS_WIDTH_4);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
}
}
 #else
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, SD_BUS_WIDTH_4);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
-   }
 #endif
 
if (standby) {
retval = sd_select_card(chip, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
-   }
}
 
if (acmd) {
retval = ext_sd_send_cmd_get_rsp(chip, APP_CMD, 
sd_card->sd_addr,
SD_RSP_TYPE_R1, NULL, 0, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
-   }
}
 
retval = ext_sd_send_cmd_get_rsp(chip, cmd_idx, arg, rsp_type,
sd_card->rsp, rsp_len, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
-   }
 
if (standby) {
retval = sd_select_card(chip, 1);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
-   }
}
 
 #ifdef SUPPORT_SD_LOCK
retval = sd_update_lock_status(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
-   }
 #endif
 
scsi_set_resid(srb, 0);
@@ -3854,9 +3844,8 @@ SD_Execute_Cmd_Failed:
set_sense_type(chip, lun, SENSE_TYPE_NO_SENSE);
release_sd_card(chip);
do_reset_sd_card(chip);
-   if (!(chip->card_ready & SD_CARD)) {
+   if (!(chip->card_ready & SD_CARD))
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_NOT_PRESENT);
-   }
 
TRACE_RET(chip, TRANSPORT_FAILED);
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 51/57] staging/rts_pstor: remove braces {} in sd.c (get_rsp_type)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index b352f20..23090cb 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3706,9 +3706,8 @@ int sd_pass_thru_mode(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
 
 static inline int get_rsp_type(struct scsi_cmnd *srb, u8 *rsp_type, int 
*rsp_len)
 {
-   if (!rsp_type || !rsp_len) {
+   if (!rsp_type || !rsp_len)
return STATUS_FAIL;
-   }
 
switch (srb->cmnd[10]) {
case 0x03:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 50/57] staging/rts_pstor: remove braces {} in sd.c (sd_pass_thru_mode)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 9091700..b352f20 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3690,9 +3690,8 @@ int sd_pass_thru_mode(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
}
 
buf[5] = (1 == CHK_SD(sd_card)) ?  0x01 : 0x02;
-   if (chip->card_wp & SD_CARD) {
+   if (chip->card_wp & SD_CARD)
buf[5] |= 0x80;
-   }
 
buf[6] = (u8)(sd_card->sd_addr >> 16);
buf[7] = (u8)(sd_card->sd_addr >> 24);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 49/57] staging/rts_pstor: remove braces {} in sd.c (ext_sd_get_rsp)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 4168af6..9091700 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3599,29 +3599,27 @@ int ext_sd_get_rsp(struct rtsx_chip *chip, int len, u8 
*rsp, u8 rsp_type)
int retval, rsp_len;
u16 reg_addr;
 
-   if (rsp_type == SD_RSP_TYPE_R0) {
+   if (rsp_type == SD_RSP_TYPE_R0)
return STATUS_SUCCESS;
-   }
 
rtsx_init_cmd(chip);
 
if (rsp_type == SD_RSP_TYPE_R2) {
-   for (reg_addr = PPBUF_BASE2; reg_addr < PPBUF_BASE2 + 16; 
reg_addr++) {
+   for (reg_addr = PPBUF_BASE2; reg_addr < PPBUF_BASE2 + 16; 
reg_addr++)
rtsx_add_cmd(chip, READ_REG_CMD, reg_addr, 0xFF, 0);
-   }
+
rsp_len = 17;
} else if (rsp_type != SD_RSP_TYPE_R0) {
-   for (reg_addr = REG_SD_CMD0; reg_addr <= REG_SD_CMD4; 
reg_addr++) {
+   for (reg_addr = REG_SD_CMD0; reg_addr <= REG_SD_CMD4; 
reg_addr++)
rtsx_add_cmd(chip, READ_REG_CMD, reg_addr, 0xFF, 0);
-   }
+
rsp_len = 6;
}
rtsx_add_cmd(chip, READ_REG_CMD, REG_SD_CMD5, 0xFF, 0);
 
retval = rtsx_send_cmd(chip, SD_CARD, 100);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (rsp) {
int min_len = (rsp_len < len) ? rsp_len : len;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 48/57] staging/rts_pstor: remove braces {} in sd.c (ext_sd_send_cmd_get_rsp)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   33 +
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index f2580a4..4168af6 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3481,9 +3481,8 @@ int ext_sd_send_cmd_get_rsp(struct rtsx_chip *chip, u8 
cmd_idx,
 
RTSX_DEBUGP("EXT SD/MMC CMD %d\n", cmd_idx);
 
-   if (rsp_type == SD_RSP_TYPE_R1b) {
+   if (rsp_type == SD_RSP_TYPE_R1b)
timeout = 3000;
-   }
 
 RTY_SEND_CMD:
 
@@ -3503,14 +3502,14 @@ RTY_SEND_CMD:
rtsx_add_cmd(chip, CHECK_REG_CMD, REG_SD_TRANSFER, SD_TRANSFER_END, 
SD_TRANSFER_END);
 
if (rsp_type == SD_RSP_TYPE_R2) {
-   for (reg_addr = PPBUF_BASE2; reg_addr < PPBUF_BASE2 + 16; 
reg_addr++) {
+   for (reg_addr = PPBUF_BASE2; reg_addr < PPBUF_BASE2 + 16; 
reg_addr++)
rtsx_add_cmd(chip, READ_REG_CMD, reg_addr, 0, 0);
-   }
+
stat_idx = 17;
} else if (rsp_type != SD_RSP_TYPE_R0) {
-   for (reg_addr = REG_SD_CMD0; reg_addr <= REG_SD_CMD4; 
reg_addr++) {
+   for (reg_addr = REG_SD_CMD0; reg_addr <= REG_SD_CMD4; 
reg_addr++)
rtsx_add_cmd(chip, READ_REG_CMD, reg_addr, 0, 0);
-   }
+
stat_idx = 6;
}
rtsx_add_cmd(chip, READ_REG_CMD, REG_SD_CMD5, 0, 0);
@@ -3524,9 +3523,8 @@ RTY_SEND_CMD:
 
if (rsp_type & SD_WAIT_BUSY_END) {
retval = sd_check_data0_status(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval);
-   }
} else {
sd_set_err_code(chip, SD_TO_ERR);
}
@@ -3534,9 +3532,8 @@ RTY_SEND_CMD:
TRACE_RET(chip, STATUS_FAIL);
}
 
-   if (rsp_type == SD_RSP_TYPE_R0) {
+   if (rsp_type == SD_RSP_TYPE_R0)
return STATUS_SUCCESS;
-   }
 
ptr = rtsx_get_cmd_data(chip) + 1;
 
@@ -3565,9 +3562,8 @@ RTY_SEND_CMD:
if ((cmd_idx == SELECT_CARD) || (cmd_idx == APP_CMD) ||
(cmd_idx == SEND_STATUS) || (cmd_idx == 
STOP_TRANSMISSION)) {
if ((cmd_idx != STOP_TRANSMISSION) && (special_check == 0)) {
-   if (ptr[1] & 0x80) {
+   if (ptr[1] & 0x80)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 #ifdef SUPPORT_SD_LOCK
if (ptr[1] & 0x7D)
@@ -3577,26 +3573,23 @@ RTY_SEND_CMD:
{
TRACE_RET(chip, STATUS_FAIL);
}
-   if (ptr[2] & 0xF8) {
+   if (ptr[2] & 0xF8)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (cmd_idx == SELECT_CARD) {
if (rsp_type == SD_RSP_TYPE_R2) {
-   if ((ptr[3] & 0x1E) != 0x04) {
+   if ((ptr[3] & 0x1E) != 0x04)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
} else if (rsp_type == SD_RSP_TYPE_R0) {
-   if ((ptr[3] & 0x1E) != 0x03) {
+   if ((ptr[3] & 0x1E) != 0x03)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
}
}
 
-   if (rsp && rsp_len) {
+   if (rsp && rsp_len)
memcpy(rsp, ptr, rsp_len);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 47/57] staging/rts_pstor: remove braces {} in sd.c (sd_rw)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   26 ++
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index d0f5512..f2580a4 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3224,11 +3224,10 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip 
*chip, u32 start_sector, u16 s
}
}
 
-   if (!CHK_SD_HCXC(sd_card) && !CHK_MMC_SECTOR_MODE(sd_card)) {
+   if (!CHK_SD_HCXC(sd_card) && !CHK_MMC_SECTOR_MODE(sd_card))
data_addr = start_sector << 9;
-   } else {
+   else
data_addr = start_sector;
-   }
 
sd_clr_err_code(chip);
 
@@ -3283,21 +3282,19 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip 
*chip, u32 start_sector, u16 s
 
rtsx_add_cmd(chip, WRITE_REG_CMD, CARD_DATA_SOURCE, 0x01, RING_BUFFER);
 
-   if (CHK_MMC_8BIT(sd_card)) {
+   if (CHK_MMC_8BIT(sd_card))
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG1, 0x03, 
SD_BUS_WIDTH_8);
-   } else if (CHK_MMC_4BIT(sd_card) || CHK_SD(sd_card)) {
+   else if (CHK_MMC_4BIT(sd_card) || CHK_SD(sd_card))
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG1, 0x03, 
SD_BUS_WIDTH_4);
-   } else {
+   else
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG1, 0x03, 
SD_BUS_WIDTH_1);
-   }
 
if (sd_card->seq_mode) {
cfg2 = SD_NO_CALCULATE_CRC7 | SD_CHECK_CRC16 | 
SD_NO_WAIT_BUSY_END |
SD_NO_CHECK_CRC7 | SD_RSP_LEN_0;
if (CHECK_PID(chip, 0x5209)) {
-   if (!CHK_SD30_SPEED(sd_card)) {
+   if (!CHK_SD30_SPEED(sd_card))
cfg2 |= SD_NO_CHECK_WAIT_CRC_TO;
-   }
}
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG2, 0xFF, cfg2);
 
@@ -3327,9 +3324,8 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, 
u32 start_sector, u16 s
cfg2 = SD_CALCULATE_CRC7 | SD_CHECK_CRC16 | 
SD_NO_WAIT_BUSY_END |
SD_CHECK_CRC7 | SD_RSP_LEN_6;
if (CHECK_PID(chip, 0x5209)) {
-   if (!CHK_SD30_SPEED(sd_card)) {
+   if (!CHK_SD30_SPEED(sd_card))
cfg2 |= SD_NO_CHECK_WAIT_CRC_TO;
-   }
}
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG2, 0xFF, 
cfg2);
 
@@ -3370,9 +3366,8 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, 
u32 start_sector, u16 s
cfg2 = SD_NO_CALCULATE_CRC7 | SD_CHECK_CRC16 | 
SD_NO_WAIT_BUSY_END |
SD_NO_CHECK_CRC7 | SD_RSP_LEN_0;
if (CHECK_PID(chip, 0x5209)) {
-   if (!CHK_SD30_SPEED(sd_card)) {
+   if (!CHK_SD30_SPEED(sd_card))
cfg2 |= SD_NO_CHECK_WAIT_CRC_TO;
-   }
}
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG2, 0xFF, 
cfg2);
 
@@ -3397,11 +3392,10 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip 
*chip, u32 start_sector, u16 s
 
sd_card->seq_mode = 0;
 
-   if (retval == -ETIMEDOUT) {
+   if (retval == -ETIMEDOUT)
err = STATUS_TIMEDOUT;
-   } else {
+   else
err = STATUS_FAIL;
-   }
 
rtsx_read_register(chip, REG_SD_STAT1, &stat);
rtsx_clear_sd_error(chip);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 46/57] staging/rts_pstor: remove braces {} in sd.c (sd_auto_tune_clock)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 272b2d4..d0f5512 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3151,9 +3151,8 @@ static inline int sd_auto_tune_clock(struct rtsx_chip 
*chip)
int retval;
 
if (chip->asic_code) {
-   if (sd_card->sd_clock > 30) {
+   if (sd_card->sd_clock > 30)
sd_card->sd_clock -= 20;
-   }
} else {
switch (sd_card->sd_clock) {
case CLK_200:
@@ -3186,9 +3185,8 @@ static inline int sd_auto_tune_clock(struct rtsx_chip 
*chip)
}
 
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 45/57] staging/rts_pstor: remove braces {} in sd.c (sd_stop_seq_mode)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 918caf5..272b2d4 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3127,19 +3127,18 @@ void sd_stop_seq_mode(struct rtsx_chip *chip)
 
if (sd_card->seq_mode) {
retval = sd_switch_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
return;
-   }
 
retval = sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION, 0,
SD_RSP_TYPE_R1b, NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
sd_set_err_code(chip, SD_STS_ERR);
-   }
+
retval = sd_wait_state_data_ready(chip, 0x08, 1, 1000);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
sd_set_err_code(chip, SD_STS_ERR);
-   }
+
sd_card->seq_mode = 0;
 
rtsx_write_register(chip, RBCTL, RB_FLUSH, RB_FLUSH);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 44/57] staging/rts_pstor: remove braces {} in sd.c (wait_data_buf_ready)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index f109bbc..918caf5 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3106,9 +3106,8 @@ static int wait_data_buf_ready(struct rtsx_chip *chip)
 
retval = sd_send_cmd_get_rsp(chip, SEND_STATUS,
sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (sd_card->sd_data_buf_ready) {
return sd_send_cmd_get_rsp(chip, SEND_STATUS,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 43/57] staging/rts_pstor: remove braces {} in sd.c (reset_mmc_only)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index f0b11a4..f109bbc 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3060,33 +3060,29 @@ static int reset_mmc_only(struct rtsx_chip *chip)
chip->capacity[chip->card2lun[SD_CARD]] = sd_card->capacity = 0;
 
retval = enable_card_clock(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_init_power(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = reset_mmc(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
RTSX_WRITE_REG(chip, REG_SD_BYTE_CNT_L, 0xFF, 0);
RTSX_WRITE_REG(chip, REG_SD_BYTE_CNT_H, 0xFF, 2);
 
chip->capacity[chip->card2lun[SD_CARD]] = sd_card->capacity;
 
retval = sd_set_init_para(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_DEBUGP("In reset_mmc_only, sd_card->sd_type = 0x%x\n", 
sd_card->sd_type);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 42/57] staging/rts_pstor: remove braces {} in sd.c (reset_sd_card)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index c117dc4..f0b11a4 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2961,36 +2961,31 @@ int reset_sd_card(struct rtsx_chip *chip)
chip->capacity[chip->card2lun[SD_CARD]] = 0;
 
retval = enable_card_clock(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (chip->ignore_sd && CHK_SDIO_EXIST(chip) && !CHK_SDIO_IGNORED(chip)) 
{
if (chip->asic_code) {
retval = sd_pull_ctl_enable(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
retval = rtsx_write_register(chip, FPGA_PULL_CTL,
 FPGA_SD_PULL_CTL_BIT | 
0x20, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
retval = card_share_mode(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
chip->sd_io = 1;
TRACE_RET(chip, STATUS_FAIL);
}
 
retval = sd_init_power(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (chip->sd_ctl & RESET_MMC_FIRST) {
retval = reset_mmc(chip);
@@ -3029,18 +3024,17 @@ int reset_sd_card(struct rtsx_chip *chip)
}
 
retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
RTSX_WRITE_REG(chip, REG_SD_BYTE_CNT_L, 0xFF, 0);
RTSX_WRITE_REG(chip, REG_SD_BYTE_CNT_H, 0xFF, 2);
 
chip->capacity[chip->card2lun[SD_CARD]] = sd_card->capacity;
 
retval = sd_set_init_para(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_DEBUGP("sd_card->sd_type = 0x%x\n", sd_card->sd_type);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 41/57] staging/rts_pstor: remove braces {} in sd.c (reset_mmc)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   52 +++-
 1 file changed, 19 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index dfb728b..c117dc4 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2804,17 +2804,15 @@ static int reset_mmc(struct rtsx_chip *chip)
 
 Switch_Fail:
retval = sd_prepare_reset(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval);
-   }
 
SET_MMC(sd_card);
 
 RTY_MMC_RST:
retval = sd_send_cmd_get_rsp(chip, GO_IDLE_STATE, 0, SD_RSP_TYPE_R0, 
NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
   TRACE_RET(chip, STATUS_FAIL);
-   }
 
do {
if (detect_card_cd(chip, SD_CARD) != STATUS_SUCCESS) {
@@ -2848,56 +2846,47 @@ RTY_MMC_RST:
i++;
} while (!(rsp[1] & 0x80) && (i < 255));
 
-   if (i == 255) {
+   if (i == 255)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
-   if ((rsp[1] & 0x60) == 0x40) {
+   if ((rsp[1] & 0x60) == 0x40)
SET_MMC_SECTOR_MODE(sd_card);
-   } else {
+   else
CLR_MMC_SECTOR_MODE(sd_card);
-   }
 
retval = sd_send_cmd_get_rsp(chip, ALL_SEND_CID, 0, SD_RSP_TYPE_R2, 
NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
sd_card->sd_addr = 0x0010;
retval = sd_send_cmd_get_rsp(chip, SET_RELATIVE_ADDR, sd_card->sd_addr, 
SD_RSP_TYPE_R6, rsp, 5);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_check_csd(chip, 1);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
spec_ver = (sd_card->raw_csd[0] & 0x3C) >> 2;
 
retval = sd_select_card(chip, 1);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, 0x200, SD_RSP_TYPE_R1, 
NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
 #ifdef SUPPORT_SD_LOCK
 MMC_UNLOCK_ENTRY:
retval = sd_update_lock_status(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 #endif
 
retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
chip->card_bus_width[chip->card2lun[SD_CARD]] = 1;
 
@@ -2914,22 +2903,20 @@ MMC_UNLOCK_ENTRY:
}
}
 
-   if (CHK_MMC_SECTOR_MODE(sd_card) && (sd_card->capacity == 0)) {
+   if (CHK_MMC_SECTOR_MODE(sd_card) && (sd_card->capacity == 0))
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (switch_ddr && CHK_MMC_DDR52(sd_card)) {
retval = sd_set_init_para(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = mmc_ddr_tuning(chip);
if (retval != STATUS_SUCCESS) {
retval = sd_init_power(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
switch_ddr = 0;
TRACE_GOTO(chip, Switch_Fail);
}
@@ -2939,9 +2926,9 @@ MMC_UNLOCK_ENTRY:
retval = sd_read_lba0(chip);
if (retval != STATUS_SUCCESS) {
retval = sd_init_power(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
switch

[PATCH 40/57] staging/rts_pstor: remove braces {} in sd.c (mmc_switch_timing_bus)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index ff8eb96..dfb728b 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2724,11 +2724,10 @@ static int mmc_switch_timing_bus(struct rtsx_chip 
*chip, int switch_ddr)
card_type_mask = 0x03;
}
 #else
-   if (chip->sd_ctl & SUPPORT_MMC_DDR_MODE) {
+   if (chip->sd_ctl & SUPPORT_MMC_DDR_MODE)
card_type_mask = 0x07;
-   } else {
+   else
card_type_mask = 0x03;
-   }
 #endif
} else {
card_type_mask = 0x03;
@@ -2738,11 +2737,10 @@ static int mmc_switch_timing_bus(struct rtsx_chip 
*chip, int switch_ddr)
u8 rsp[5];
 
if (card_type & 0x04) {
-   if (switch_ddr) {
+   if (switch_ddr)
SET_MMC_DDR52(sd_card);
-   } else {
+   else
SET_MMC_52M(sd_card);
-   }
} else if (card_type & 0x02) {
SET_MMC_52M(sd_card);
} else {
@@ -2751,16 +2749,14 @@ static int mmc_switch_timing_bus(struct rtsx_chip 
*chip, int switch_ddr)
 
retval = sd_send_cmd_get_rsp(chip, SWITCH,
0x03B90100, SD_RSP_TYPE_R1b, rsp, 5);
-   if ((retval != STATUS_SUCCESS) || (rsp[4] & MMC_SWITCH_ERR)) {
+   if ((retval != STATUS_SUCCESS) || (rsp[4] & MMC_SWITCH_ERR))
CLR_MMC_HS(sd_card);
-   }
}
 
sd_choose_proper_clock(chip);
retval = switch_clock(chip, sd_card->sd_clock);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
/* Test Bus Procedure */
retval = mmc_test_switch_bus(chip, MMC_8BIT_BUS);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 39/57] staging/rts_pstor: remove braces {} in sd.c (mmc_test_switch_bus)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   32 +---
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 23fe9f2..ff8eb96 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2544,9 +2544,8 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 
width)
int len;
 
retval = sd_send_cmd_get_rsp(chip, BUSTEST_W, 0, SD_RSP_TYPE_R1, NULL, 
0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, SWITCH_FAIL);
-   }
 
if (width == MMC_8BIT_BUS) {
buf[0] = 0x55;
@@ -2575,9 +2574,8 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 
width)
rtsx_read_register(chip, REG_SD_STAT1, &val1);
rtsx_read_register(chip, REG_SD_STAT2, &val2);
rtsx_clear_sd_error(chip);
-   if ((val1 & 0xE0) || val2) {
+   if ((val1 & 0xE0) || val2)
TRACE_RET(chip, SWITCH_ERR);
-   }
} else {
rtsx_clear_sd_error(chip);
rtsx_write_register(chip, REG_SD_CFG3, 0x02, 0);
@@ -2597,11 +2595,10 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, 
u8 width)
 
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CMD0, 0xFF, 0x40 | BUSTEST_R);
 
-   if (width == MMC_8BIT_BUS) {
+   if (width == MMC_8BIT_BUS)
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BYTE_CNT_L, 0xFF, 
0x08);
-   } else {
+   else
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BYTE_CNT_L, 0xFF, 
0x04);
-   }
 
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BLOCK_CNT_L, 0xFF, 1);
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BLOCK_CNT_H, 0xFF, 0);
@@ -2614,9 +2611,8 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 
width)
rtsx_add_cmd(chip, CHECK_REG_CMD, REG_SD_TRANSFER, SD_TRANSFER_END, 
SD_TRANSFER_END);
 
rtsx_add_cmd(chip, READ_REG_CMD, PPBUF_BASE2, 0, 0);
-   if (width == MMC_8BIT_BUS) {
+   if (width == MMC_8BIT_BUS)
rtsx_add_cmd(chip, READ_REG_CMD, PPBUF_BASE2 + 1, 0, 0);
-   }
 
retval = rtsx_send_cmd(chip, SD_CARD, 100);
if (retval < 0) {
@@ -2632,15 +2628,14 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, 
u8 width)
u8 rsp[5];
u32 arg;
 
-   if (CHK_MMC_DDR52(sd_card)) {
+   if (CHK_MMC_DDR52(sd_card))
arg = 0x03B70600;
-   } else {
+   else
arg = 0x03B70200;
-   }
+
retval = sd_send_cmd_get_rsp(chip, SWITCH, arg, 
SD_RSP_TYPE_R1b, rsp, 5);
-   if ((retval == STATUS_SUCCESS) && !(rsp[4] & 
MMC_SWITCH_ERR)) {
+   if ((retval == STATUS_SUCCESS) && !(rsp[4] & 
MMC_SWITCH_ERR))
return SWITCH_SUCCESS;
-   }
}
} else {
RTSX_DEBUGP("BUSTEST_R [4bits]: 0x%02x\n", ptr[0]);
@@ -2648,15 +2643,14 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, 
u8 width)
u8 rsp[5];
u32 arg;
 
-   if (CHK_MMC_DDR52(sd_card)) {
+   if (CHK_MMC_DDR52(sd_card))
arg = 0x03B70500;
-   } else {
+   else
arg = 0x03B70100;
-   }
+
retval = sd_send_cmd_get_rsp(chip, SWITCH, arg, 
SD_RSP_TYPE_R1b, rsp, 5);
-   if ((retval == STATUS_SUCCESS) && !(rsp[4] & 
MMC_SWITCH_ERR)) {
+   if ((retval == STATUS_SUCCESS) && !(rsp[4] & 
MMC_SWITCH_ERR))
return SWITCH_SUCCESS;
-   }
}
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 38/57] staging/rts_pstor: remove braces {} in sd.c (reset_sd)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |  114 
 1 file changed, 45 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index c9dc000..23fe9f2 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2216,14 +2216,12 @@ Switch_Fail:
 #endif
 
retval = sd_prepare_reset(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_dummy_clock(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (CHK_SDIO_EXIST(chip) && !CHK_SDIO_IGNORED(chip) && try_sdio) {
int rty_cnt = 0;
@@ -2257,9 +2255,8 @@ Switch_Fail:
/* Start Initialization Process of SD Card */
 RTY_SD_RST:
retval = sd_send_cmd_get_rsp(chip, GO_IDLE_STATE, 0, SD_RSP_TYPE_R0, 
NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
   TRACE_RET(chip, STATUS_FAIL);
-   }
 
wait_timeout(20);
 
@@ -2286,9 +2283,8 @@ RTY_SD_RST:
voltage = SUPPORT_VOLTAGE;
 
retval = sd_send_cmd_get_rsp(chip, GO_IDLE_STATE, 0, 
SD_RSP_TYPE_R0, NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
   TRACE_RET(chip, STATUS_FAIL);
-   }
 
wait_timeout(20);
}
@@ -2302,42 +2298,38 @@ RTY_SD_RST:
}
 
j++;
-   if (j < 3) {
+   if (j < 3)
goto RTY_SD_RST;
-   } else {
+   else
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
retval = sd_send_cmd_get_rsp(chip, SD_APP_OP_COND, voltage, 
SD_RSP_TYPE_R3, rsp, 5);
if (retval != STATUS_SUCCESS) {
k++;
-   if (k < 3) {
+   if (k < 3)
goto RTY_SD_RST;
-   } else {
+   else
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
i++;
wait_timeout(20);
} while (!(rsp[1] & 0x80) && (i < 255));
 
-   if (i == 255) {
+   if (i == 255)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (hi_cap_flow) {
-   if (rsp[1] & 0x40) {
+   if (rsp[1] & 0x40)
SET_SD_HCXC(sd_card);
-   } else {
+   else
CLR_SD_HCXC(sd_card);
-   }
-   if (CHECK_PID(chip, 0x5209) && CHK_SD_HCXC(sd_card) && 
!sd20_mode) {
+
+   if (CHECK_PID(chip, 0x5209) && CHK_SD_HCXC(sd_card) && 
!sd20_mode)
support_1v8 = (rsp[1] & 0x01) ? 1 : 0;
-   } else {
+   else
support_1v8 = 0;
-   }
} else {
CLR_SD_HCXC(sd_card);
support_1v8 = 0;
@@ -2346,46 +2338,39 @@ RTY_SD_RST:
 
if (support_1v8) {
retval = sd_voltage_switch(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
retval = sd_send_cmd_get_rsp(chip, ALL_SEND_CID, 0, SD_RSP_TYPE_R2, 
NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
for (i = 0; i < 3; i++) {
retval = sd_send_cmd_get_rsp(chip, SEND_RELATIVE_ADDR, 0, 
SD_RSP_TYPE_R6, rsp, 5);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
sd_card->sd_addr = (u32)rsp[1] << 24;
sd_card->sd_addr += (u32)rsp[2] << 16;
 
-   if (sd_card->sd_addr) {
+   if (sd_card->sd_addr)
break;
-   }
}
 
retval = sd_check_csd(chip, 1);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_select_card(chip, 1);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)

[PATCH 37/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_wp_state)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 7318349..c9dc000 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2154,9 +2154,8 @@ static int sd_check_wp_state(struct rtsx_chip *chip)
 
retval = sd_send_cmd_get_rsp(chip, APP_CMD,
sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
cmd[0] = 0x40 | SD_STATUS;
cmd[1] = 0;
@@ -2184,9 +2183,8 @@ static int sd_check_wp_state(struct rtsx_chip *chip)
 
/* Check SD Machanical Write-Protect Switch */
val = rtsx_readl(chip, RTSX_BIPR);
-   if (val & SD_WRITE_PROTECT) {
+   if (val & SD_WRITE_PROTECT)
chip->card_wp |= SD_CARD;
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 36/57] staging/rts_pstor: remove braces {} in sd.c (sd_read_lba0)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 7be3805..7318349 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2126,13 +2126,12 @@ static int sd_read_lba0(struct rtsx_chip *chip)
if (CHK_SD(sd_card)) {
bus_width = SD_BUS_WIDTH_4;
} else {
-   if (CHK_MMC_8BIT(sd_card)) {
+   if (CHK_MMC_8BIT(sd_card))
bus_width = SD_BUS_WIDTH_8;
-   } else if (CHK_MMC_4BIT(sd_card)) {
+   else if (CHK_MMC_4BIT(sd_card))
bus_width = SD_BUS_WIDTH_4;
-   } else {
+   else
bus_width = SD_BUS_WIDTH_1;
-   }
}
 
retval = sd_read_data(chip, SD_TM_NORMAL_READ, cmd,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 35/57] staging/rts_pstor: remove braces {} in sd.c (sd_init_power)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   23 +--
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index fa8cc86..7be3805 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2050,42 +2050,37 @@ static int sd_init_power(struct rtsx_chip *chip)
 {
int retval;
 
-   if (CHECK_PID(chip, 0x5209)) {
+   if (CHECK_PID(chip, 0x5209))
RTSX_WRITE_REG(chip, PWR_GATE_CTRL, LDO3318_PWR_MASK, LDO_OFF);
-   }
 
retval = sd_power_off_card3v3(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
-   if (!chip->ft2_fast_mode) {
+   if (!chip->ft2_fast_mode)
wait_timeout(250);
-   }
 
retval = enable_card_clock(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (chip->asic_code) {
retval = sd_pull_ctl_enable(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
RTSX_WRITE_REG(chip, FPGA_PULL_CTL, FPGA_SD_PULL_CTL_BIT | 
0x20, 0);
}
 
if (chip->ft2_fast_mode) {
-   if (CHECK_PID(chip, 0x5209)) {
+   if (CHECK_PID(chip, 0x5209))
RTSX_WRITE_REG(chip, PWR_GATE_CTRL, LDO3318_PWR_MASK, 
LDO_ON);
-   }
+
} else {
retval = card_power_on(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
wait_timeout(260);
 
 #ifdef SUPPORT_OCP
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 34/57] staging/rts_pstor: remove braces {} in sd.c (sd_pull_ctl_enable)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 667e93d..fa8cc86 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2040,9 +2040,8 @@ int sd_pull_ctl_enable(struct rtsx_chip *chip)
}
 
retval = rtsx_send_cmd(chip, SD_CARD, 100);
-   if (retval < 0) {
+   if (retval < 0)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 33/57] staging/rts_pstor: remove braces {} in sd.c (sd_prepare_reset)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 5e4e007..667e93d 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1938,11 +1938,10 @@ static int sd_prepare_reset(struct rtsx_chip *chip)
struct sd_info *sd_card = &(chip->sd_card);
int retval;
 
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = 29;
-   } else {
+   else
sd_card->sd_clock = CLK_30;
-   }
 
sd_card->sd_type = 0;
sd_card->seq_mode = 0;
@@ -1958,9 +1957,8 @@ static int sd_prepare_reset(struct rtsx_chip *chip)
chip->sd_io = 0;
 
retval = sd_set_init_para(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval);
-   }
 
if (CHECK_PID(chip, 0x5209)) {
RTSX_WRITE_REG(chip, REG_SD_CFG1, 0xFF,
@@ -1974,9 +1972,8 @@ static int sd_prepare_reset(struct rtsx_chip *chip)
RTSX_WRITE_REG(chip, CARD_STOP, SD_STOP | SD_CLR_ERR, SD_STOP | 
SD_CLR_ERR);
 
retval = select_card(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 32/57] staging/rts_pstor: remove braces {} in sd.c (sd_switch_clock)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index c22689c..5e4e007 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1900,9 +1900,8 @@ int sd_switch_clock(struct rtsx_chip *chip)
int re_tuning = 0;
 
retval = select_card(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (CHECK_PID(chip, 0x5209) &&
(CHK_SD30_SPEED(sd_card) || CHK_MMC_DDR52(sd_card))) {
@@ -1913,26 +1912,22 @@ int sd_switch_clock(struct rtsx_chip *chip)
}
 
retval = switch_clock(chip, sd_card->sd_clock);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (re_tuning) {
if (CHK_SD(sd_card)) {
-   if (CHK_SD_DDR50(sd_card)) {
+   if (CHK_SD_DDR50(sd_card))
retval = sd_ddr_tuning(chip);
-   } else {
+   else
retval = sd_sdr_tuning(chip);
-   }
} else {
-   if (CHK_MMC_DDR52(sd_card)) {
+   if (CHK_MMC_DDR52(sd_card))
retval = mmc_ddr_tuning(chip);
-   }
}
 
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
return STATUS_SUCCESS;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 31/57] staging/rts_pstor: remove braces {} in sd.c (mmc_ddr_tuning)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 0871a5d..c22689c 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1872,26 +1872,22 @@ static int mmc_ddr_tuning(struct rtsx_chip *chip)
 
if (!(chip->sd_ctl & MMC_DDR_TX_PHASE_SET_BY_USER)) {
retval = sd_ddr_pre_tuning_tx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
retval = sd_change_phase(chip, (u8)chip->mmc_ddr_tx_phase, 
TUNE_TX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
retval = sd_tuning_rx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (!(chip->sd_ctl & MMC_DDR_TX_PHASE_SET_BY_USER)) {
retval = sd_tuning_tx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
return STATUS_SUCCESS;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 30/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_tuning)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index b623c9f..0871a5d 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1845,26 +1845,22 @@ static int sd_ddr_tuning(struct rtsx_chip *chip)
 
if (!(chip->sd_ctl & SD_DDR_TX_PHASE_SET_BY_USER)) {
retval = sd_ddr_pre_tuning_tx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
retval = sd_change_phase(chip, (u8)chip->sd_ddr_tx_phase, 
TUNE_TX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
retval = sd_tuning_rx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (!(chip->sd_ctl & SD_DDR_TX_PHASE_SET_BY_USER)) {
retval = sd_tuning_tx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
return STATUS_SUCCESS;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 29/57] staging/rts_pstor: remove braces {} in sd.c (sd_sdr_tuning)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 02139b4..b623c9f 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1829,14 +1829,12 @@ static int sd_sdr_tuning(struct rtsx_chip *chip)
int retval;
 
retval = sd_tuning_tx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_tuning_rx(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 28/57] staging/rts_pstor: remove braces {} in sd.c (sd_tuning_tx)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   24 ++--
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 9812c00..02139b4 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1779,17 +1779,16 @@ static int sd_tuning_tx(struct rtsx_chip *chip)
int (*tuning_cmd)(struct rtsx_chip *chip, u8 sample_point);
 
if (CHK_SD(sd_card)) {
-   if (CHK_SD_DDR50(sd_card)) {
+   if (CHK_SD_DDR50(sd_card))
tuning_cmd = sd_ddr_tuning_tx_cmd;
-   } else {
+   else
tuning_cmd = sd_sdr_tuning_tx_cmd;
-   }
+
} else {
-   if (CHK_MMC_DDR52(sd_card)) {
+   if (CHK_MMC_DDR52(sd_card))
tuning_cmd = sd_ddr_tuning_tx_cmd;
-   } else {
+   else
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
for (i = 0; i < 3; i++) {
@@ -1803,27 +1802,24 @@ static int sd_tuning_tx(struct rtsx_chip *chip)
}
 
retval = tuning_cmd(chip, (u8)j);
-   if (retval == STATUS_SUCCESS) {
+   if (retval == STATUS_SUCCESS)
raw_phase_map[i] |= 1 << j;
-   }
}
}
 
phase_map = raw_phase_map[0] & raw_phase_map[1] & raw_phase_map[2];
-   for (i = 0; i < 3; i++) {
+   for (i = 0; i < 3; i++)
RTSX_DEBUGP("TX raw_phase_map[%d] = 0x%08x\n", i, 
raw_phase_map[i]);
-   }
+
RTSX_DEBUGP("TX phase_map = 0x%08x\n", phase_map);
 
final_phase = sd_search_final_phase(chip, phase_map, TUNE_TX);
-   if (final_phase == 0xFF) {
+   if (final_phase == 0xFF)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_change_phase(chip, final_phase, TUNE_TX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 27/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_pre_tuning_tx)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index cb6ba17..9812c00 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1743,15 +1743,13 @@ static int sd_ddr_pre_tuning_tx(struct rtsx_chip *chip)
}
 
retval = sd_change_phase(chip, (u8)i, TUNE_TX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
continue;
-   }
 
retval = sd_send_cmd_get_rsp(chip, SEND_STATUS, 
sd_card->sd_addr,
SD_RSP_TYPE_R1, NULL, 0);
-   if ((retval == STATUS_SUCCESS) || !sd_check_err_code(chip, 
SD_RSP_TIMEOUT)) {
+   if ((retval == STATUS_SUCCESS) || !sd_check_err_code(chip, 
SD_RSP_TIMEOUT))
phase_map |= 1 << i;
-   }
}
 
RTSX_WRITE_REG(chip, SD_CFG3, SD_RSP_80CLK_TIMEOUT_EN, 0);
@@ -1759,14 +1757,12 @@ static int sd_ddr_pre_tuning_tx(struct rtsx_chip *chip)
RTSX_DEBUGP("DDR TX pre tune phase_map = 0x%08x\n", phase_map);
 
final_phase = sd_search_final_phase(chip, phase_map, TUNE_TX);
-   if (final_phase == 0xFF) {
+   if (final_phase == 0xFF)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_change_phase(chip, final_phase, TUNE_TX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_DEBUGP("DDR TX pre tune phase: %d\n", (int)final_phase);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 26/57] staging/rts_pstor: remove braces {} in sd.c (sd_tuning_rx)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   24 ++--
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 1dfabcf..cb6ba17 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1680,17 +1680,16 @@ static int sd_tuning_rx(struct rtsx_chip *chip)
int (*tuning_cmd)(struct rtsx_chip *chip, u8 sample_point);
 
if (CHK_SD(sd_card)) {
-   if (CHK_SD_DDR50(sd_card)) {
+   if (CHK_SD_DDR50(sd_card))
tuning_cmd = sd_ddr_tuning_rx_cmd;
-   } else {
+   else
tuning_cmd = sd_sdr_tuning_rx_cmd;
-   }
+
} else {
-   if (CHK_MMC_DDR52(sd_card)) {
+   if (CHK_MMC_DDR52(sd_card))
tuning_cmd = mmc_ddr_tunning_rx_cmd;
-   } else {
+   else
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
for (i = 0; i < 3; i++) {
@@ -1702,27 +1701,24 @@ static int sd_tuning_rx(struct rtsx_chip *chip)
}
 
retval = tuning_cmd(chip, (u8)j);
-   if (retval == STATUS_SUCCESS) {
+   if (retval == STATUS_SUCCESS)
raw_phase_map[i] |= 1 << j;
-   }
}
}
 
phase_map = raw_phase_map[0] & raw_phase_map[1] & raw_phase_map[2];
-   for (i = 0; i < 3; i++) {
+   for (i = 0; i < 3; i++)
RTSX_DEBUGP("RX raw_phase_map[%d] = 0x%08x\n", i, 
raw_phase_map[i]);
-   }
+
RTSX_DEBUGP("RX phase_map = 0x%08x\n", phase_map);
 
final_phase = sd_search_final_phase(chip, phase_map, TUNE_RX);
-   if (final_phase == 0xFF) {
+   if (final_phase == 0xFF)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
retval = sd_change_phase(chip, final_phase, TUNE_RX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 25/57] staging/rts_pstor: remove braces {} in sd.c (sd_search_final_phase)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 24daabb..1dfabcf 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1572,11 +1572,10 @@ static u8 sd_search_final_phase(struct rtsx_chip *chip, 
u32 phase_map, u8 tune_d
u8 final_phase = 0xFF;
 
if (phase_map == 0x) {
-   if (tune_dir == TUNE_RX) {
+   if (tune_dir == TUNE_RX)
final_phase = (u8)chip->sd_default_rx_phase;
-   } else {
+   else
final_phase = (u8)chip->sd_default_tx_phase;
-   }
 
goto Search_Finish;
}
@@ -1617,9 +1616,9 @@ static u8 sd_search_final_phase(struct rtsx_chip *chip, 
u32 phase_map, u8 tune_d
path[0].start = path[cont_path_cnt - 1].start - MAX_PHASE - 1;
path[0].len += path[cont_path_cnt - 1].len;
path[0].mid = path[0].start + path[0].len / 2;
-   if (path[0].mid < 0) {
+   if (path[0].mid < 0)
path[0].mid += MAX_PHASE + 1;
-   }
+
cont_path_cnt--;
}
 
@@ -1647,11 +1646,10 @@ static u8 sd_search_final_phase(struct rtsx_chip *chip, 
u32 phase_map, u8 tune_d
int temp_final_phase =
path[final_path_idx].end - (max_len - 
(6 + temp_mid));
 
-   if (temp_final_phase < 0) {
+   if (temp_final_phase < 0)
final_phase = (u8)(temp_final_phase + 
MAX_PHASE + 1);
-   } else {
+   else
final_phase = (u8)temp_final_phase;
-   }
}
} else if (CHK_SD_SDR50(sd_card)) {
if (max_len > 12) {
@@ -1659,11 +1657,10 @@ static u8 sd_search_final_phase(struct rtsx_chip *chip, 
u32 phase_map, u8 tune_d
int temp_final_phase =
path[final_path_idx].end - (max_len - 
(3 + temp_mid));
 
-   if (temp_final_phase < 0) {
+   if (temp_final_phase < 0)
final_phase = (u8)(temp_final_phase + 
MAX_PHASE + 1);
-   } else {
+   else
final_phase = (u8)temp_final_phase;
-   }
}
}
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 24/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_tuning_tx_cmd)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 6088d93..24daabb 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1522,26 +1522,23 @@ static int sd_ddr_tuning_tx_cmd(struct rtsx_chip *chip, 
u8 sample_point)
u8 cmd[5], bus_width;
 
retval = sd_change_phase(chip, sample_point, TUNE_TX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if (CHK_SD(sd_card)) {
bus_width = SD_BUS_WIDTH_4;
} else {
-   if (CHK_MMC_8BIT(sd_card)) {
+   if (CHK_MMC_8BIT(sd_card))
bus_width = SD_BUS_WIDTH_8;
-   } else if (CHK_MMC_4BIT(sd_card)) {
+   else if (CHK_MMC_4BIT(sd_card))
bus_width = SD_BUS_WIDTH_4;
-   } else {
+   else
bus_width = SD_BUS_WIDTH_1;
-   }
}
 
retval = sd_wait_state_data_ready(chip, 0x08, 1, 1000);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_WRITE_REG(chip, SD_CFG3, SD_RSP_80CLK_TIMEOUT_EN, 
SD_RSP_80CLK_TIMEOUT_EN);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 23/57] staging/rts_pstor: remove braces {} in sd.c (sd_sdr_tuning_tx_cmd)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index bc91ff3..6088d93 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1496,9 +1496,8 @@ static int sd_sdr_tuning_tx_cmd(struct rtsx_chip *chip, 
u8 sample_point)
int retval;
 
retval = sd_change_phase(chip, sample_point, TUNE_TX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_WRITE_REG(chip, SD_CFG3, SD_RSP_80CLK_TIMEOUT_EN, 
SD_RSP_80CLK_TIMEOUT_EN);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 22/57] staging/rts_pstor: remove braces {} in sd.c (mmc_ddr_tunning_rx_cmd)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 74c84e8..bc91ff3 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1459,18 +1459,16 @@ static int mmc_ddr_tunning_rx_cmd(struct rtsx_chip 
*chip, u8 sample_point)
int retval;
u8 cmd[5], bus_width;
 
-   if (CHK_MMC_8BIT(sd_card)) {
+   if (CHK_MMC_8BIT(sd_card))
bus_width = SD_BUS_WIDTH_8;
-   } else if (CHK_MMC_4BIT(sd_card)) {
+   else if (CHK_MMC_4BIT(sd_card))
bus_width = SD_BUS_WIDTH_4;
-   } else {
+   else
bus_width = SD_BUS_WIDTH_1;
-   }
 
retval = sd_change_phase(chip, sample_point, TUNE_RX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_DEBUGP("mmc ddr tuning rx\n");
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 21/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_tuning_rx_cmd)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 73ed6d8..74c84e8 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1426,16 +1426,14 @@ static int sd_ddr_tuning_rx_cmd(struct rtsx_chip *chip, 
u8 sample_point)
u8 cmd[5];
 
retval = sd_change_phase(chip, sample_point, TUNE_RX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
RTSX_DEBUGP("sd ddr tuning rx\n");
 
retval = sd_send_cmd_get_rsp(chip, APP_CMD, sd_card->sd_addr, 
SD_RSP_TYPE_R1, NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
cmd[0] = 0x40 | SD_STATUS;
cmd[1] = 0;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 20/57] staging/rts_pstor: remove braces {} in sd.c (sd_sdr_tuning_rx_cmd)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 558f25b3..73ed6d8 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1398,9 +1398,8 @@ static int sd_sdr_tuning_rx_cmd(struct rtsx_chip *chip, 
u8 sample_point)
u8 cmd[5];
 
retval = sd_change_phase(chip, sample_point, TUNE_RX);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
cmd[0] = 0x40 | SEND_TUNING_PATTERN;
cmd[1] = 0;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 19/57] staging/rts_pstor: remove braces {} in sd.c (sd_switch_function)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   48 ++--
 1 file changed, 21 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index c90deb6..558f25b3 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1224,9 +1224,8 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 
bus_width)
/* Get supported functions */
retval = sd_check_switch_mode(chip, SD_CHECK_MODE,
NO_ARGUMENT, NO_ARGUMENT, bus_width);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
sd_card->func_group1_mask &= ~(sd_card->sd_switch_fail);
 
@@ -1255,9 +1254,9 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 
bus_width)
break;
 
case HS_SUPPORT:
-   if (sd_card->func_group1_mask & HS_SUPPORT_MASK) {
+   if (sd_card->func_group1_mask & HS_SUPPORT_MASK)
func_to_switch = HS_SUPPORT;
-   }
+
break;
 
default:
@@ -1265,9 +1264,9 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 
bus_width)
}
 
 
-   if (func_to_switch) {
+   if (func_to_switch)
break;
-   }
+
}
RTSX_DEBUGP("SD_FUNC_GROUP_1: func_to_switch = 0x%02x", func_to_switch);
 
@@ -1296,23 +1295,21 @@ static int sd_switch_function(struct rtsx_chip *chip, 
u8 bus_width)
TRACE_RET(chip, STATUS_FAIL);
}
 
-   if (func_to_switch == SDR104_SUPPORT) {
+   if (func_to_switch == SDR104_SUPPORT)
SET_SD_SDR104(sd_card);
-   } else if (func_to_switch == DDR50_SUPPORT) {
+   else if (func_to_switch == DDR50_SUPPORT)
SET_SD_DDR50(sd_card);
-   } else if (func_to_switch == SDR50_SUPPORT) {
+   else if (func_to_switch == SDR50_SUPPORT)
SET_SD_SDR50(sd_card);
-   } else {
+   else
SET_SD_HS(sd_card);
-   }
}
 
if (CHK_SD_DDR50(sd_card)) {
RTSX_WRITE_REG(chip, SD_PUSH_POINT_CTL, 0x06, 0x04);
retval = sd_set_sample_push_timing(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
if (!func_to_switch || (func_to_switch == HS_SUPPORT)) {
@@ -1328,36 +1325,35 @@ static int sd_switch_function(struct rtsx_chip *chip, 
u8 bus_width)
for (i = 0; i < 4; i++) {
switch ((u8)(chip->sd_current_prior >> (i*8))) {
case CURRENT_LIMIT_800:
-   if (sd_card->func_group4_mask & CURRENT_LIMIT_800_MASK) 
{
+   if (sd_card->func_group4_mask & CURRENT_LIMIT_800_MASK)
func_to_switch = CURRENT_LIMIT_800;
-   }
+
break;
 
case CURRENT_LIMIT_600:
-   if (sd_card->func_group4_mask & CURRENT_LIMIT_600_MASK) 
{
+   if (sd_card->func_group4_mask & CURRENT_LIMIT_600_MASK)
func_to_switch = CURRENT_LIMIT_600;
-   }
+
break;
 
case CURRENT_LIMIT_400:
-   if (sd_card->func_group4_mask & CURRENT_LIMIT_400_MASK) 
{
+   if (sd_card->func_group4_mask & CURRENT_LIMIT_400_MASK)
func_to_switch = CURRENT_LIMIT_400;
-   }
+
break;
 
case CURRENT_LIMIT_200:
-   if (sd_card->func_group4_mask & CURRENT_LIMIT_200_MASK) 
{
+   if (sd_card->func_group4_mask & CURRENT_LIMIT_200_MASK)
func_to_switch = CURRENT_LIMIT_200;
-   }
+
break;
 
default:
continue;
}
 
-   if (func_to_switch != 0xFF) {
+   if (func_to_switch != 0xFF)
break;
-   }
}
 
RTSX_DEBUGP("SD_FUNC_GROUP_4: func_to_switch = 0x%02x", func_to_switch);
@@ -1365,16 +1361,14 @@ static int sd_switch_function(struct rtsx_chip *chip, 
u8 bus_width)
if (func_

[PATCH 18/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_switch)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 36b7f49..c90deb6 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1208,9 +1208,8 @@ static int sd_check_switch(struct rtsx_chip *chip,
wait_timeout(20);
}
 
-   if (!switch_good) {
+   if (!switch_good)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/57] staging/rts_pstor: remove braces {} in sd.c (downgrade_switch_mode)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 2b7a4e1..36b7f49 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1160,13 +1160,12 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, 
u8 mode,
 static u8 downgrade_switch_mode(u8 func_group, u8 func_to_switch)
 {
if (func_group == SD_FUNC_GROUP_1) {
-   if (func_to_switch > HS_SUPPORT) {
+   if (func_to_switch > HS_SUPPORT)
func_to_switch--;
-   }
+
} else if (func_group == SD_FUNC_GROUP_4) {
-   if (func_to_switch > CURRENT_LIMIT_200) {
+   if (func_to_switch > CURRENT_LIMIT_200)
func_to_switch--;
-   }
}
 
return func_to_switch;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_switch_mode)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index aae9c72..2b7a4e1 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1141,13 +1141,12 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, 
u8 mode,
 */
u16 cc = ((u16)buf[0] << 8) | buf[1];
RTSX_DEBUGP("Maximum current consumption: %dmA\n", cc);
-   if ((cc == 0) || (cc > 800)) {
+   if ((cc == 0) || (cc > 800))
TRACE_RET(chip, STATUS_FAIL);
-   }
+
retval = sd_query_switch_result(chip, func_group, 
func_to_switch, buf, 64);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
if ((cc > 400) || (func_to_switch > CURRENT_LIMIT_400)) {
RTSX_WRITE_REG(chip, OCPPARA2, SD_OCP_THD_MASK, 
chip->sd_800mA_ocp_thd);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 15/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_spec)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 67420f4..aae9c72 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -949,9 +949,8 @@ static int sd_check_spec(struct rtsx_chip *chip, u8 
bus_width)
u8 cmd[5], buf[8];
 
retval = sd_send_cmd_get_rsp(chip, APP_CMD, sd_card->sd_addr, 
SD_RSP_TYPE_R1, NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
cmd[0] = 0x40 | SEND_SCR;
cmd[1] = 0;
@@ -967,9 +966,8 @@ static int sd_check_spec(struct rtsx_chip *chip, u8 
bus_width)
 
memcpy(sd_card->raw_scr, buf, 8);
 
-   if ((buf[0] & 0x0F) == 0) {
+   if ((buf[0] & 0x0F) == 0)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 13/57] staging/rts_pstor: remove braces {} in sd.c (sd_voltage_switch)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index ed95a1a..6badbc4 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -802,9 +802,8 @@ static int sd_voltage_switch(struct rtsx_chip *chip)
RTSX_WRITE_REG(chip, SD_BUS_STAT, SD_CLK_TOGGLE_EN | SD_CLK_FORCE_STOP, 
SD_CLK_TOGGLE_EN);
 
retval = sd_send_cmd_get_rsp(chip, VOLTAGE_SWITCH, 0, SD_RSP_TYPE_R1, 
NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
udelay(chip->sd_voltage_switch_delay);
 
@@ -816,9 +815,9 @@ static int sd_voltage_switch(struct rtsx_chip *chip)
 
RTSX_WRITE_REG(chip, SD_BUS_STAT, 0xFF, SD_CLK_FORCE_STOP);
retval = sd_change_bank_voltage(chip, SD_IO_1V8);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
wait_timeout(50);
 
RTSX_WRITE_REG(chip, SD_BUS_STAT, 0xFF, SD_CLK_TOGGLE_EN);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 14/57] staging/rts_pstor: remove braces {} in sd.c (sd_change_phase)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 6badbc4..67420f4 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -866,9 +866,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 
sample_point, u8 tune_dir)
if (tune_dir == TUNE_RX) {
SD_VP_CTL = SD_VPRX_CTL;
SD_DCMPS_CTL = SD_DCMPS_RX_CTL;
-   if (CHK_SD_DDR50(sd_card)) {
+   if (CHK_SD_DDR50(sd_card))
ddr_rx = 1;
-   }
} else {
SD_VP_CTL = SD_VPTX_CTL;
SD_DCMPS_CTL = SD_DCMPS_TX_CTL;
@@ -905,23 +904,22 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 
sample_point, u8 tune_dir)
rtsx_add_cmd(chip, WRITE_REG_CMD, SD_DCMPS_CTL, DCMPS_CHANGE, 
DCMPS_CHANGE);
rtsx_add_cmd(chip, CHECK_REG_CMD, SD_DCMPS_CTL, 
DCMPS_CHANGE_DONE, DCMPS_CHANGE_DONE);
retval = rtsx_send_cmd(chip, SD_CARD, 100);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, Fail);
-   }
 
val = *rtsx_get_cmd_data(chip);
-   if (val & DCMPS_ERROR) {
+   if (val & DCMPS_ERROR)
TRACE_GOTO(chip, Fail);
-   }
-   if ((val & DCMPS_CURRENT_PHASE) != sample_point) {
+
+   if ((val & DCMPS_CURRENT_PHASE) != sample_point)
TRACE_GOTO(chip, Fail);
-   }
+
RTSX_WRITE_REG(chip, SD_DCMPS_CTL, DCMPS_CHANGE, 0);
-   if (ddr_rx) {
+   if (ddr_rx)
RTSX_WRITE_REG(chip, SD_VP_CTL, PHASE_CHANGE, 0);
-   } else {
+   else
RTSX_WRITE_REG(chip, CLK_CTL, CHANGE_CLK, 0);
-   }
+
udelay(50);
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/57] staging/rts_pstor: remove braces {} in sd.c (sd_change_bank_voltage)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 8228231..ed95a1a 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -774,18 +774,16 @@ static int sd_change_bank_voltage(struct rtsx_chip *chip, 
u8 voltage)
if (voltage == SD_IO_3V3) {
if (chip->asic_code) {
retval = rtsx_write_phy_register(chip, 0x08, 0x4FC0 | 
chip->phy_voltage);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
RTSX_WRITE_REG(chip, SD_PAD_CTL, SD_IO_USING_1V8, 0);
}
} else if (voltage == SD_IO_1V8) {
if (chip->asic_code) {
retval = rtsx_write_phy_register(chip, 0x08, 0x4C40 | 
chip->phy_voltage);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
RTSX_WRITE_REG(chip, SD_PAD_CTL, SD_IO_USING_1V8, 
SD_IO_USING_1V8);
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/57] staging/rts_pstor: remove braces {} in sd.c (sd_wait_state_data_ready)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 2ace2a0..8228231 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -757,13 +757,11 @@ static int sd_wait_state_data_ready(struct rtsx_chip 
*chip, u8 state, u8 data_re
for (i = 0; i < polling_cnt; i++) {
retval = sd_send_cmd_get_rsp(chip, SEND_STATUS,
 sd_card->sd_addr, SD_RSP_TYPE_R1, 
rsp, 5);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
-   if (((rsp[3] & 0x1E) == state) && ((rsp[3] & 0x01) == 
data_ready)) {
+   if (((rsp[3] & 0x1E) == state) && ((rsp[3] & 0x01) == 
data_ready))
return STATUS_SUCCESS;
-   }
}
 
TRACE_RET(chip, STATUS_FAIL);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/57] staging/rts_pstor: remove braces {} in sd.c (sd_update_lock_status)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 4b1763c..2ace2a0 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -731,21 +731,18 @@ static int sd_update_lock_status(struct rtsx_chip *chip)
u8 rsp[5];
 
retval = sd_send_cmd_get_rsp(chip, SEND_STATUS, sd_card->sd_addr, 
SD_RSP_TYPE_R1, rsp, 5);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
-   if (rsp[1] & 0x02) {
+   if (rsp[1] & 0x02)
sd_card->sd_lock_status |= SD_LOCKED;
-   } else {
+   else
sd_card->sd_lock_status &= ~SD_LOCKED;
-   }
 
RTSX_DEBUGP("sd_card->sd_lock_status = 0x%x\n", 
sd_card->sd_lock_status);
 
-   if (rsp[1] & 0x01) {
+   if (rsp[1] & 0x01)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 09/57] staging/rts_pstor: remove braces {} in sd.c (sd_select_card)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 89d0487..4b1763c 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -717,9 +717,8 @@ int sd_select_card(struct rtsx_chip *chip, int select)
}
 
retval = sd_send_cmd_get_rsp(chip, cmd_idx, addr, cmd_type, NULL, 0);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/57] staging/rts_pstor: remove braces {} in sd.c (sd_set_init_para)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 1af5210..89d0487 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -687,16 +687,14 @@ static int sd_set_init_para(struct rtsx_chip *chip)
int retval;
 
retval = sd_set_sample_push_timing(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
sd_choose_proper_clock(chip);
 
retval = switch_clock(chip, sd_card->sd_clock);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/57] staging/rts_pstor: remove braces {} in sd.c (sd_set_clock_divider)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 4021295..1af5210 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -668,13 +668,12 @@ static int sd_set_clock_divider(struct rtsx_chip *chip, 
u8 clk_div)
val = clk_div;
} else {
mask = 0x60;
-   if (clk_div == SD_CLK_DIVIDE_0) {
+   if (clk_div == SD_CLK_DIVIDE_0)
val = 0x00;
-   } else if (clk_div == SD_CLK_DIVIDE_128) {
+   else if (clk_div == SD_CLK_DIVIDE_128)
val = 0x40;
-   } else if (clk_div == SD_CLK_DIVIDE_256) {
+   else if (clk_div == SD_CLK_DIVIDE_256)
val = 0x20;
-   }
}
 
RTSX_WRITE_REG(chip, REG_SD_CFG1, mask, val);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/57] staging/rts_pstor: remove braces {} in sd.c (sd_choose_proper_clock)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   35 +--
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 28fc8a2..4021295 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -622,41 +622,40 @@ static void sd_choose_proper_clock(struct rtsx_chip *chip)
struct sd_info *sd_card = &(chip->sd_card);
 
if (CHK_SD_SDR104(sd_card)) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = chip->asic_sd_sdr104_clk;
-   } else {
+   else
sd_card->sd_clock = chip->fpga_sd_sdr104_clk;
-   }
+
} else if (CHK_SD_DDR50(sd_card)) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = chip->asic_sd_ddr50_clk;
-   } else {
+   else
sd_card->sd_clock = chip->fpga_sd_ddr50_clk;
-   }
+
} else if (CHK_SD_SDR50(sd_card)) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = chip->asic_sd_sdr50_clk;
-   } else {
+   else
sd_card->sd_clock = chip->fpga_sd_sdr50_clk;
-   }
+
} else if (CHK_SD_HS(sd_card)) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = chip->asic_sd_hs_clk;
-   } else {
+   else
sd_card->sd_clock = chip->fpga_sd_hs_clk;
-   }
+
} else if (CHK_MMC_52M(sd_card) || CHK_MMC_DDR52(sd_card)) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = chip->asic_mmc_52m_clk;
-   } else {
+   else
sd_card->sd_clock = chip->fpga_mmc_52m_clk;
-   }
+
} else if (CHK_MMC_26M(sd_card)) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = 48;
-   } else {
+   else
sd_card->sd_clock = CLK_50;
-   }
}
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/57] staging/rts_pstor: remove braces {} in sd.c (sd_set_sample_push_timing)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   31 +--
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 88163e1..28fc8a2 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -559,22 +559,21 @@ static int sd_set_sample_push_timing(struct rtsx_chip 
*chip)
CRC_FIX_CLK | SD30_VAR_CLK0 | 
SAMPLE_VAR_CLK1);
RTSX_WRITE_REG(chip, CLK_CTL, CLK_LOW_FREQ, 0);
 
-   if ((chip->sd_ctl & SD_PUSH_POINT_CTL_MASK) == 
SD_PUSH_POINT_AUTO) {
+   if ((chip->sd_ctl & SD_PUSH_POINT_CTL_MASK) == 
SD_PUSH_POINT_AUTO)
val = SD20_TX_NEG_EDGE;
-   } else if ((chip->sd_ctl & SD_PUSH_POINT_CTL_MASK) == 
SD_PUSH_POINT_DELAY) {
+   else if ((chip->sd_ctl & SD_PUSH_POINT_CTL_MASK) == 
SD_PUSH_POINT_DELAY)
val = SD20_TX_14_AHEAD;
-   } else {
+   else
val = SD20_TX_NEG_EDGE;
-   }
+
RTSX_WRITE_REG(chip, SD_PUSH_POINT_CTL, 
SD20_TX_SEL_MASK, val);
 
if ((chip->sd_ctl & SD_SAMPLE_POINT_CTL_MASK) == 
SD_SAMPLE_POINT_AUTO) {
if (chip->asic_code) {
-   if (CHK_SD_HS(sd_card) || 
CHK_MMC_52M(sd_card)) {
+   if (CHK_SD_HS(sd_card) || 
CHK_MMC_52M(sd_card))
val = SD20_RX_14_DELAY;
-   } else {
+   else
val = SD20_RX_POS_EDGE;
-   }
} else {
val = SD20_RX_14_DELAY;
}
@@ -588,32 +587,28 @@ static int sd_set_sample_push_timing(struct rtsx_chip 
*chip)
} else {
u8 val = 0;
 
-   if ((chip->sd_ctl & SD_PUSH_POINT_CTL_MASK) == 
SD_PUSH_POINT_DELAY) {
+   if ((chip->sd_ctl & SD_PUSH_POINT_CTL_MASK) == 
SD_PUSH_POINT_DELAY)
val |= 0x10;
-   }
 
if ((chip->sd_ctl & SD_SAMPLE_POINT_CTL_MASK) == 
SD_SAMPLE_POINT_AUTO) {
if (chip->asic_code) {
if (CHK_SD_HS(sd_card) || CHK_MMC_52M(sd_card)) 
{
-   if (val & 0x10) {
+   if (val & 0x10)
val |= 0x04;
-   } else {
+   else
val |= 0x08;
-   }
}
} else {
-   if (val & 0x10) {
+   if (val & 0x10)
val |= 0x04;
-   } else {
+   else
val |= 0x08;
-   }
}
} else if ((chip->sd_ctl & SD_SAMPLE_POINT_CTL_MASK) == 
SD_SAMPLE_POINT_DELAY) {
-   if (val & 0x10) {
+   if (val & 0x10)
val |= 0x04;
-   } else {
+   else
val |= 0x08;
-   }
}
 
RTSX_WRITE_REG(chip, REG_SD_CFG1, 0x1C, val);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_csd)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   39 ++-
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index b9624f2..88163e1 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -444,15 +444,13 @@ static int sd_check_csd(struct rtsx_chip *chip, char 
check_wp)
break;
}
 
-   if (i == 6) {
+   if (i == 6)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
memcpy(sd_card->raw_csd, rsp + 1, 15);
 
-   if (CHECK_PID(chip, 0x5209)) {
+   if (CHECK_PID(chip, 0x5209))
RTSX_READ_REG(chip, REG_SD_CMD5, sd_card->raw_csd + 15);
-   }
 
RTSX_DEBUGP("CSD Response:\n");
RTSX_DUMP(sd_card->raw_csd, 16);
@@ -463,35 +461,34 @@ static int sd_check_csd(struct rtsx_chip *chip, char 
check_wp)
trans_speed = rsp[4];
if ((trans_speed & 0x07) == 0x02) {
if ((trans_speed & 0xf8) >= 0x30) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = 47;
-   } else {
+   else
sd_card->sd_clock = CLK_50;
-   }
+
} else if ((trans_speed & 0xf8) == 0x28) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = 39;
-   } else {
+   else
sd_card->sd_clock = CLK_40;
-   }
+
} else if ((trans_speed & 0xf8) == 0x20) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = 29;
-   } else {
+   else
sd_card->sd_clock = CLK_30;
-   }
+
} else if ((trans_speed & 0xf8) >= 0x10) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = 23;
-   } else {
+   else
sd_card->sd_clock = CLK_20;
-   }
+
} else if ((trans_speed & 0x08) >= 0x08) {
-   if (chip->asic_code) {
+   if (chip->asic_code)
sd_card->sd_clock = 19;
-   } else {
+   else
sd_card->sd_clock = CLK_20;
-   }
} else {
TRACE_RET(chip, STATUS_FAIL);
}
@@ -521,9 +518,9 @@ static int sd_check_csd(struct rtsx_chip *chip, char 
check_wp)
}
 
if (check_wp) {
-   if (rsp[15] & 0x30) {
+   if (rsp[15] & 0x30)
chip->card_wp |= SD_CARD;
-   }
+
RTSX_DEBUGP("CSD WP Status: 0x%x\n", rsp[15]);
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 03/57] staging/rts_pstor: remove braces {} in sd.c (sd_write_data)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 4575212..b9624f2 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -385,9 +385,8 @@ static int sd_write_data(struct rtsx_chip *chip, u8 
trans_mode,
 
if (buf && buf_len) {
retval = rtsx_write_ppbuf(chip, buf, buf_len);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
rtsx_init_cmd(chip);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 02/57] staging/rts_pstor: remove braces {} in sd.c (sd_read_data)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 3a7f869..4575212 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -320,17 +320,15 @@ static int sd_read_data(struct rtsx_chip *chip,
if (!buf)
buf_len = 0;
 
-   if (buf_len > 512) {
+   if (buf_len > 512)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
rtsx_init_cmd(chip);
 
if (cmd_len) {
RTSX_DEBUGP("SD/MMC CMD %d\n", cmd[0] - 0x40);
-   for (i = 0; i < (cmd_len < 6 ? cmd_len : 6); i++) {
+   for (i = 0; i < (cmd_len < 6 ? cmd_len : 6); i++)
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CMD0 + i, 
0xFF, cmd[i]);
-   }
}
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BYTE_CNT_L, 0xFF, 
(u8)byte_cnt);
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BYTE_CNT_H, 0xFF, 
(u8)(byte_cnt >> 8));
@@ -342,9 +340,9 @@ static int sd_read_data(struct rtsx_chip *chip,
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG2, 0xFF,
SD_CALCULATE_CRC7 | SD_CHECK_CRC16 | 
SD_NO_WAIT_BUSY_END |
SD_CHECK_CRC7 | SD_RSP_LEN_6);
-   if (trans_mode != SD_TM_AUTO_TUNING) {
+   if (trans_mode != SD_TM_AUTO_TUNING)
rtsx_add_cmd(chip, WRITE_REG_CMD, CARD_DATA_SOURCE, 0x01, 
PINGPONG_BUFFER);
-   }
+
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_TRANSFER, 0xFF, trans_mode | 
SD_TRANSFER_START);
rtsx_add_cmd(chip, CHECK_REG_CMD, REG_SD_TRANSFER, SD_TRANSFER_END, 
SD_TRANSFER_END);
 
@@ -360,9 +358,8 @@ static int sd_read_data(struct rtsx_chip *chip,
 
if (buf && buf_len) {
retval = rtsx_read_ppbuf(chip, buf, buf_len);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 
return STATUS_SUCCESS;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 01/57] staging/rts_pstor: remove braces {} in sd.c (sd_send_cmd_get_rsp)

2012-09-06 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/sd.c |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index 3cc9a48..3a7f869 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -192,9 +192,9 @@ RTY_SEND_CMD:
 
stat_idx = 16;
} else if (rsp_type != SD_RSP_TYPE_R0) {
-   for (reg_addr = REG_SD_CMD0; reg_addr <= REG_SD_CMD4; 
reg_addr++) {
+   for (reg_addr = REG_SD_CMD0; reg_addr <= REG_SD_CMD4; 
reg_addr++)
rtsx_add_cmd(chip, READ_REG_CMD, reg_addr, 0, 0);
-   }
+
stat_idx = 5;
}
 
@@ -273,9 +273,8 @@ RTY_SEND_CMD:
if ((rsp_type == SD_RSP_TYPE_R1) || (rsp_type == SD_RSP_TYPE_R1b)) {
if ((cmd_idx != SEND_RELATIVE_ADDR) && (cmd_idx != 
SEND_IF_COND)) {
if (cmd_idx != STOP_TRANSMISSION) {
-   if (ptr[1] & 0x80) {
+   if (ptr[1] & 0x80)
TRACE_RET(chip, STATUS_FAIL);
-   }
}
 #ifdef SUPPORT_SD_LOCK
if (ptr[1] & 0x7D)
@@ -294,11 +293,10 @@ RTY_SEND_CMD:
RTSX_DEBUGP("ptr[3]: 0x%02x\n", ptr[3]);
TRACE_RET(chip, STATUS_FAIL);
}
-   if (ptr[3] & 0x01) {
+   if (ptr[3] & 0x01)
sd_card->sd_data_buf_ready = 1;
-   } else {
+   else
sd_card->sd_data_buf_ready = 0;
-   }
}
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/rts_pstor: remove braces {} in sd.c

2012-09-06 Thread Toshiaki Yamane
On Wed, Sep 5, 2012 at 4:30 AM, Greg Kroah-Hartman  wrote:
> On Sat, Sep 01, 2012 at 10:43:00PM +0900, Toshiaki Yamane wrote:
>> fixed below checkpatch warnings.
>> -WARNING: braces {} are not necessary for single statement blocks
>> -WARNING: braces {} are not necessary for any arm of this statement
>>
>> Signed-off-by: Toshiaki Yamane 
>> ---
>>  drivers/staging/rts_pstor/sd.c | 1112 
>> +---
>>  1 file changed, 469 insertions(+), 643 deletions(-)
>
> Why is the object file size changing with this patch applied?  That
> implies that something went wrong with your patch, care to redo it in a
> format that I can properly review it?

I had to remove the brace that I must not be deleted.
I will send a patch later.

@@ -2729,15 +2644,13 @@ static int mmc_test_switch_bus(struct | @@
-2729,9 +2611,8 @@ static int mmc_test_switch_bus(struct r
rtsx_add_cmd(chip, CHECK_REG_CMD, REG_SD_TRANSFER, SD
 rtsx_add_cmd(chip, CHECK_REG_CMD, REG_SD_TRANSFER, SD

rtsx_add_cmd(chip, READ_REG_CMD, PPBUF_BASE2, 0, 0);
 rtsx_add_cmd(chip, READ_REG_CMD, PPBUF_BASE2, 0, 0);
-   if (width == MMC_8BIT_BUS) {-
 if (width == MMC_8BIT_BUS) {
+   if (width == MMC_8BIT_BUS)  +
 if (width == MMC_8BIT_BUS)
rtsx_add_cmd(chip, READ_REG_CMD, PPBUF_BASE2
 rtsx_add_cmd(chip, READ_REG_CMD, PPBUF_BASE2
-   }   -   }

retval = rtsx_send_cmd(chip, SD_CARD, 100);
 retval = rtsx_send_cmd(chip, SD_CARD, 100);
-   if (retval < 0) { |
 if (retval < 0) {
+   if (retval < 0)   | @@
-2747,15 +2628,14 @@ static int mmc_test_switch_bus(struct
rtsx_clear_sd_error(chip);<
TRACE_RET(chip, SWITCH_ERR);  <
-   } <
  <
ptr = rtsx_get_cmd_data(chip) + 1;<
  <
@@ -2747,15 +2660,15 @@ static int mmc_test_switch_bus(struct <
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/rts_pstor: remove braces {} in sd.c

2012-09-05 Thread Toshiaki Yamane
On Wed, Sep 5, 2012 at 4:30 AM, Greg Kroah-Hartman  wrote:
> On Sat, Sep 01, 2012 at 10:43:00PM +0900, Toshiaki Yamane wrote:
>> fixed below checkpatch warnings.
>> -WARNING: braces {} are not necessary for single statement blocks
>> -WARNING: braces {} are not necessary for any arm of this statement
>>
>> Signed-off-by: Toshiaki Yamane 
>> ---
>>  drivers/staging/rts_pstor/sd.c | 1112 
>> +---
>>  1 file changed, 469 insertions(+), 643 deletions(-)
>
> Why is the object file size changing with this patch applied?  That
> implies that something went wrong with your patch, care to redo it in a
> format that I can properly review it?

I understand.
I will redo it.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/rts_pstor: remove braces {} in sd.c

2012-09-02 Thread Toshiaki Yamane
On Sun, Sep 2, 2012 at 12:05 AM, devendra.aaru  wrote:
> Hello,
>
> This is a very big patch. It will be difficult for reviewers to review.
>
> i think it will be good if you can split into multiple patches.

Thanks for your reply.

Should I do that ?
I have a similar patch some more.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging/rts_pstor: remove braces {} in rtsx_card.c

2012-08-31 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/rtsx_card.c |  186 ++---
 1 file changed, 81 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx_card.c 
b/drivers/staging/rts_pstor/rtsx_card.c
index 4f971f2..539aa6a 100644
--- a/drivers/staging/rts_pstor/rtsx_card.c
+++ b/drivers/staging/rts_pstor/rtsx_card.c
@@ -309,11 +309,10 @@ static void release_sdio(struct rtsx_chip *chip)
if (chip->chip_insert_with_sdio) {
chip->chip_insert_with_sdio = 0;
 
-   if (CHECK_PID(chip, 0x5288)) {
+   if (CHECK_PID(chip, 0x5288))
rtsx_write_register(chip, 0xFE5A, 0x08, 0x00);
-   } else {
+   else
rtsx_write_register(chip, 0xFE70, 0x80, 0x00);
-   }
}
 
rtsx_write_register(chip, SDIO_CTRL, SDIO_CD_CTRL, 0);
@@ -379,11 +378,10 @@ void rtsx_reset_cards(struct rtsx_chip *chip)
if (chip->need_reset & XD_CARD) {
chip->card_exist |= XD_CARD;
 
-   if (chip->xd_show_cnt >= MAX_SHOW_CNT) {
+   if (chip->xd_show_cnt >= MAX_SHOW_CNT)
do_reset_xd_card(chip);
-   } else {
+   else
chip->xd_show_cnt++;
-   }
}
if (CHECK_PID(chip, 0x5288) && CHECK_BARO_PKG(chip, QFN)) {
if (chip->card_exist & XD_CARD) {
@@ -404,11 +402,10 @@ void rtsx_reset_cards(struct rtsx_chip *chip)
if (chip->need_reset & MS_CARD) {
chip->card_exist |= MS_CARD;
 
-   if (chip->ms_show_cnt >= MAX_SHOW_CNT) {
+   if (chip->ms_show_cnt >= MAX_SHOW_CNT)
do_reset_ms_card(chip);
-   } else {
+   else
chip->ms_show_cnt++;
-   }
}
 }
 
@@ -473,13 +470,12 @@ void card_cd_debounce(struct rtsx_chip *chip, unsigned 
long *need_reset, unsigne
release_map |= MS_CARD;
}
} else {
-   if (chip->int_reg & XD_EXIST) {
+   if (chip->int_reg & XD_EXIST)
reset_map |= XD_CARD;
-   } else if (chip->int_reg & SD_EXIST) {
+   else if (chip->int_reg & SD_EXIST)
reset_map |= SD_CARD;
-   } else if (chip->int_reg & MS_EXIST) {
+   else if (chip->int_reg & MS_EXIST)
reset_map |= MS_CARD;
-   }
}
 
if (reset_map) {
@@ -489,21 +485,21 @@ void card_cd_debounce(struct rtsx_chip *chip, unsigned 
long *need_reset, unsigne
for (i = 0; i < (DEBOUNCE_CNT); i++) {
chip->int_reg = rtsx_readl(chip, RTSX_BIPR);
 
-   if (chip->int_reg & XD_EXIST) {
+   if (chip->int_reg & XD_EXIST)
xd_cnt++;
-   } else {
+   else
xd_cnt = 0;
-   }
-   if (chip->int_reg & SD_EXIST) {
+
+   if (chip->int_reg & SD_EXIST)
sd_cnt++;
-   } else {
+   else
sd_cnt = 0;
-   }
-   if (chip->int_reg & MS_EXIST) {
+
+   if (chip->int_reg & MS_EXIST)
ms_cnt++;
-   } else {
+   else
ms_cnt = 0;
-   }
+
wait_timeout(30);
}
 
@@ -677,9 +673,8 @@ int switch_ssc_clock(struct rtsx_chip *chip, int clk)
 
RTSX_DEBUGP("Switch SSC clock to %dMHz (cur_clk = %d)\n", clk, 
chip->cur_clk);
 
-   if ((clk <= 2) || (N > max_N)) {
+   if ((clk <= 2) || (N > max_N))
TRACE_RET(chip, STATUS_FAIL);
-   }
 
mcu_cnt = (u8)(125/clk + 3);
if (CHECK_PID(chip, 0x5209)) {
@@ -700,32 +695,29 @@ int switch_ssc_clock(struct rtsx_chip *chip, int clk)
if (chip->ssc_en) {
if (CHECK_PID(chip, 0x5209)) {
if (chip->cur_card == SD_CARD) {
-   if (CHK_SD_SDR104(sd_card)) {
+   if (CHK_SD_SDR104(sd_card))
ssc_depth = chip->ssc_depth_sd_s

[PATCH] staging/rts_pstor: remove braces {} in rtsx_transport.c

2012-08-30 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/rtsx_transport.c |  100 +---
 1 file changed, 45 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx_transport.c 
b/drivers/staging/rts_pstor/rtsx_transport.c
index 54a4742..1f9a424 100644
--- a/drivers/staging/rts_pstor/rtsx_transport.c
+++ b/drivers/staging/rts_pstor/rtsx_transport.c
@@ -218,9 +218,9 @@ void rtsx_add_cmd(struct rtsx_chip *chip,
val |= (u32)data;
 
spin_lock_irq(&chip->rtsx->reg_lock);
-   if (chip->ci < (HOST_CMDS_BUF_LEN / 4)) {
+   if (chip->ci < (HOST_CMDS_BUF_LEN / 4))
cb[(chip->ci)++] = cpu_to_le32(val);
-   }
+
spin_unlock_irq(&chip->rtsx->reg_lock);
 }
 
@@ -244,15 +244,14 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int 
timeout)
long timeleft;
int err = 0;
 
-   if (card == SD_CARD) {
+   if (card == SD_CARD)
rtsx->check_card_cd = SD_EXIST;
-   } else if (card == MS_CARD) {
+   else if (card == MS_CARD)
rtsx->check_card_cd = MS_EXIST;
-   } else if (card == XD_CARD) {
+   else if (card == XD_CARD)
rtsx->check_card_cd = XD_EXIST;
-   } else {
+   else
rtsx->check_card_cd = 0;
-   }
 
spin_lock_irq(&rtsx->reg_lock);
 
@@ -281,11 +280,11 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int 
timeout)
}
 
spin_lock_irq(&rtsx->reg_lock);
-   if (rtsx->trans_result == TRANS_RESULT_FAIL) {
+   if (rtsx->trans_result == TRANS_RESULT_FAIL)
err = -EIO;
-   } else if (rtsx->trans_result == TRANS_RESULT_OK) {
+   else if (rtsx->trans_result == TRANS_RESULT_OK)
err = 0;
-   }
+
spin_unlock_irq(&rtsx->reg_lock);
 
 finish_send_cmd:
@@ -341,23 +340,21 @@ static int rtsx_transfer_sglist_adma_partial(struct 
rtsx_chip *chip, u8 card,
if ((sg == NULL) || (num_sg <= 0) || !offset || !index)
return -EIO;
 
-   if (dma_dir == DMA_TO_DEVICE) {
+   if (dma_dir == DMA_TO_DEVICE)
dir = HOST_TO_DEVICE;
-   } else if (dma_dir == DMA_FROM_DEVICE) {
+   else if (dma_dir == DMA_FROM_DEVICE)
dir = DEVICE_TO_HOST;
-   } else {
+   else
return -ENXIO;
-   }
 
-   if (card == SD_CARD) {
+   if (card == SD_CARD)
rtsx->check_card_cd = SD_EXIST;
-   } else if (card == MS_CARD) {
+   else if (card == MS_CARD)
rtsx->check_card_cd = MS_EXIST;
-   } else if (card == XD_CARD) {
+   else if (card == XD_CARD)
rtsx->check_card_cd = XD_EXIST;
-   } else {
+   else
rtsx->check_card_cd = 0;
-   }
 
spin_lock_irq(&rtsx->reg_lock);
 
@@ -405,11 +402,10 @@ static int rtsx_transfer_sglist_adma_partial(struct 
rtsx_chip *chip, u8 card,
*offset = 0;
*index = *index + 1;
}
-   if ((i == (sg_cnt - 1)) || !resid) {
+   if ((i == (sg_cnt - 1)) || !resid)
option = SG_VALID | SG_END | SG_TRANS_DATA;
-   } else {
+   else
option = SG_VALID | SG_TRANS_DATA;
-   }
 
rtsx_add_sg_tbl(chip, (u32)addr, (u32)len, option);
 
@@ -468,11 +464,11 @@ static int rtsx_transfer_sglist_adma_partial(struct 
rtsx_chip *chip, u8 card,
}
 
spin_lock_irq(&rtsx->reg_lock);
-   if (rtsx->trans_result == TRANS_RESULT_FAIL) {
+   if (rtsx->trans_result == TRANS_RESULT_FAIL)
err = -EIO;
-   } else if (rtsx->trans_result == TRANS_RESULT_OK) {
+   else if (rtsx->trans_result == TRANS_RESULT_OK)
err = 0;
-   }
+
spin_unlock_irq(&rtsx->reg_lock);
 
 out:
@@ -501,23 +497,21 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip 
*chip, u8 card,
if ((sg == NULL) || (num_sg <= 0))
return -EIO;
 
-   if (dma_dir == DMA_TO_DEVICE) {
+   if (dma_dir == DMA_TO_DEVICE)
dir = HOST_TO_DEVICE;
-   } else if (dma_dir == DMA_FROM_DEVICE) {
+   else if (dma_dir == DMA_FROM_DEVICE)
dir = DEVICE_TO_HOST;
-   } else {
+   else
return -ENXIO;
-   }
 
-   if (card == SD_CARD) {
+   if (card == SD_CARD)
rtsx->check_card_cd = SD_EXIST;
-   } else if (card == MS_CARD) {
+   else if (card == MS_CARD)
rtsx->check_card_cd = MS_EXIST;
-   } else if (card == XD_CARD) {
+   else i

[PATCH] staging/rts_pstor: remove braces {} in rtsx_chip.c

2012-08-29 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for single statement blocks
-WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/rtsx_chip.c |  563 ++---
 1 file changed, 246 insertions(+), 317 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx_chip.c 
b/drivers/staging/rts_pstor/rtsx_chip.c
index 5452069..d8e691b 100644
--- a/drivers/staging/rts_pstor/rtsx_chip.c
+++ b/drivers/staging/rts_pstor/rtsx_chip.c
@@ -105,11 +105,10 @@ void rtsx_enable_bus_int(struct rtsx_chip *chip)
reg |= DELINK_INT_EN;
 #ifdef SUPPORT_OCP
if (CHECK_PID(chip, 0x5209)) {
-   if (CHECK_LUN_MODE(chip, SD_MS_2LUN)) {
+   if (CHECK_LUN_MODE(chip, SD_MS_2LUN))
reg |= MS_OC_INT_EN | SD_OC_INT_EN;
-   } else {
+   else
reg |= SD_OC_INT_EN;
-   }
} else {
reg |= OC_INT_EN;
}
@@ -186,20 +185,20 @@ static int rtsx_pre_handle_sdio_new(struct rtsx_chip 
*chip)
u8 cd_toggle_mask = 0;
 
RTSX_READ_REG(chip, TLPTISTAT, &tmp);
-   if (CHECK_PID(chip, 0x5209)) {
+   if (CHECK_PID(chip, 0x5209))
cd_toggle_mask = 0x10;
-   } else {
+   else
cd_toggle_mask = 0x08;
-   }
+
if (tmp & cd_toggle_mask) {
/* Disable sdio_bus_auto_switch */
-   if (CHECK_PID(chip, 0x5288)) {
+   if (CHECK_PID(chip, 0x5288))
RTSX_WRITE_REG(chip, 0xFE5A, 0x08, 0x00);
-   } else if (CHECK_PID(chip, 0x5208)) {
+   else if (CHECK_PID(chip, 0x5208))
RTSX_WRITE_REG(chip, 0xFE70, 0x80, 0x00);
-   } else {
+   else
RTSX_WRITE_REG(chip, SDIO_CFG, 
SDIO_BUS_AUTO_SWITCH, 0);
-   }
+
RTSX_WRITE_REG(chip, TLPTISTAT, 0xFF, tmp);
 
chip->need_reset |= SD_CARD;
@@ -208,16 +207,14 @@ static int rtsx_pre_handle_sdio_new(struct rtsx_chip 
*chip)
 
if (chip->asic_code) {
retval = sd_pull_ctl_enable(chip);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
} else {
RTSX_WRITE_REG(chip, FPGA_PULL_CTL, 
FPGA_SD_PULL_CTL_BIT | 0x20, 0);
}
retval = card_share_mode(chip, SD_CARD);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
 
/* Enable sdio_bus_auto_switch */
if (CHECK_PID(chip, 0x5288)) {
@@ -232,11 +229,11 @@ static int rtsx_pre_handle_sdio_new(struct rtsx_chip 
*chip)
chip->sd_io = 1;
}
} else {
-   if (CHECK_PID(chip, 0x5209)) {
+   if (CHECK_PID(chip, 0x5209))
RTSX_WRITE_REG(chip, TLPTISTAT, 0x10, 0x10);
-   } else {
+   else
RTSX_WRITE_REG(chip, TLPTISTAT, 0x08, 0x08);
-   }
+
chip->need_reset |= SD_CARD;
}
 
@@ -257,48 +254,47 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
 
/* optimize PHY */
retval = rtsx_write_phy_register(chip, 0x00, 0xB966);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
retval = rtsx_write_phy_register(chip, 0x01, 0x713F);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
retval = rtsx_write_phy_register(chip, 0x03, 0xA549);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
retval = rtsx_write_phy_register(chip, 0x06, 0xB235);
-   if (retval != STATUS_SUCCESS) {
+   if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
-   }
+
retval = rtsx_write_phy_register(chip, 0x07, 0xEF40);
-   if (retval != STATUS_SUCCESS) {
+   if (retv

[PATCH 2/2] staging/rts_pstor: Use pr_ printks in debug.h

2012-08-28 Thread Toshiaki Yamane
fixed below checkpatch warnings.
-WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...

And added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/debug.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rts_pstor/debug.h 
b/drivers/staging/rts_pstor/debug.h
index ab305be..e6b3425 100644
--- a/drivers/staging/rts_pstor/debug.h
+++ b/drivers/staging/rts_pstor/debug.h
@@ -24,13 +24,13 @@
 #ifndef __REALTEK_RTSX_DEBUG_H
 #define __REALTEK_RTSX_DEBUG_H
 
-#include 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#define RTSX_STOR "rts_pstor: "
+#include 
 
 #ifdef CONFIG_RTS_PSTOR_DEBUG
-#define RTSX_DEBUGP(x...) printk(KERN_DEBUG RTSX_STOR x)
-#define RTSX_DEBUGPN(x...) printk(KERN_DEBUG x)
+#define RTSX_DEBUGP(x...) pr_debug(x)
+#define RTSX_DEBUGPN(x...) pr_debug(x)
 #define RTSX_DEBUGPX(x...) printk(x)
 #define RTSX_DEBUG(x) x
 #else
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] staging/rts_pstor: Use pr_ printks in rtsx.c

2012-08-28 Thread Toshiaki Yamane
fixed some checkpatch warnings.
-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
-WARNING: quoted string split across lines

And added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/rts_pstor/rtsx.c |  107 +++---
 1 file changed, 54 insertions(+), 53 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c
index 5fb05a2..a44f630 100644
--- a/drivers/staging/rts_pstor/rtsx.c
+++ b/drivers/staging/rts_pstor/rtsx.c
@@ -20,6 +20,8 @@
  *   No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -170,14 +172,14 @@ static int queuecommand_lck(struct scsi_cmnd *srb,
 
/* check for state-transition errors */
if (chip->srb != NULL) {
-   printk(KERN_ERR "Error in %s: chip->srb = %p\n",
-   __func__, chip->srb);
+   pr_err("Error in %s: chip->srb = %p\n",
+  __func__, chip->srb);
return SCSI_MLQUEUE_HOST_BUSY;
}
 
/* fail the command if we are disconnecting */
if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) {
-   printk(KERN_INFO "Fail command during disconnect\n");
+   pr_info("Fail command during disconnect\n");
srb->result = DID_NO_CONNECT << 16;
done(srb);
return 0;
@@ -204,14 +206,14 @@ static int command_abort(struct scsi_cmnd *srb)
struct rtsx_dev *dev = host_to_rtsx(host);
struct rtsx_chip *chip = dev->chip;
 
-   printk(KERN_INFO "%s called\n", __func__);
+   pr_info("%s called\n", __func__);
 
scsi_lock(host);
 
/* Is this command still active? */
if (chip->srb != srb) {
scsi_unlock(host);
-   printk(KERN_INFO "-- nothing to abort\n");
+   pr_info("-- nothing to abort\n");
return FAILED;
}
 
@@ -231,7 +233,7 @@ static int device_reset(struct scsi_cmnd *srb)
 {
int result = 0;
 
-   printk(KERN_INFO "%s called\n", __func__);
+   pr_info("%s called\n", __func__);
 
return result < 0 ? FAILED : SUCCESS;
 }
@@ -241,7 +243,7 @@ static int bus_reset(struct scsi_cmnd *srb)
 {
int result = 0;
 
-   printk(KERN_INFO "%s called\n", __func__);
+   pr_info("%s called\n", __func__);
 
return result < 0 ? FAILED : SUCCESS;
 }
@@ -303,14 +305,14 @@ static int rtsx_acquire_irq(struct rtsx_dev *dev)
 {
struct rtsx_chip *chip = dev->chip;
 
-   printk(KERN_INFO "%s: chip->msi_en = %d, pci->irq = %d\n",
-   __func__, chip->msi_en, dev->pci->irq);
+   pr_info("%s: chip->msi_en = %d, pci->irq = %d\n",
+   __func__, chip->msi_en, dev->pci->irq);
 
if (request_irq(dev->pci->irq, rtsx_interrupt,
chip->msi_en ? 0 : IRQF_SHARED,
CR_DRIVER_NAME, dev)) {
-   printk(KERN_ERR "rtsx: unable to grab IRQ %d, "
-  "disabling device\n", dev->pci->irq);
+   pr_err("unable to grab IRQ %d, disabling device\n",
+  dev->pci->irq);
return -1;
}
 
@@ -347,10 +349,10 @@ static int rtsx_suspend(struct pci_dev *pci, pm_message_t 
state)
struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci);
struct rtsx_chip *chip;
 
-   printk(KERN_INFO "Ready to suspend\n");
+   pr_info("Ready to suspend\n");
 
if (!dev) {
-   printk(KERN_ERR "Invalid memory\n");
+   pr_err("Invalid memory\n");
return 0;
}
 
@@ -386,10 +388,10 @@ static int rtsx_resume(struct pci_dev *pci)
struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci);
struct rtsx_chip *chip;
 
-   printk(KERN_INFO "Ready to resume\n");
+   pr_info("Ready to resume\n");
 
if (!dev) {
-   printk(KERN_ERR "Invalid memory\n");
+   pr_err("Invalid memory\n");
return 0;
}
 
@@ -401,8 +403,7 @@ static int rtsx_resume(struct pci_dev *pci)
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
-   printk(KERN_ERR "%s: pci_enable_device failed, "
-  "disabling device\n", CR_DRIVER_NAME);
+   pr_err("pci_enable_device failed, disabling device\n");
/* unlock the device pointers */
 

[PATCH 3/3] staging/vme: Use pr_ printks in vme_pio2_core.c

2012-08-21 Thread Toshiaki Yamane
The below checkpatch warnings was fixed,

-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

and added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_pio2_core.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c 
b/drivers/staging/vme/devices/vme_pio2_core.c
index 4bf8e05..dad8281 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -10,6 +10,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -163,15 +165,13 @@ static int __init pio2_init(void)
int retval = 0;
 
if (bus_num == 0) {
-   printk(KERN_ERR "%s: No cards, skipping registration\n",
-   driver_name);
+   pr_err("No cards, skipping registration\n");
goto err_nocard;
}
 
if (bus_num > PIO2_CARDS_MAX) {
-   printk(KERN_ERR
-   "%s: Driver only able to handle %d PIO2 Cards\n",
-   driver_name, PIO2_CARDS_MAX);
+   pr_err("Driver only able to handle %d PIO2 Cards\n",
+  PIO2_CARDS_MAX);
bus_num = PIO2_CARDS_MAX;
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] staging/vme: Use pr_ printks in vme_user.c

2012-08-21 Thread Toshiaki Yamane
The below checkpatch warnings was fixed,

-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
-WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

and added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |   69 ++--
 1 file changed, 30 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index e39d273..7d28086 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -170,7 +172,7 @@ static int vme_user_open(struct inode *inode, struct file 
*file)
mutex_lock(&image[minor].mutex);
/* Allow device to be opened if a resource is needed and allocated. */
if (minor < CONTROL_MINOR && image[minor].resource == NULL) {
-   printk(KERN_ERR "No resources allocated for device\n");
+   pr_err("No resources allocated for device\n");
err = -EINVAL;
goto err_res;
}
@@ -225,13 +227,13 @@ static ssize_t resource_to_user(int minor, char __user 
*buf, size_t count,
(unsigned long)copied);
if (retval != 0) {
copied = (copied - retval);
-   printk(KERN_INFO "User copy failed\n");
+   pr_info("User copy failed\n");
return -EINVAL;
}
 
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   pr_info("Currently don't support large transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_read to do the transfer */
@@ -265,7 +267,7 @@ static ssize_t resource_from_user(unsigned int minor, const 
char __user *buf,
image[minor].kern_buf, copied, *ppos);
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   pr_info("Currently don't support large transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_write to do the transfer */
@@ -286,7 +288,7 @@ static ssize_t buffer_to_user(unsigned int minor, char 
__user *buf,
retval = __copy_to_user(buf, image_ptr, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   pr_warn("Partial copy to userspace\n");
} else
retval = count;
 
@@ -305,7 +307,7 @@ static ssize_t buffer_from_user(unsigned int minor, const 
char __user *buf,
retval = __copy_from_user(image_ptr, buf, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   pr_warn("Partial copy to userspace\n");
} else
retval = count;
 
@@ -476,7 +478,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_from_user(&irq_req, argp,
sizeof(struct vme_irq_id));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from 
userspace\n");
+   pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
 
@@ -503,8 +505,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_to_user(argp, &master,
sizeof(struct vme_master));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy to "
-   "userspace\n");
+   pr_warn("Partial copy to userspace\n");
return -EFAULT;
}
 
@@ -515,8 +516,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
 
copied = copy_from_user(&master, argp, sizeof(master));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from "
-   "userspace\n");
+   pr_warn("Pa

[PATCH 1/3] Staging: vme: Fix a white space issue

2012-08-21 Thread Toshiaki Yamane
The below checkpatch error was fixed.

-ERROR: trailing whitespace

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index e25645e..e39d273 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -396,7 +396,7 @@ static ssize_t vme_user_write(struct file *file, const char 
__user *buf,
default:
retval = -EINVAL;
}
-   
+
mutex_unlock(&image[minor].mutex);
 
if (retval > 0)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/5] staging/vme: fix checkpatch warning

2012-08-21 Thread Toshiaki Yamane
On Fri, Aug 17, 2012 at 11:30 PM, Toshiaki Yamane  wrote:
> On Fri, Aug 17, 2012 at 10:19 PM, Greg Kroah-Hartman
>  wrote:
>> On Fri, Aug 17, 2012 at 05:27:53PM +0900, Toshiaki Yamane wrote:
>>> On Fri, Aug 17, 2012 at 4:46 PM, Dan Carpenter  
>>> wrote:
>>> > You've got the same subject repeated 5 times.
>>> >
>>> > It would be better to merge all the vme_user.c printk fixes into
>>> > one patch.
>>> > [patch 1/3] Staging: vme: Fix a white space issue
>>> > [patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
>>> > [patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c
>>> >
>>> > It's not a huge deal, it just seems like there was some confusion on
>>> > how to break patches up.
>>>
>>>
>>> Thanks for your reply!
>>> I will try to fix it.
>>
>> Please do, I can't take it as-is.
>
> I will stop, if you say so.

Greg-san,

I have misunderstood your reply. I am sorry...
I will send a patch from now.

-- 

Regards,


 .
  .
...

Yamane Toshiaki

yamaneto...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/5] staging/vme: fix checkpatch warning

2012-08-17 Thread Toshiaki Yamane
On Fri, Aug 17, 2012 at 10:19 PM, Greg Kroah-Hartman
 wrote:
> On Fri, Aug 17, 2012 at 05:27:53PM +0900, Toshiaki Yamane wrote:
>> On Fri, Aug 17, 2012 at 4:46 PM, Dan Carpenter  
>> wrote:
>> > You've got the same subject repeated 5 times.
>> >
>> > It would be better to merge all the vme_user.c printk fixes into
>> > one patch.
>> > [patch 1/3] Staging: vme: Fix a white space issue
>> > [patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
>> > [patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c
>> >
>> > It's not a huge deal, it just seems like there was some confusion on
>> > how to break patches up.
>>
>>
>> Thanks for your reply!
>> I will try to fix it.
>
> Please do, I can't take it as-is.

I will stop, if you say so.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/5] staging/vme: fix checkpatch warning

2012-08-17 Thread Toshiaki Yamane
On Fri, Aug 17, 2012 at 4:46 PM, Dan Carpenter  wrote:
> You've got the same subject repeated 5 times.
>
> It would be better to merge all the vme_user.c printk fixes into
> one patch.
> [patch 1/3] Staging: vme: Fix a white space issue
> [patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
> [patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c
>
> It's not a huge deal, it just seems like there was some confusion on
> how to break patches up.


Thanks for your reply!
I will try to fix it.



-- 

Regards,


 .
  .
...

Yamane Toshiaki

yamaneto...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging/olpc_dcon: fix checkpatch warnings

2012-08-16 Thread Toshiaki Yamane
The below checkpatch warnings was fixed,

-  WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
-  WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
-  WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-  WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

And added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/olpc_dcon/olpc_dcon.c|   53 --
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c   |   15 ---
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c |6 ++-
 3 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
b/drivers/staging/olpc_dcon/olpc_dcon.c
index 992275c..280751a 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -11,6 +11,7 @@
  * License as published by the Free Software Foundation.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include 
 #include 
@@ -71,18 +72,16 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
 
ver = dcon_read(dcon, DCON_REG_ID);
if ((ver >> 8) != 0xDC) {
-   printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x 
instead.\n",
-   ver);
+   pr_err("DCON ID not 0xDCxx: 0x%04x instead.\n", ver);
rc = -ENXIO;
goto err;
}
 
if (is_init) {
-   printk(KERN_INFO "olpc-dcon:  Discovered DCON version %x\n",
-   ver & 0xFF);
+   pr_info("Discovered DCON version %x\n", ver & 0xFF);
rc = pdata->init(dcon);
if (rc != 0) {
-   printk(KERN_ERR "olpc-dcon:  Unable to init.\n");
+   pr_err("Unable to init.\n");
goto err;
}
}
@@ -136,8 +135,7 @@ power_up:
x = 1;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x) {
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power up: %d!\n",
-   x);
+   pr_warn("unable to force dcon to power up: %d!\n", x);
return x;
}
msleep(10); /* we'll be conservative */
@@ -150,7 +148,7 @@ power_up:
x = dcon_read(dcon, DCON_REG_ID);
}
if (x < 0) {
-   printk(KERN_ERR "olpc-dcon:  unable to stabilize dcon's smbus, 
reasserting power and praying.\n");
+   pr_err("unable to stabilize dcon's smbus, reasserting power and 
praying.\n");
BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
x = 0;
olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
@@ -221,8 +219,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
x = 0;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power down: %d!\n",
-   x);
+   pr_warn("unable to force dcon to power down: %d!\n", x);
else
dcon->asleep = sleep;
} else {
@@ -231,8 +228,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
dcon->disp_mode |= MODE_BL_ENABLE;
x = dcon_bus_stabilize(dcon, 1);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to reinit dcon 
hardware: %d!\n",
-   x);
+   pr_warn("unable to reinit dcon hardware: %d!\n", x);
else
dcon->asleep = sleep;
 
@@ -303,12 +299,11 @@ static void dcon_source_switch(struct work_struct *work)
 
switch (source) {
case DCON_SOURCE_CPU:
-   printk(KERN_INFO "dcon_source_switch to CPU\n");
+   pr_info("dcon_source_switch to CPU\n");
/* Enable the scanline interrupt bit */
if (dcon_write(dcon, DCON_REG_MODE,
dcon->disp_mode | MODE_SCAN_INT))
-   printk(KERN_ERR
-  "olpc-dcon:  couldn't enable scanline 
interrupt!\n");
+   pr_err("couldn't enable scanline interrupt!\n");
else {
/* Wait up to one second for the scanline interrupt */
wait_event_timeout(dcon_wait_queue,
@@ -316,11 +311,11 @@ static void dcon_source_switch(struct work_struct *work)
}
 
if (!dcon->switched)
-   prin

[PATCH 5/5] staging/vme: fix checkpatch warning

2012-08-16 Thread Toshiaki Yamane
The below checkpatch warnings was fixed,

-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

and added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_pio2_core.c |   10 +-
 drivers/staging/vme/devices/vme_user.c  |   14 ++
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c 
b/drivers/staging/vme/devices/vme_pio2_core.c
index 4bf8e05..dad8281 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -10,6 +10,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -163,15 +165,13 @@ static int __init pio2_init(void)
int retval = 0;
 
if (bus_num == 0) {
-   printk(KERN_ERR "%s: No cards, skipping registration\n",
-   driver_name);
+   pr_err("No cards, skipping registration\n");
goto err_nocard;
}
 
if (bus_num > PIO2_CARDS_MAX) {
-   printk(KERN_ERR
-   "%s: Driver only able to handle %d PIO2 Cards\n",
-   driver_name, PIO2_CARDS_MAX);
+   pr_err("Driver only able to handle %d PIO2 Cards\n",
+  PIO2_CARDS_MAX);
bus_num = PIO2_CARDS_MAX;
}
 
diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index e47fc41..7d28086 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -172,7 +172,7 @@ static int vme_user_open(struct inode *inode, struct file 
*file)
mutex_lock(&image[minor].mutex);
/* Allow device to be opened if a resource is needed and allocated. */
if (minor < CONTROL_MINOR && image[minor].resource == NULL) {
-   printk(KERN_ERR "No resources allocated for device\n");
+   pr_err("No resources allocated for device\n");
err = -EINVAL;
goto err_res;
}
@@ -630,8 +630,7 @@ static int __init vme_user_init(void)
pr_info("VME User Space Access Driver\n");
 
if (bus_num == 0) {
-   printk(KERN_ERR "%s: No cards, skipping registration\n",
-   driver_name);
+   pr_err("No cards, skipping registration\n");
retval = -ENODEV;
goto err_nocard;
}
@@ -640,8 +639,8 @@ static int __init vme_user_init(void)
 * in future revisions if that ever becomes necessary.
 */
if (bus_num > VME_USER_BUS_MAX) {
-   printk(KERN_ERR "%s: Driver only able to handle %d buses\n",
-   driver_name, VME_USER_BUS_MAX);
+   pr_err("Driver only able to handle %d buses\n",
+  VME_USER_BUS_MAX);
bus_num = VME_USER_BUS_MAX;
}
 
@@ -681,8 +680,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 
/* Save pointer to the bridge device */
if (vme_user_bridge != NULL) {
-   printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
-   driver_name);
+   pr_err("Driver can only be loaded for 1 device\n");
err = -EINVAL;
goto err_dev;
}
@@ -769,7 +767,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
/* Create sysfs entries - on udev systems this creates the dev files */
vme_user_sysfs_class = class_create(THIS_MODULE, driver_name);
if (IS_ERR(vme_user_sysfs_class)) {
-   printk(KERN_ERR "Error creating vme_user class.\n");
+   pr_err("Error creating vme_user class.\n");
err = PTR_ERR(vme_user_sysfs_class);
goto err_class;
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/5] staging/vme: fix checkpatch warning

2012-08-16 Thread Toshiaki Yamane
The below checkpatch warnings was fixed.

-WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |   36 +---
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index ef4b821..e47fc41 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -288,7 +288,7 @@ static ssize_t buffer_to_user(unsigned int minor, char 
__user *buf,
retval = __copy_to_user(buf, image_ptr, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   pr_warn("Partial copy to userspace\n");
} else
retval = count;
 
@@ -307,7 +307,7 @@ static ssize_t buffer_from_user(unsigned int minor, const 
char __user *buf,
retval = __copy_from_user(image_ptr, buf, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   pr_warn("Partial copy to userspace\n");
} else
retval = count;
 
@@ -478,7 +478,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_from_user(&irq_req, argp,
sizeof(struct vme_irq_id));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from 
userspace\n");
+   pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
 
@@ -505,8 +505,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_to_user(argp, &master,
sizeof(struct vme_master));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy to "
-   "userspace\n");
+   pr_warn("Partial copy to userspace\n");
return -EFAULT;
}
 
@@ -517,8 +516,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
 
copied = copy_from_user(&master, argp, sizeof(master));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from "
-   "userspace\n");
+   pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
 
@@ -548,8 +546,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_to_user(argp, &slave,
sizeof(struct vme_slave));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy to "
-   "userspace\n");
+   pr_warn("Partial copy to userspace\n");
return -EFAULT;
}
 
@@ -560,8 +557,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
 
copied = copy_from_user(&slave, argp, sizeof(slave));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from "
-   "userspace\n");
+   pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
 
@@ -709,8 +705,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS,
driver_name);
if (err) {
-   printk(KERN_WARNING "%s: Error getting Major Number %d for "
-   "driver.\n", driver_name, VME_MAJOR);
+   pr_warn("Error getting Major Number %d for driver.\n",
+   VME_MAJOR);
goto err_region;
}
 
@@ -720,7 +716,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
vme_user_cdev->owner = THIS_MODULE;
err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
if (err) {
-   printk(KERN_WARNING "%s: cdev_all failed\n", driver_name);
+   pr_warn("cdev_all failed\n");
goto err_char;
}
 
@@ -734,16 +730,14 @@ static int __devinit vme_user_p

[PATCH 3/5] staging/vme: fix checkpatch warning

2012-08-16 Thread Toshiaki Yamane
The below checkpatch warnings was fixed.

-WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index f12945c..ef4b821 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -601,8 +601,8 @@ static void buf_unalloc(int num)
 {
if (image[num].kern_buf) {
 #ifdef VME_DEBUG
-   printk(KERN_DEBUG "UniverseII:Releasing buffer at %p\n",
-   image[num].pci_buf);
+   pr_debug("UniverseII:Releasing buffer at %p\n",
+image[num].pci_buf);
 #endif
 
vme_free_consistent(image[num].resource, image[num].size_buf,
@@ -614,7 +614,7 @@ static void buf_unalloc(int num)
 
 #ifdef VME_DEBUG
} else {
-   printk(KERN_DEBUG "UniverseII: Buffer not allocated\n");
+   pr_debug("UniverseII: Buffer not allocated\n");
 #endif
}
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/5] staging/vme: fix checkpatch warning

2012-08-16 Thread Toshiaki Yamane
The below checkpatch warnings was fixed,

-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...

and added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index e39d273..f12945c 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -225,13 +227,13 @@ static ssize_t resource_to_user(int minor, char __user 
*buf, size_t count,
(unsigned long)copied);
if (retval != 0) {
copied = (copied - retval);
-   printk(KERN_INFO "User copy failed\n");
+   pr_info("User copy failed\n");
return -EINVAL;
}
 
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   pr_info("Currently don't support large transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_read to do the transfer */
@@ -265,7 +267,7 @@ static ssize_t resource_from_user(unsigned int minor, const 
char __user *buf,
image[minor].kern_buf, copied, *ppos);
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   pr_info("Currently don't support large transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_write to do the transfer */
@@ -629,7 +631,7 @@ static int __init vme_user_init(void)
 {
int retval = 0;
 
-   printk(KERN_INFO "VME User Space Access Driver\n");
+   pr_info("VME User Space Access Driver\n");
 
if (bus_num == 0) {
printk(KERN_ERR "%s: No cards, skipping registration\n",
@@ -803,8 +805,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
image[i].device = device_create(vme_user_sysfs_class, NULL,
MKDEV(VME_MAJOR, i), NULL, name, num);
if (IS_ERR(image[i].device)) {
-   printk(KERN_INFO "%s: Error creating sysfs device\n",
-   driver_name);
+   pr_info("Error creating sysfs device\n");
err = PTR_ERR(image[i].device);
goto err_sysfs;
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/5] staging/vme: fix checkpatch error

2012-08-16 Thread Toshiaki Yamane
The below checkpatch error was fixed.

-ERROR: trailing whitespace

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/vme/devices/vme_user.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index e25645e..e39d273 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -396,7 +396,7 @@ static ssize_t vme_user_write(struct file *file, const char 
__user *buf,
default:
retval = -EINVAL;
}
-   
+
mutex_unlock(&image[minor].mutex);
 
if (retval > 0)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging/olpc_dcon: fix checkpatch warnings

2012-07-27 Thread Toshiaki Yamane
fixed some checkpatch warnings.
(Excluding -WARNING: msleep < 20ms can sleep for up to 20ms-)

$ find drivers/staging/olpc_dcon/ -name "*.[ch]"|xargs ./scripts/checkpatch.pl \
-f --terse --nosummary|cut -f3- -d":"|sort |uniq -c|sort -n
  2  WARNING: msleep < 20ms can sleep for up to 20ms; see 
Documentation/timers/timers-howto.txt
  3  WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
  3  WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
  6  WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
 19  WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

And added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/olpc_dcon/olpc_dcon.c|   53 --
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c   |   15 ---
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c |6 ++-
 3 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
b/drivers/staging/olpc_dcon/olpc_dcon.c
index 992275c..280751a 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -11,6 +11,7 @@
  * License as published by the Free Software Foundation.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include 
 #include 
@@ -71,18 +72,16 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
 
ver = dcon_read(dcon, DCON_REG_ID);
if ((ver >> 8) != 0xDC) {
-   printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x 
instead.\n",
-   ver);
+   pr_err("DCON ID not 0xDCxx: 0x%04x instead.\n", ver);
rc = -ENXIO;
goto err;
}
 
if (is_init) {
-   printk(KERN_INFO "olpc-dcon:  Discovered DCON version %x\n",
-   ver & 0xFF);
+   pr_info("Discovered DCON version %x\n", ver & 0xFF);
rc = pdata->init(dcon);
if (rc != 0) {
-   printk(KERN_ERR "olpc-dcon:  Unable to init.\n");
+   pr_err("Unable to init.\n");
goto err;
}
}
@@ -136,8 +135,7 @@ power_up:
x = 1;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x) {
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power up: %d!\n",
-   x);
+   pr_warn("unable to force dcon to power up: %d!\n", x);
return x;
}
msleep(10); /* we'll be conservative */
@@ -150,7 +148,7 @@ power_up:
x = dcon_read(dcon, DCON_REG_ID);
}
if (x < 0) {
-   printk(KERN_ERR "olpc-dcon:  unable to stabilize dcon's smbus, 
reasserting power and praying.\n");
+   pr_err("unable to stabilize dcon's smbus, reasserting power and 
praying.\n");
BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
x = 0;
olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
@@ -221,8 +219,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
x = 0;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power down: %d!\n",
-   x);
+   pr_warn("unable to force dcon to power down: %d!\n", x);
else
dcon->asleep = sleep;
} else {
@@ -231,8 +228,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
dcon->disp_mode |= MODE_BL_ENABLE;
x = dcon_bus_stabilize(dcon, 1);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to reinit dcon 
hardware: %d!\n",
-   x);
+   pr_warn("unable to reinit dcon hardware: %d!\n", x);
else
dcon->asleep = sleep;
 
@@ -303,12 +299,11 @@ static void dcon_source_switch(struct work_struct *work)
 
switch (source) {
case DCON_SOURCE_CPU:
-   printk(KERN_INFO "dcon_source_switch to CPU\n");
+   pr_info("dcon_source_switch to CPU\n");
/* Enable the scanline interrupt bit */
if (dcon_write(dcon, DCON_REG_MODE,
dcon->disp_mode | MODE_SCAN_INT))
-   printk(KERN_ERR
-  "olpc-dcon:  couldn't enable scanline 
interrupt!\n");
+   pr_err("couldn't enable scanline interrupt!\n&qu

Re: [PATCH] staging/olpc_dcon: fix checkpatch warnings

2012-07-26 Thread Toshiaki Yamane
On Fri, Jul 27, 2012 at 2:03 PM, Joe Perches  wrote:
> On Fri, 2012-07-27 at 13:46 +0900, Toshiaki Yamane wrote:
>> fixed some checkpatch warnings.
>> (Excluding -WARNING: msleep < 20ms can sleep for up to 20ms-)
> []
>> diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
>> b/drivers/staging/olpc_dcon/olpc_dcon.c
> []
>> @@ -71,18 +72,18 @@ static int dcon_hw_init(struct dcon_priv *dcon, int 
>> is_init)
>>
>>   ver = dcon_read(dcon, DCON_REG_ID);
>>   if ((ver >> 8) != 0xDC) {
>> - printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x 
>> instead.\n",
>> - ver);
>> + pr_err("DCON ID not 0xDCxx: 0x%04x instead.\n",
>> +ver);
>
> Please fit arguments on a single line where feasible.

I agree.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging/olpc_dcon: fix checkpatch warnings

2012-07-26 Thread Toshiaki Yamane
fixed some checkpatch warnings.
(Excluding -WARNING: msleep < 20ms can sleep for up to 20ms-)

$ find drivers/staging/olpc_dcon/ -name "*.[ch]"|xargs ./scripts/checkpatch.pl \
-f --terse --nosummary|cut -f3- -d":"|sort |uniq -c|sort -n
  2  WARNING: msleep < 20ms can sleep for up to 20ms; see 
Documentation/timers/timers-howto.txt
  3  WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
  3  WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
  6  WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
 19  WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

And added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/olpc_dcon/olpc_dcon.c|   52 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c   |   15 ---
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c |6 ++-
 3 files changed, 39 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
b/drivers/staging/olpc_dcon/olpc_dcon.c
index 992275c..f092c80 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -11,6 +11,7 @@
  * License as published by the Free Software Foundation.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include 
 #include 
@@ -71,18 +72,18 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
 
ver = dcon_read(dcon, DCON_REG_ID);
if ((ver >> 8) != 0xDC) {
-   printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x 
instead.\n",
-   ver);
+   pr_err("DCON ID not 0xDCxx: 0x%04x instead.\n",
+  ver);
rc = -ENXIO;
goto err;
}
 
if (is_init) {
-   printk(KERN_INFO "olpc-dcon:  Discovered DCON version %x\n",
-   ver & 0xFF);
+   pr_info("Discovered DCON version %x\n",
+   ver & 0xFF);
rc = pdata->init(dcon);
if (rc != 0) {
-   printk(KERN_ERR "olpc-dcon:  Unable to init.\n");
+   pr_err("Unable to init.\n");
goto err;
}
}
@@ -136,7 +137,7 @@ power_up:
x = 1;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x) {
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power up: %d!\n",
+   pr_warn("unable to force dcon to power up: %d!\n",
x);
return x;
}
@@ -150,7 +151,7 @@ power_up:
x = dcon_read(dcon, DCON_REG_ID);
}
if (x < 0) {
-   printk(KERN_ERR "olpc-dcon:  unable to stabilize dcon's smbus, 
reasserting power and praying.\n");
+   pr_err("unable to stabilize dcon's smbus, reasserting power and 
praying.\n");
BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
x = 0;
olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
@@ -221,7 +222,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
x = 0;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power down: %d!\n",
+   pr_warn("unable to force dcon to power down: %d!\n",
x);
else
dcon->asleep = sleep;
@@ -231,7 +232,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
dcon->disp_mode |= MODE_BL_ENABLE;
x = dcon_bus_stabilize(dcon, 1);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to reinit dcon 
hardware: %d!\n",
+   pr_warn("unable to reinit dcon hardware: %d!\n",
x);
else
dcon->asleep = sleep;
@@ -303,12 +304,11 @@ static void dcon_source_switch(struct work_struct *work)
 
switch (source) {
case DCON_SOURCE_CPU:
-   printk(KERN_INFO "dcon_source_switch to CPU\n");
+   pr_info("dcon_source_switch to CPU\n");
/* Enable the scanline interrupt bit */
if (dcon_write(dcon, DCON_REG_MODE,
dcon->disp_mode | MODE_SCAN_INT))
-   printk(KERN_ERR
-  "olpc-dcon:  couldn't enable scanline 
interrupt!\n");
+   pr_err("couldn't enable scanline interrupt!\n");

Re: [PATCH] staging/olpc_dcon: fix checkpatch warnings

2012-07-26 Thread Toshiaki Yamane
On Fri, Jul 27, 2012 at 11:28 AM, Andres Salomon  wrote:
> On Fri, 27 Jul 2012 08:49:19 +0900
> Toshiaki Yamane  wrote:
>
>> Now checkpatch clean.
>>
>> $ find drivers/staging/olpc_dcon/ -name
>> "*.[ch]"|xargs ./scripts/checkpatch.pl \ -f --terse --nosummary|cut
>> -f3- -d":"|sort |uniq -c|sort -n 2  WARNING: msleep < 20ms can sleep
>> for up to 20ms; see Documentation/timers/timers-howto.txt 3  WARNING:
>
> NACK - please don't modify the msleep timings right now.  The pr_*
> changes are welcome, however.
>

I agree.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging/olpc_dcon: fix checkpatch warnings

2012-07-26 Thread Toshiaki Yamane
On Fri, Jul 27, 2012 at 10:40 AM, Joe Perches  wrote:
> On Fri, 2012-07-27 at 08:49 +0900, Toshiaki Yamane wrote:
>> Now checkpatch clean.
> []
>> diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
>> b/drivers/staging/olpc_dcon/olpc_dcon.c
> []
>> @@ -11,6 +11,7 @@
> []
>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> []
>> @@ -71,18 +72,18 @@ static int dcon_hw_init(struct dcon_priv *dcon, int 
>> is_init)
>>
>>   ver = dcon_read(dcon, DCON_REG_ID);
>>   if ((ver >> 8) != 0xDC) {
>> - printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x 
>> instead.\n",
>> - ver);
>> + pr_err("olpc-dcon:  DCON ID not 0xDCxx: 0x%04x instead.\n",
>> +ver);
>>   rc = -ENXIO;
>>   goto err;
>>   }
>>
>>   if (is_init) {
>> - printk(KERN_INFO "olpc-dcon:  Discovered DCON version %x\n",
>> - ver & 0xFF);
>> + pr_info("olpc-dcon:  Discovered DCON version %x\n",
>> + ver & 0xFF);
>
> Hello.
>
> Please remove all the embedded "olpc-dcon: " prefixes.
> There is a pr_fmt define that adds "olpc_dcon" already.
>
> You can use the strings program on the output .o files to
> verify the formats that are produced.
>

Thanks for your reply.

I was able to check for duplicates in strings.
I will try to fix with care.




-- 

Regards,


 .
  .
...

Yamane Toshiaki

yamaneto...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging/olpc_dcon: fix checkpatch warnings

2012-07-26 Thread Toshiaki Yamane
Now checkpatch clean.

$ find drivers/staging/olpc_dcon/ -name "*.[ch]"|xargs ./scripts/checkpatch.pl \
-f --terse --nosummary|cut -f3- -d":"|sort |uniq -c|sort -n
  2  WARNING: msleep < 20ms can sleep for up to 20ms; see 
Documentation/timers/timers-howto.txt
  3  WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
  3  WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
  6  WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
 19  WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

And added pr_fmt.

Signed-off-by: Toshiaki Yamane 
---
 drivers/staging/olpc_dcon/olpc_dcon.c|   56 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c   |   15 ---
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c |6 ++-
 3 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
b/drivers/staging/olpc_dcon/olpc_dcon.c
index 992275c..4e6efc1 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -11,6 +11,7 @@
  * License as published by the Free Software Foundation.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include 
 #include 
@@ -71,18 +72,18 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
 
ver = dcon_read(dcon, DCON_REG_ID);
if ((ver >> 8) != 0xDC) {
-   printk(KERN_ERR "olpc-dcon:  DCON ID not 0xDCxx: 0x%04x 
instead.\n",
-   ver);
+   pr_err("olpc-dcon:  DCON ID not 0xDCxx: 0x%04x instead.\n",
+  ver);
rc = -ENXIO;
goto err;
}
 
if (is_init) {
-   printk(KERN_INFO "olpc-dcon:  Discovered DCON version %x\n",
-   ver & 0xFF);
+   pr_info("olpc-dcon:  Discovered DCON version %x\n",
+   ver & 0xFF);
rc = pdata->init(dcon);
if (rc != 0) {
-   printk(KERN_ERR "olpc-dcon:  Unable to init.\n");
+   pr_err("olpc-dcon:  Unable to init.\n");
goto err;
}
}
@@ -136,21 +137,21 @@ power_up:
x = 1;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x) {
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power up: %d!\n",
+   pr_warn("olpc-dcon:  unable to force dcon to power up: 
%d!\n",
x);
return x;
}
-   msleep(10); /* we'll be conservative */
+   usleep_range(1, 2);
}
 
pdata->bus_stabilize_wiggle();
 
for (x = -1, timeout = 50; timeout && x < 0; timeout--) {
-   msleep(1);
+   usleep_range(1000, 2000);
x = dcon_read(dcon, DCON_REG_ID);
}
if (x < 0) {
-   printk(KERN_ERR "olpc-dcon:  unable to stabilize dcon's smbus, 
reasserting power and praying.\n");
+   pr_err("olpc-dcon:  unable to stabilize dcon's smbus, 
reasserting power and praying.\n");
BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
x = 0;
olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
@@ -221,7 +222,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
x = 0;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to force dcon 
to power down: %d!\n",
+   pr_warn("olpc-dcon:  unable to force dcon to power 
down: %d!\n",
x);
else
dcon->asleep = sleep;
@@ -231,7 +232,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
dcon->disp_mode |= MODE_BL_ENABLE;
x = dcon_bus_stabilize(dcon, 1);
if (x)
-   printk(KERN_WARNING "olpc-dcon:  unable to reinit dcon 
hardware: %d!\n",
+   pr_warn("olpc-dcon:  unable to reinit dcon hardware: 
%d!\n",
x);
else
dcon->asleep = sleep;
@@ -303,12 +304,11 @@ static void dcon_source_switch(struct work_struct *work)
 
switch (source) {
case DCON_SOURCE_CPU:
-   printk(KERN_INFO "dcon_source_switch to CPU\n");
+   pr_info("dcon_source_switch to CPU\n");
/* Enable the scanline interrupt bit */
if (dcon_write(dcon, DCON_REG_MODE,
dco

  1   2   >