[PATCH] Staging: ft1000: fixed coding style issues

2013-11-10 Thread Aldo Iljazi
Fixed the following coding style issues:

Lines 84-91,99-106,275,514: Replaced spaces at the start of the lines
with tabs.

Lines 205,271: Inserted spaces after the commas.
Lines 275,1060,1065: Indented the code with tabs instead of spaces.

Line 275: Inserted spaces around '=' and '<', also moved the trailing
statement on the next line.

Line 512: Removed space between function name and open parenthesis.
Line 839: Removed space after '&'.
Line 853: Removed space after '&'.

Signed-off-by: Aldo Iljazi 
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c| 57 +++---
 1 file changed, 29 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c 
b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 68ded17..170908a 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -81,29 +81,29 @@
 #define  DWNLD_MAG1_PS_HDR_LOC0x03
 
 struct dsp_file_hdr {
-   long  version_id;  // Version ID of this image format.
-   long  package_id;  // Package ID of code release.
-   long  build_date;  // Date/time stamp when file was 
built.
-   long  commands_offset; // Offset to attached commands in 
Pseudo Hdr format.
-   long  loader_offset;   // Offset to bootloader code.
-   long  loader_code_address; // Start address of bootloader.
-   long  loader_code_end; // Where bootloader code ends.
-   long  loader_code_size;
-   long  version_data_offset; // Offset were scrambled version 
data begins.
-   long  version_data_size;   // Size, in words, of scrambled 
version data.
-   long  nDspImages;  // Number of DSP images in file.
+   long  version_id;  // Version ID of this image 
format.
+   long  package_id;  // Package ID of code release.
+   long  build_date;  // Date/time stamp when file was 
built.
+   long  commands_offset; // Offset to attached commands 
in Pseudo Hdr format.
+   long  loader_offset;   // Offset to bootloader code.
+   long  loader_code_address; // Start address of bootloader.
+   long  loader_code_end; // Where bootloader code ends.
+   long  loader_code_size;
+   long  version_data_offset; // Offset were scrambled version 
data begins.
+   long  version_data_size;   // Size, in words, of scrambled 
version data.
+   long  nDspImages;  // Number of DSP images in file.
 };
 
 #pragma pack(1)
 struct dsp_image_info {
-   long  coff_date;   // Date/time when DSP Coff image was 
built.
-   long  begin_offset;// Offset in file where image begins.
-   long  end_offset;  // Offset in file where image begins.
-   long  run_address; // On chip Start address of DSP code.
-   long  image_size;  // Size of image.
-   long  version; // Embedded version # of DSP code.
-   unsigned shortchecksum;// DSP File checksum
-   unsigned shortpad1;
+   long  coff_date;   // Date/time when DSP Coff image 
was built.
+   long  begin_offset;// Offset in file where image 
begins.
+   long  end_offset;  // Offset in file where image 
begins.
+   long  run_address; // On chip Start address of DSP 
code.
+   long  image_size;  // Size of image.
+   long  version; // Embedded version # of DSP 
code.
+   unsigned shortchecksum;// DSP File checksum
+   unsigned shortpad1;
 };
 
 
@@ -202,7 +202,7 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 
expected_value)
 }
 
 /* write the handshake value to the handshake location */
-static void put_handshake(struct ft1000_usb *ft1000dev,u16 handshake_value)
+static void put_handshake(struct ft1000_usb *ft1000dev, u16 handshake_value)
 {
u32 tempx;
u16 tempword;
@@ -268,11 +268,12 @@ static u16 get_handshake_usb(struct ft1000_usb 
*ft1000dev, u16 expected_value)
return HANDSHAKE_TIMEOUT_VALUE;
 }
 
-static void put_handshake_usb(struct ft1000_usb *ft1000dev,u16 handshake_value)
+static void put_handshake_usb(struct ft1000_usb *ft1000dev, u16 
handshake_value)
 {
int i;
 
-for (i=0; i<1000; i++);
+   for (i = 0; i < 1000; i++)
+   ;
 }
 
 static u16 get_request_type(struct ft1000_usb *ft1000dev)
@@ -509,9 +510,9 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 
**pUsFile, u8 **pUcFile,
return status;
 }
 
-static void usb_dnld_complete (struct urb *urb)
+static void usb_

[PATCH 2/2] staging: cxt1e1: comet: fixed some brace coding style issues.

2013-11-10 Thread Joachim Adolf Schuetz
Fixed some coding style issues - a few braces and indentions.

Signed-off-by: Joachim Adolf Schuetz 
---
 drivers/staging/cxt1e1/comet.c |   31 +--
 1 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/cxt1e1/comet.c b/drivers/staging/cxt1e1/comet.c
index 46a0d92..b130ad1 100644
--- a/drivers/staging/cxt1e1/comet.c
+++ b/drivers/staging/cxt1e1/comet.c
@@ -159,8 +159,7 @@ void init_comet(void *ci, comet_t *comet, u_int32_t 
port_mode, int clockmaster,
 /* 60: t1 ALMI cfg */
 /* Configure Line Coding */
 
-   switch (port_mode)
-   {
+   switch (port_mode) {
/* 1 - T1 B8ZS */
case CFG_FRAME_SF:
pci_write_32((u_int32_t *) &comet->cdrc_cfg, 0);
@@ -286,8 +285,7 @@ void init_comet(void *ci, comet_t *comet, u_int32_t 
port_mode, int clockmaster,
 
 /* 0x30: "BRIF cfg"; 0x20 is 'CMODE', 0x03 is (bit) rate */
 /* note "rate bits can only be set once after reset" */
-   if (clockmaster)
-   {
+   if (clockmaster) {
/* CMODE == clockMode, 0=clock master (so all 3 others should 
be slave) */
/* rate = 1.544 Mb/s */
if (isT1mode)
@@ -302,8 +300,7 @@ void init_comet(void *ci, comet_t *comet, u_int32_t 
port_mode, int clockmaster,
 
/* Master Mode i.e.FPMODE=0 (@0x20) */
pci_write_32((u_int32_t *) &comet->brif_fpcfg, 0x00);
-   if ((moreParams & CFG_CLK_PORT_MASK) == CFG_CLK_PORT_INTERNAL)
-   {
+   if ((moreParams & CFG_CLK_PORT_MASK) == CFG_CLK_PORT_INTERNAL) {
if (cxt1e1_log_level >= LOG_SBEBUG12)
pr_info(">> %s: clockmaster internal clock\n", 
__func__);
/* internal oscillator */
@@ -422,8 +419,7 @@ WrtXmtWaveformTbl(ci_t *ci, comet_t *comet,
 {
u_int32_t sample, unit;
 
-   for (sample = 0; sample < COMET_NUM_SAMPLES; sample++)
-   {
+   for (sample = 0; sample < COMET_NUM_SAMPLES; sample++) {
for (unit = 0; unit < COMET_NUM_UNITS; unit++)
WrtXmtWaveform(ci, comet, sample, unit, 
table[sample][unit]);
}
@@ -554,8 +550,7 @@ SetCometOps(comet_t *comet)
 {
volatile u_int8_t rd_value;
 
-   if (comet == mConfig.C4Func1Base + (COMET0_OFFSET >> 2))
-   {
+   if (comet == mConfig.C4Func1Base + (COMET0_OFFSET >> 2)) {
/* read the BRIF Configuration */
rd_value = (u_int8_t) pci_read_32((u_int32_t *) 
&comet->brif_cfg);
rd_value &= ~0x20;
@@ -565,14 +560,14 @@ SetCometOps(comet_t *comet)
rd_value &= ~0x20;
pci_write_32((u_int32_t *) &comet->brif_fpcfg, (u_int8_t) 
rd_value);
} else {
-   /* read the BRIF Configuration */
-   rd_value = (u_int8_t) pci_read_32((u_int32_t *) &comet->brif_cfg);
-   rd_value |= 0x20;
-   pci_write_32((u_int32_t *) &comet->brif_cfg, (u_int32_t) rd_value);
-   /* read the BRIF Frame Pulse Configuration */
-   rd_value = (u_int8_t) pci_read_32((u_int32_t *) &comet->brif_fpcfg);
-   rd_value |= 0x20;
-   pci_write_32(u_int32_t *) & comet->brif_fpcfg, (u_int8_t) rd_value);
+   /* read the BRIF Configuration */
+   rd_value = (u_int8_t) pci_read_32((u_int32_t *) 
&comet->brif_cfg);
+   rd_value |= 0x20;
+   pci_write_32((u_int32_t *) &comet->brif_cfg, (u_int32_t) 
rd_value);
+   /* read the BRIF Frame Pulse Configuration */
+   rd_value = (u_int8_t) pci_read_32((u_int32_t *) 
&comet->brif_fpcfg);
+   rd_value |= 0x20;
+   pci_write_32(u_int32_t *) & comet->brif_fpcfg, (u_int8_t) 
rd_value);
}
 }
 #endif
-- 
1.7.2.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ced401: ced_ioc: fix a blank/tab codingstyle issue.

2013-11-10 Thread Joachim Adolf Schuetz
From: Joachim Adi Schuetz 

Fixed a coding style issue - removed a blank before a tab.

Signed-off-by: Joachim Adolf Schuetz 
---
 drivers/staging/ced1401/ced_ioc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/ced1401/ced_ioc.c 
b/drivers/staging/ced1401/ced_ioc.c
index 62efd74..043a932 100644
--- a/drivers/staging/ced1401/ced_ioc.c
+++ b/drivers/staging/ced1401/ced_ioc.c
@@ -630,7 +630,7 @@ int ClearArea(DEVICE_EXTENSION *pdx, int nArea)
}
spin_unlock_irq(&pdx->stagedLock);
 
-   if (pPages) {   /*  if we decided to release the memory 
*/
+   if (pPages) {   /*  if we decided to release the memory 
*/
/*  Now we must undo the pinning down of the 
pages. We will assume the worst and mark */
/*  all the pages as dirty. Don't be tempted to 
move this up above as you must not be */
/*  holding a spin lock to do this stuff as it 
is not atomic. */
-- 
1.7.2.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: go7007: fix use of uninitialised pointer

2013-11-10 Thread Greg Kroah-Hartman
On Sun, Nov 10, 2013 at 07:37:57PM +0100, Michal Nazarewicz wrote:
> From: Michal Nazarewicz 
> 
> The go variable is declade without initialisation and invocation of
> dev_dbg immediatelly tries to dereference it.
> ---
>  drivers/staging/media/go7007/go7007-usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/go7007/go7007-usb.c 
> b/drivers/staging/media/go7007/go7007-usb.c
> index 58684da..457ab63 100644
> --- a/drivers/staging/media/go7007/go7007-usb.c
> +++ b/drivers/staging/media/go7007/go7007-usb.c
> @@ -1057,7 +1057,7 @@ static int go7007_usb_probe(struct usb_interface *intf,
>   char *name;
>   int video_pipe, i, v_urb_len;
>  
> - dev_dbg(go->dev, "probing new GO7007 USB board\n");
> + pr_debug("probing new GO7007 USB board\n");

Please either delete this entirely, or use the struct device in the
usb_interface pointer.

A driver should never have a "raw" pr_* call.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/7] staging: go7007: fix use of uninitialised pointer

2013-11-10 Thread Michal Nazarewicz

Signed-off-by: Michal Nazarewicz 
---
 drivers/staging/media/go7007/go7007-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

On Sun, Nov 10 2013, Greg Kroah-Hartman wrote:
> Please either delete this entirely, or use the struct device in the
> usb_interface pointer.
>
> A driver should never have a "raw" pr_* call.

diff --git a/drivers/staging/media/go7007/go7007-usb.c 
b/drivers/staging/media/go7007/go7007-usb.c
index 58684da..e8c708c 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -1057,7 +1057,7 @@ static int go7007_usb_probe(struct usb_interface *intf,
char *name;
int video_pipe, i, v_urb_len;
 
-   dev_dbg(go->dev, "probing new GO7007 USB board\n");
+   dev_dbg(&intf->dev, "probing new GO7007 USB board\n");
 
switch (id->driver_info) {
case GO7007_BOARDID_MATRIX_II:
-- 
1.8.3.2
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/7] staging: go7007: fix use of uninitialised pointer

2013-11-10 Thread Dan Carpenter
There are 3 other uses before "go" gets initialized.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: fix potentially uninitialised variable

2013-11-10 Thread Dan Carpenter
On Sun, Nov 10, 2013 at 07:37:49PM +0100, Michal Nazarewicz wrote:
> From: Michal Nazarewicz 
> 
> If none of the if conditions take a true path, the ret variable will
> never be assigned a value.

Don't use a From: unless you are sending it on behalf of another sender.

You need a Signed-off-by line and it has to match your email address
which you used to send the email.

Otherwise, the patch is good an fixes an important bug.

regards,
dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel