Re: [V2 PATCH 02/10] added media agnostic (MA) USB HCD roothubs

2014-11-12 Thread Oliver Neukum
On Mon, 2014-11-10 at 18:09 -0800, Stephanie Wallick wrote:
> This is where we implement USB 2.0 and 3.0 roothubs. From the host's
> perspective, hub state is set and tracked just like any other USB roothub.
> Likewise, requests to the roothub appear to be handled like any other wired
> USB request.
> 
> Signed-off-by: Sean O. Stalley 
> Signed-off-by: Stephanie Wallick 
> ---
>  drivers/staging/mausb/drivers/mausb_hub.c | 849 
> ++
>  drivers/staging/mausb/drivers/mausb_hub.h | 128 +
>  2 files changed, 977 insertions(+)
>  create mode 100644 drivers/staging/mausb/drivers/mausb_hub.c
>  create mode 100644 drivers/staging/mausb/drivers/mausb_hub.h
> 
> diff --git a/drivers/staging/mausb/drivers/mausb_hub.c 
> b/drivers/staging/mausb/drivers/mausb_hub.c
> new file mode 100644
> index 000..63c0fe4
> --- /dev/null
> +++ b/drivers/staging/mausb/drivers/mausb_hub.c

> +/**
> + * Returns true if the given is the superspeed HCD. Note: The primary HCD is
> + * High Speed and the shared HCD is SuperSpeed.
> + */

Why in that order?

> +bool mausb_is_ss_hcd(struct usb_hcd *hcd)
> +{
> + if (usb_hcd_is_primary_hcd(hcd))
> + return false;
> + else
> + return true;
> +}



> +
> +/**
> + * Called by usb core when polling for a port status change.
> + *
> + * @hcd: USB HCD being polled.
> + * @buf: Holds port status changes (if any).
> + *
> + * Returns zero if there is no status change, otherwise returns number of
> + * bytes in buf. When there is a status change on a port, the bit indexed
> + * at the port number + 1 (e.g. bit 2 for port 1) is set in the buffer.
> + */
> +int mausb_hub_status_data(struct usb_hcd *hcd, char *buf)
> +{
> + int  i;
> + u16  port_change = 0;
> + u32  status = 0;
> + int  ret = 1;
> + struct mausb_hcd *mhcd = usb_hcd_to_mausb_hcd(hcd);
> + struct mausb_root_hub*roothub = usb_hcd_to_roothub(hcd);
> +
> + /*
> +  * Buf should never be more that 2 bytes. USB 3.0 hubs cannot have
> +  * more than 15 downstream ports.
> +  */
> + buf[0] = 0;
> + if (MAUSB_ROOTHUB_NUM_PORTS > 7) {
> + buf[1] = 0;
> + ret++;
> + }

Endianness bug.

> +
> + for (i = 0; i < MAUSB_ROOTHUB_NUM_PORTS; i++) {
> + port_change = roothub->port_status[i].wPortChange;
> + if (port_change)
> + status |= (1 << (i + 1));
> + }
> +
> + mausb_dbg(mhcd, "%s: hub status is 0x%x\n", __func__, status);
> +
> + /* hcd might be suspended, resume if there is a status change */
> + if (mhcd->disabled == 0) {
> + if ((hcd->state == HC_STATE_SUSPENDED) && status)
> + usb_hcd_resume_root_hub(hcd);
> + }
> +
> + memcpy(buf, (char *)&status, ret);
> +
> + return status ? ret : 0;
> +}
> +
> +/**
> + * Sets the bitfields in the hub descriptor of the 2.0 root hub. Always
> + * returns zero.
> + */
> +int mausb_set_hub_descriptor(struct usb_hub_descriptor *hub_des)
> +{
> + /* set the values to the default */
> + hub_des->bDescLength  = sizeof(struct usb_hub_descriptor);
> + hub_des->bDescriptorType  = USB_DT_HUB;
> + hub_des->bNbrPorts= MAUSB_ROOTHUB_NUM_PORTS;
> + hub_des->wHubCharacteristics  = MAUSB_ROOTHUB_CHAR;
> + hub_des->bPwrOn2PwrGood   = MAUSB_ROOTHUB_PWR_ON_2_PWR_GOOD;
> + hub_des->bHubContrCurrent = MAUSB_ROOTHUB_CONTR_CURRENT;

Is that descriptor in bus or host endianness?

> +
> + return 0;
> +}
> +
> +/**
> + * Sets the bitfields in the hub descriptor of the 3.0 root hub. Always
> + * returns zero.

Then why return anything?

> + */
> +int mausb_set_ss_hub_descriptor(struct usb_hub_descriptor *hub_des)
> +{
> + /* set the values to the default */
> + hub_des->bDescLength  = sizeof(struct usb_hub_descriptor);
> + hub_des->bDescriptorType  = USB_DT_SS_HUB;
> + hub_des->bNbrPorts= MAUSB_ROOTHUB_NUM_PORTS;
> + hub_des->wHubCharacteristics  = MAUSB_ROOTHUB_CHAR;
> + hub_des->bPwrOn2PwrGood   = MAUSB_ROOTHUB_PWR_ON_2_PWR_GOOD;
> + hub_des->bHubContrCurrent = MAUSB_ROOTHUB_CONTR_CURRENT;
> +
> + /* USB3-specific parameters */
> + hub_des->u.ss.bHubHdrDecLat   = MAUSB_ROOTHUB_HDR_DEC_LAT;
> + hub_des->u.ss.wHubDelay   = MAUSB_ROOTHUB_DELAY;
> + hub_des->u.ss.DeviceRemovable = MAUSB_ALL_DEV_REMOVABLE;
> +
> + return 0;
> +}


> +/**
> + * Contains all the structures required to emulate a root hub. One instance
> + * exists per root hub.
> + */
> +struct __attribute__((__packed__)) mausb_root_hub {

Why __packed__ ?
> +
> + /* hub parameters */
> + struct usb_hub_descriptor descriptor;
> + struct usb_hub_status status;
> +
> + /* port parameters*/
> + struct usb_port_statusport_status[MAUSB_ROOTHUB_NUM_PORTS];
> +
> +   

Re: [PATCH 01/10] staging: unisys: PARSER_CONTEXT_Tag camel case

2014-11-12 Thread Dan Carpenter
Use your full name in the From and Signed-off-by.  It's like signing a
legal document to show that you haven't violated copyright in sending
this patch.

regards,
dan carpenter


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


Re: [PATCH 02/10] staging: unisys: parser_init isLocal camel case

2014-11-12 Thread Dan Carpenter
On Tue, Nov 11, 2014 at 09:46:11AM -0500, Jeffrey wrote:
> Changed the camel case isLocal to islocal in the struct pointer
> parser_init on line 36
> isLocal => islocal

islocal is hard to read.  Use "is_local" instead.  Also you may as well
fix the .c file at the same time.

regards,
dan carpenter

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


Re: [PATCH 03/10] staging: unisys: parser_init tryAgain camel case

2014-11-12 Thread Dan Carpenter
On Tue, Nov 11, 2014 at 09:46:12AM -0500, Jeffrey wrote:
> Changed the camel case tryAgain to tryagain in the struct pointer
> parser_init on line 36 of parser.h
> tryAgain => tryagain

Gar...  No.  Don't fix a single word at a time.  This is going to take
forever.

regards,
dan carpenter

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


Re: [PATCH 10/10] staging: unisys: PARSER_WHICH_STRING typedef

2014-11-12 Thread Dan Carpenter
On Tue, Nov 11, 2014 at 09:46:19AM -0500, Jeffrey wrote:
> Removed the typedef PARSER_WHICH_STRING in parser.h and added enum
> in front of it at every instance of the variable in parser.c, and
> parser.h
> 
> Signed-off-by: Jeffrey 
> ---
>  drivers/staging/unisys/visorchipset/parser.c | 2 +-
>  drivers/staging/unisys/visorchipset/parser.h | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchipset/parser.c 
> b/drivers/staging/unisys/visorchipset/parser.c
> index c38de48..20df56f 100644
> --- a/drivers/staging/unisys/visorchipset/parser.c
> +++ b/drivers/staging/unisys/visorchipset/parser.c
> @@ -211,7 +211,7 @@ parser_id_get(struct parser_context_tag *ctx)
>  
>  void
>  parser_param_start(struct parser_context_tag *ctx,
> -PARSER_WHICH_STRING which_string)
> +enum PARSER_WHICH_STRING which_string)

Change the PARSER_WHICH_STRING from all caps at the same time.  Also
what does that name even mean?

regards,
dan carpenter

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


Re: [PATCH] hv: hv_fcopy: drop the obsolete message on transfer failure

2014-11-12 Thread Vitaly Kuznetsov
Dexuan Cui  writes:

> In the case the user-space daemon crashes, hangs or is killed, we
> need to down the semaphore, otherwise, after the daemon starts next
> time, the obsolete data in fcopy_transaction.message or
> fcopy_transaction.fcopy_msg will be used immediately.
>
> Cc: K. Y. Srinivasan 
> Signed-off-by: Dexuan Cui 

Reviewed-by: Vitaly Kuznetsov 

> ---
>  drivers/hv/hv_fcopy.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
> index 23b2ce2..177122a 100644
> --- a/drivers/hv/hv_fcopy.c
> +++ b/drivers/hv/hv_fcopy.c
> @@ -86,6 +86,15 @@ static void fcopy_work_func(struct work_struct *dummy)
>* process the pending transaction.
>*/
>   fcopy_respond_to_host(HV_E_FAIL);
> +
> + /* In the case the user-space daemon crashes, hangs or is killed, we
> +  * need to down the semaphore, otherwise, after the daemon starts next
> +  * time, the obsolete data in fcopy_transaction.message or
> +  * fcopy_transaction.fcopy_msg will be used immediately.
> +  */
> + if (down_trylock(&fcopy_transaction.read_sema))
> + pr_debug("FCP: failed to acquire the semaphore\n");
> +
>  }
>
>  static int fcopy_handle_handshake(u32 version)

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


Re: [PATCH 12/30] staging: comedi: dmm32at: use 8255 module for Digital I/O subdevice

2014-11-12 Thread Ian Abbott

On 11/11/14 23:55, H Hartley Sweeten wrote:

The Dimond-MM-32-AT board uses an internal 82C55-type digital I/O circuit to
provide the 24 digital I/O lines. The only quirk is the need to set the page
selection bits in the control register to select page 1 addresses.

Instead of duplicating the 8255 code, provide an (*io) callback and use the
8255 module to support this subdevice.

This also removes the need for the private data in this driver.


The patch is fine, but there's a bug in the original code which means we 
might need the private data back (unless the DMM32AT_CNTRL register is 
read-write rather than read-only).  The bug is that the ISR routine 
clobbers the page selection bits in the register.  To avoid that, the 
current page would either need to be stored in private data or read from 
the register (if possible) to avoid clobbering it, and updates to the 
register would need a spin-lock.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/30] staging: comedi: dmm32at: cleanup driver

2014-11-12 Thread Ian Abbott

On 11/11/14 23:55, H Hartley Sweeten wrote:

Here's the big cleanup series for the dmm32at comedi driver.

H Hartley Sweeten (30):
   staging: comedi: dmm32at: make AI (*cancel) actually cancel async command
   staging: comedi: dmm32at: use comedi_async 'scans_done' to detect EOA
   staging: comedi: dmm32at: introduce dmm32_ai_get_sample()
   staging: comedi: dmm32at: tidy up dmm32at_ai_rinsn()
   staging: comedi: dmm32at: introduce dmm32at_reset()
   staging: comedi: dmm32at: tidy up subdevice initialization
   staging: comedi: dmm32at: tidy up cmd->scan_begin_{src,arg} validation
   staging: comedi: dmm32at: tidy up cmd->convert_{src,arg} validation
   staging: comedi: dmm32at: remove dmm32at_ns_to_timer()
   staging: comedi: dmm32at: remove unused members of the private data
   staging: comedi: dmm32at: introduce dmm32at_ai_set_chanspec()
   staging: comedi: dmm32at: use 8255 module for Digital I/O subdevice
   staging: comedi: dmm32at: rename DMM32AT_CONV
   staging: comedi: dmm32at: rename DMM32AT_AI[LM]SB
   staging: comedi: dmm32at: rename DMM32AT_AUXDOUT
   staging: comedi: dmm32at: rename DMM32AT_AI{LOW,HIGH}
   staging: comedi: dmm32at: rename DMM32AT_DAC[LM]SB
   staging: comedi: dmm32at: rename DMM32AT_DACSTAT
   staging: comedi: dmm32at: rename DMM32AT_DACMSB_CHAN
   staging: comedi: dmm32at: define the FIFO Depth register
   staging: comedi: dmm32at: rename DMM32AT_FIFOCNTRL
   staging: comedi: dmm32at: rename DMM32AT_FIFOSTAT
   staging: comedi: dmm32at: rename DMM32AT_CNTRL
   staging: comedi: dmm32at: rename DMM32AT_AISTAT
   staging: comedi: dmm32at: rename DMM32AT_INTCLOCK
   staging: comedi: dmm32at: rename DMM32AT_CNTRDIO
   staging: comedi: dmm32at: rename DMM32AT_AICONF
   staging: comedi: dmm32at: rename DMM32AT_AIRBACK
   staging: comedi: dmm32at: tidy up multi-line comments
   staging: comedi: dmm32at: update the MODULE_DESCRIPTION

  drivers/staging/comedi/Kconfig   |   1 +
  drivers/staging/comedi/drivers/dmm32at.c | 700 ---
  2 files changed, 275 insertions(+), 426 deletions(-)


Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH with SmPL?] staging: rtl8188eu: Adjustments around jump labels

2014-11-12 Thread SF Markus Elfring
 @@ -212,8 +212,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16
 _size_byte, u8  *pbuf)
  exit:
kfree(efuseTbl);

 -  if (eFuseWord)
 -  kfree(eFuseWord);
 +  kfree(eFuseWord);
>>>
>>> I think that this code has been updated already.  It would be better to
>>> add labels so that kfree is only executed when needed.
>>
>> Are there any chances to achieve the suggested fine-tuning for jump labels
>> also with another semantic patch approach?
> 
> No, I don't think so.  The pattern is not regular enough.

Now I have got a different impression for corresponding improvement 
possibilities.


elfring@Sonne:~/Projekte/Linux/stable-patched> spatch.opt -debug -sp-file 
~/Projekte/Coccinelle/janitor/move_function_call_before_jump_label1.cocci 
drivers/staging/rtl8188eu/core/rtw_efuse.c
init_defs_builtins: /usr/local/share/coccinelle/standard.h
---
processing semantic patch file: 
/home/elfring/Projekte/Coccinelle/janitor/move_function_call_before_jump_label1.cocci
with isos from: /usr/local/share/coccinelle/standard.iso
---
@move_function_call_before_jump_label@
expression x;
identifier fu, label;
type t;
@@
 t fu(...)
 {
  ... when any
  x = kzalloc(...);
  if (x == NULL) {
 ...
 goto label;
  }
  ... when any
+kfree(x);
  label:
-kfree(x);
  ...
 }

HANDLING: drivers/staging/rtl8188eu/core/rtw_efuse.c
---
let's go
---
---
---
move_function_call_before_jump_label = 
---
dependencies for rule move_function_call_before_jump_label satisfied:
binding in = []
binding relevant in = []
 (ONCE) USING optional_storage builtin isomorphism
 transformation info returned:
  transform state: 5
   with rule_elem: 
 <<< 
kfree(move_function_call_before_jump_label:x);
   move_function_call_before_jump_label:label:
   with binding: [move_function_call_before_jump_label.x --> 
efuseTbl]
  transform state: 204
   with rule_elem: 
-kfree-(-move_function_call_before_jump_label:x-)-;
   with binding: [move_function_call_before_jump_label.x --> 
efuseTbl]
 binding out = []
 transform one node: 204
 transform one node: 5
---
Finished
---
diff = 
--- drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ /tmp/cocci-output-4498-349827-rtw_efuse.c
@@ -209,8 +209,8 @@ efuse_phymap_to_logical(u8 *phymap, u16
/*  5. Calculate Efuse utilization. */
/*  */
 
+kfree(efuseTbl);
 exit:
-   kfree(efuseTbl);
 
kfree(eFuseWord);
 }
Check duplication for 1 files



Can my update suggestion be generalised a bit more for the movement of specific 
jump labels
towards the end of a function implementation like in the use case 
"efuse_phymap_to_logical()"?

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


Re: [PATCH 03/10] staging: rtl8723au: rtw_put_snap23a(): Use put_unaligned to set protocol

2014-11-12 Thread Dan Carpenter
On Mon, Nov 10, 2014 at 06:11:39PM -0500, jes.soren...@redhat.com wrote:
> diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
> b/drivers/staging/rtl8723au/core/rtw_xmit.c
> index 18a9f34..f8b1243 100644
> --- a/drivers/staging/rtl8723au/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
> @@ -1247,7 +1247,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto)
>   ether_addr_copy(data, rfc1042_header);

Doesn't the ether_add_copy() also require that data is aligned?

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


[PATCH v8 0/9] dw-hdmi: convert imx hdmi to bridge/dw_hdmi

2014-11-12 Thread Andy Yan

We found freescale imx6 and rockchip rk3288 and Ingenic JZ4780 (Xburst/MIPS)
use the interface compatible Designware HDMI IP, but they also have some
lightly differences, such as phy pll configuration, register width(imx hdmi
register is one byte, but rk3288 is 4 bytes width and can only access by word),
4K support(imx6 doesn't support 4k, but rk3288 does).

To reuse the imx-hdmi driver, we make this patch set:
(1): fix some CodingStyle warning to make checkpatch happy
(2): split out imx-soc code from imx-hdmi to dw_hdmi-imx.c
(3): move imx-hdmi to bridge/dw-hdmi, and convert it to a drm_bridge driver
(4): add rockchip rk3288 platform specific code dw_hdmi-rockchip.c

Changes in v8:
- correct some spelling mistake
- modify ddc-i2c-bus and interrupt description
- Add documentation for rockchip dw hdmi
- add support for rockchip rk3288 hdmi

Changes in v7:
- remove unused variables from structure dw_hdmi
- remove a wrong modification
- add copyrights for dw_hdmi-imx.c

Changes in v6:
- rearrange the patch order
- move some modification to  patch#6
- refactor register access without reg_shift
- move some modification from patch#5

Changes in v5:
- refactor reg-io-width

Changes in v4:
- fix checkpatch CHECK
- defer probe ddc i2c adapter

Changes in v3:
- split multi register access to one indepent patch

Changes in v2:
- use git format -M to generate these patch

Andy Yan (8):
  staging: imx-drm: imx-hdmi: make checkpatch happy
  staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter
  staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi
  staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi
  dt-bindings: add document for dw_hdmi
  drm: bridge/dw_hdmi: add support for multi byte register width access
  dt-bindings: Add documentation for rockchip dw hdmi
  drm: bridge/dw_hdmi: add rockchip rk3288 support

Yakir Yang (1):
  drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode

 .../devicetree/bindings/drm/bridge/dw_hdmi.txt |  40 ++
 .../devicetree/bindings/video/dw_hdmi-rockchip.txt |  43 ++
 drivers/gpu/drm/bridge/Kconfig |   5 +
 drivers/gpu/drm/bridge/Makefile|   1 +
 .../imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c}| 773 ++---
 .../imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h}|   5 +-
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c| 319 +
 drivers/staging/imx-drm/Kconfig|   1 +
 drivers/staging/imx-drm/Makefile   |   2 +-
 drivers/staging/imx-drm/dw_hdmi-imx.c  | 266 +++
 include/drm/bridge/dw_hdmi.h   |  53 ++
 11 files changed, 1081 insertions(+), 427 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt
 create mode 100644 Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt
 rename drivers/{staging/imx-drm/imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c} (70%)
 rename drivers/{staging/imx-drm/imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h} (99%)
 create mode 100644 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
 create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c
 create mode 100644 include/drm/bridge/dw_hdmi.h

-- 
1.9.1


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


[PATCH v8 2/9] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter

2014-11-12 Thread Andy Yan
drm driver may probe before the i2c bus, so the driver should
defer probing until it is available

Signed-off-by: Andy Yan 

---

Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4:
- defer probe ddc i2c adapter

Changes in v3: None
Changes in v2: None

 drivers/staging/imx-drm/imx-hdmi.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
b/drivers/staging/imx-drm/imx-hdmi.c
index 79daec4..c2b035a 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -1611,8 +1611,11 @@ static int imx_hdmi_bind(struct device *dev, struct 
device *master, void *data)
ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
if (ddc_node) {
hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
-   if (!hdmi->ddc)
+   if (!hdmi->ddc) {
dev_dbg(hdmi->dev, "failed to read ddc node\n");
+   of_node_put(ddc_node);
+   return -EPROBE_DEFER;
+   }
 
of_node_put(ddc_node);
} else {
-- 
1.9.1


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


[PATCH v8 1/9] staging: imx-drm: imx-hdmi: make checkpatch happy

2014-11-12 Thread Andy Yan
CHECK: Alignment should match open parenthesis
+   if ((hdmi->vic == 10) || (hdmi->vic == 11) ||
+   (hdmi->vic == 12) || (hdmi->vic == 13) ||

CHECK: braces {} should be used on all arms of this statement
+   if (hdmi->hdmi_data.video_mode.mdvi)
[...]
+   else {
[...]

Signed-off-by: Andy Yan 

---

Changes in v8: None
Changes in v7: None
Changes in v6:
- rearrange the patch order

Changes in v5: None
Changes in v4:
- fix checkpatch CHECK

Changes in v3: None
Changes in v2: None

 drivers/staging/imx-drm/imx-hdmi.c | 97 +++---
 1 file changed, 48 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
b/drivers/staging/imx-drm/imx-hdmi.c
index aaec6b2..79daec4 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -163,7 +163,7 @@ static void hdmi_modb(struct imx_hdmi *hdmi, u8 data, u8 
mask, unsigned reg)
 }
 
 static void hdmi_mask_writeb(struct imx_hdmi *hdmi, u8 data, unsigned int reg,
- u8 shift, u8 mask)
+u8 shift, u8 mask)
 {
hdmi_modb(hdmi, data << shift, mask, reg);
 }
@@ -327,7 +327,7 @@ static unsigned int hdmi_compute_cts(unsigned int freq, 
unsigned long pixel_clk,
 }
 
 static void hdmi_set_clk_regenerator(struct imx_hdmi *hdmi,
-   unsigned long pixel_clk)
+unsigned long pixel_clk)
 {
unsigned int clk_n, clk_cts;
 
@@ -338,7 +338,7 @@ static void hdmi_set_clk_regenerator(struct imx_hdmi *hdmi,
 
if (!clk_cts) {
dev_dbg(hdmi->dev, "%s: pixel clock not supported: %lu\n",
-__func__, pixel_clk);
+   __func__, pixel_clk);
return;
}
 
@@ -477,13 +477,11 @@ static void imx_hdmi_update_csc_coeffs(struct imx_hdmi 
*hdmi)
u16 coeff_b = (*csc_coeff)[1][i];
u16 coeff_c = (*csc_coeff)[2][i];
 
-   hdmi_writeb(hdmi, coeff_a & 0xff,
-   HDMI_CSC_COEF_A1_LSB + i * 2);
+   hdmi_writeb(hdmi, coeff_a & 0xff, HDMI_CSC_COEF_A1_LSB + i * 2);
hdmi_writeb(hdmi, coeff_a >> 8, HDMI_CSC_COEF_A1_MSB + i * 2);
hdmi_writeb(hdmi, coeff_b & 0xff, HDMI_CSC_COEF_B1_LSB + i * 2);
hdmi_writeb(hdmi, coeff_b >> 8, HDMI_CSC_COEF_B1_MSB + i * 2);
-   hdmi_writeb(hdmi, coeff_c & 0xff,
-   HDMI_CSC_COEF_C1_LSB + i * 2);
+   hdmi_writeb(hdmi, coeff_c & 0xff, HDMI_CSC_COEF_C1_LSB + i * 2);
hdmi_writeb(hdmi, coeff_c >> 8, HDMI_CSC_COEF_C1_MSB + i * 2);
}
 
@@ -535,21 +533,22 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi)
struct hdmi_data_info *hdmi_data = &hdmi->hdmi_data;
u8 val, vp_conf;
 
-   if (hdmi_data->enc_out_format == RGB
-   || hdmi_data->enc_out_format == YCBCR444) {
-   if (!hdmi_data->enc_color_depth)
+   if (hdmi_data->enc_out_format == RGB ||
+   hdmi_data->enc_out_format == YCBCR444) {
+   if (!hdmi_data->enc_color_depth) {
output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS;
-   else if (hdmi_data->enc_color_depth == 8) {
+   } else if (hdmi_data->enc_color_depth == 8) {
color_depth = 4;
output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS;
-   } else if (hdmi_data->enc_color_depth == 10)
+   } else if (hdmi_data->enc_color_depth == 10) {
color_depth = 5;
-   else if (hdmi_data->enc_color_depth == 12)
+   } else if (hdmi_data->enc_color_depth == 12) {
color_depth = 6;
-   else if (hdmi_data->enc_color_depth == 16)
+   } else if (hdmi_data->enc_color_depth == 16) {
color_depth = 7;
-   else
+   } else {
return;
+   }
} else if (hdmi_data->enc_out_format == YCBCR422_8BITS) {
if (!hdmi_data->enc_color_depth ||
hdmi_data->enc_color_depth == 8)
@@ -561,8 +560,9 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi)
else
return;
output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_YCC422;
-   } else
+   } else {
return;
+   }
 
/* set the packetizer registers */
val = ((color_depth << HDMI_VP_PR_CD_COLOR_DEPTH_OFFSET) &
@@ -623,34 +623,34 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi)
 }
 
 static inline void hdmi_phy_test_clear(struct imx_hdmi *hdmi,
-   unsigned char bit)
+  unsigned char bit)
 {
hdmi_modb(hdmi, bit << HDMI_PHY_TST0_TSTCLR_OFFSET,
  HDMI_PHY_TST0_TSTCLR_MASK, HDMI_PHY_TST0);
 }
 
 sta

[PATCH v8 3/9] staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi

2014-11-12 Thread Andy Yan
imx6 and rockchip rk3288 and JZ4780 (Ingenic Xburst/MIPS)
use the interface compatible Designware HDMI IP, but they
also have some lightly differences, such as phy pll configuration,
register width, 4K support, clk useage, and the crtc mux configuration
is also platform specific.

To reuse the imx hdmi driver, split the platform specific code out
to dw_hdmi-imx.c.

Signed-off-by: Andy Yan 

---

Changes in v8: None
Changes in v7:
- remove unused variables from structure dw_hdmi
- remove a wrong modification
- add copyrights for dw_hdmi-imx.c

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/staging/imx-drm/Makefile  |   2 +-
 drivers/staging/imx-drm/dw_hdmi-imx.c | 217 +
 drivers/staging/imx-drm/imx-hdmi.c| 255 --
 drivers/staging/imx-drm/imx-hdmi.h|  43 ++
 4 files changed, 322 insertions(+), 195 deletions(-)
 create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c

diff --git a/drivers/staging/imx-drm/Makefile b/drivers/staging/imx-drm/Makefile
index 582c438..809027d 100644
--- a/drivers/staging/imx-drm/Makefile
+++ b/drivers/staging/imx-drm/Makefile
@@ -9,4 +9,4 @@ obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
 
 imx-ipuv3-crtc-objs  := ipuv3-crtc.o ipuv3-plane.o
 obj-$(CONFIG_DRM_IMX_IPUV3)+= imx-ipuv3-crtc.o
-obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o
+obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o dw_hdmi-imx.o
diff --git a/drivers/staging/imx-drm/dw_hdmi-imx.c 
b/drivers/staging/imx-drm/dw_hdmi-imx.c
new file mode 100644
index 000..0db978e
--- /dev/null
+++ b/drivers/staging/imx-drm/dw_hdmi-imx.c
@@ -0,0 +1,217 @@
+/* Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
+ *
+ * derived from imx-hdmi.c(renamed to bridge/dw_hdmi.c now)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "imx-drm.h"
+#include "imx-hdmi.h"
+
+struct imx_hdmi_priv {
+   struct device *dev;
+   struct clk *isfr_clk;
+   struct clk *iahb_clk;
+   struct regmap *regmap;
+};
+
+static const struct mpll_config imx_mpll_cfg[] = {
+   {
+   4525, {
+   { 0x01e0, 0x },
+   { 0x21e1, 0x },
+   { 0x41e2, 0x }
+   },
+   }, {
+   9250, {
+   { 0x0140, 0x0005 },
+   { 0x2141, 0x0005 },
+   { 0x4142, 0x0005 },
+   },
+   }, {
+   14850, {
+   { 0x00a0, 0x000a },
+   { 0x20a1, 0x000a },
+   { 0x40a2, 0x000a },
+   },
+   }, {
+   ~0UL, {
+   { 0x00a0, 0x000a },
+   { 0x2001, 0x000f },
+   { 0x4002, 0x000f },
+   },
+   }
+};
+
+static const struct curr_ctrl imx_cur_ctr[] = {
+   /*  pixelclk bpp8bpp10   bpp12 */
+   {
+   5400, { 0x091c, 0x091c, 0x06dc },
+   }, {
+   5840, { 0x091c, 0x06dc, 0x06dc },
+   }, {
+   7200, { 0x06dc, 0x06dc, 0x091c },
+   }, {
+   7425, { 0x06dc, 0x0b5c, 0x091c },
+   }, {
+   11880, { 0x091c, 0x091c, 0x06dc },
+   }, {
+   21600, { 0x06dc, 0x0b5c, 0x091c },
+   }
+};
+
+static int imx_hdmi_parse_dt(struct imx_hdmi_priv *hdmi)
+{
+   struct device_node *np = hdmi->dev->of_node;
+
+   hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "gpr");
+   if (IS_ERR(hdmi->regmap)) {
+   dev_err(hdmi->dev, "Unable to get gpr\n");
+   return PTR_ERR(hdmi->regmap);
+   }
+
+   hdmi->isfr_clk = devm_clk_get(hdmi->dev, "isfr");
+   if (IS_ERR(hdmi->isfr_clk)) {
+   dev_err(hdmi->dev, "Unable to get HDMI isfr clk\n");
+   return PTR_ERR(hdmi->isfr_clk);
+   }
+
+   hdmi->iahb_clk = devm_clk_get(hdmi->dev, "iahb");
+   if (IS_ERR(hdmi->iahb_clk)) {
+   dev_err(hdmi->dev, "Unable to get HDMI iahb clk\n");
+   return PTR_ERR(hdmi->iahb_clk);
+   }
+
+   return 0;
+}
+
+static void *imx_hdmi_imx_setup(struct platform_device *pdev)
+{
+   struct imx_hdmi_priv *hdmi;
+   int ret;
+
+   hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL);
+   if (!hdmi)
+   return ERR_PTR(-ENOMEM);
+   hdmi->dev = &pdev->dev;
+
+   ret = imx_hdmi_parse_dt(hdmi);
+   if (ret < 0)
+   return ERR_PTR(ret);
+   ret = clk_prepare_enable(hdmi->isfr_clk);
+   if (ret) {
+   dev_err(hdmi->dev,
+   "Cannot enable HDMI isfr clock: %d\n", ret);
+   retur

[PATCH v8 4/9] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi

2014-11-12 Thread Andy Yan
the original imx hdmi driver is under staging/imx-drm,
which depends on imx-drm, so move the imx hdmi driver out
to drm/bridge and rename imx-hdmi to dw_hdmi

Signed-off-by: Andy Yan 

---

Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- use git format -M to generate these patch

 drivers/gpu/drm/bridge/Kconfig |   5 +
 drivers/gpu/drm/bridge/Makefile|   1 +
 .../imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c}| 281 +++--
 .../imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h}|  46 +---
 drivers/staging/imx-drm/Kconfig|   1 +
 drivers/staging/imx-drm/Makefile   |   2 +-
 drivers/staging/imx-drm/dw_hdmi-imx.c  |  70 ++---
 include/drm/bridge/dw_hdmi.h   |  57 +
 8 files changed, 243 insertions(+), 220 deletions(-)
 rename drivers/{staging/imx-drm/imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c} (83%)
 rename drivers/{staging/imx-drm/imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h} (97%)
 create mode 100644 include/drm/bridge/dw_hdmi.h

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 884923f..26162ef 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -3,3 +3,8 @@ config DRM_PTN3460
depends on DRM
select DRM_KMS_HELPER
---help---
+
+config DRM_DW_HDMI
+   bool "Synopsys DesignWare High-Definition Multimedia Interface"
+   depends on DRM
+   select DRM_KMS_HELPER
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index b4733e1..d8a8cfd 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -1,3 +1,4 @@
 ccflags-y := -Iinclude/drm
 
 obj-$(CONFIG_DRM_PTN3460) += ptn3460.o
+obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o
diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
b/drivers/gpu/drm/bridge/dw_hdmi.c
similarity index 83%
rename from drivers/staging/imx-drm/imx-hdmi.c
rename to drivers/gpu/drm/bridge/dw_hdmi.c
index c7e5f12..e9f0dfe 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -6,8 +6,7 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * SH-Mobile High-Definition Multimedia Interface (HDMI) driver
- * for SLISHDMI13T and SLIPHDMIT IP cores
+ * Designware High-Definition Multimedia Interface (HDMI) driver
  *
  * Copyright (C) 2010, Guennadi Liakhovetski 
  */
@@ -24,8 +23,9 @@
 #include 
 #include 
 #include 
+#include 
 
-#include "imx-hdmi.h"
+#include "dw_hdmi.h"
 
 #define HDMI_EDID_LEN  512
 
@@ -101,15 +101,15 @@ struct hdmi_data_info {
struct hdmi_vmode video_mode;
 };
 
-struct imx_hdmi {
+struct dw_hdmi {
struct drm_connector connector;
struct drm_encoder encoder;
 
-   enum imx_hdmi_devtype dev_type;
+   enum dw_hdmi_devtype dev_type;
struct device *dev;
 
struct hdmi_data_info hdmi_data;
-   const struct imx_hdmi_plat_data *plat_data;
+   const struct dw_hdmi_plat_data *plat_data;
void *priv;
int vic;
 
@@ -127,17 +127,17 @@ struct imx_hdmi {
int ratio;
 };
 
-static inline void hdmi_writeb(struct imx_hdmi *hdmi, u8 val, int offset)
+static inline void hdmi_writeb(struct dw_hdmi *hdmi, u8 val, int offset)
 {
writeb(val, hdmi->regs + offset);
 }
 
-static inline u8 hdmi_readb(struct imx_hdmi *hdmi, int offset)
+static inline u8 hdmi_readb(struct dw_hdmi *hdmi, int offset)
 {
return readb(hdmi->regs + offset);
 }
 
-static void hdmi_modb(struct imx_hdmi *hdmi, u8 data, u8 mask, unsigned reg)
+static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg)
 {
u8 val = hdmi_readb(hdmi, reg) & ~mask;
 
@@ -145,13 +145,13 @@ static void hdmi_modb(struct imx_hdmi *hdmi, u8 data, u8 
mask, unsigned reg)
hdmi_writeb(hdmi, val, reg);
 }
 
-static void hdmi_mask_writeb(struct imx_hdmi *hdmi, u8 data, unsigned int reg,
+static void hdmi_mask_writeb(struct dw_hdmi *hdmi, u8 data, unsigned int reg,
 u8 shift, u8 mask)
 {
hdmi_modb(hdmi, data << shift, mask, reg);
 }
 
-static void hdmi_set_clock_regenerator_n(struct imx_hdmi *hdmi,
+static void hdmi_set_clock_regenerator_n(struct dw_hdmi *hdmi,
 unsigned int value)
 {
hdmi_writeb(hdmi, value & 0xff, HDMI_AUD_N1);
@@ -162,7 +162,7 @@ static void hdmi_set_clock_regenerator_n(struct imx_hdmi 
*hdmi,
hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_N_SHIFT_MASK, HDMI_AUD_CTS3);
 }
 
-static void hdmi_regenerate_cts(struct imx_hdmi *hdmi, unsigned int cts)
+static void hdmi_regenerate_cts(struct dw_hdmi *hdmi, unsigned int cts)
 {
/* Must be set/cleared first */
hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3);
@@ -309,7 +309,7 @@ static unsigned int hdmi_compute_cts(unsigned int fre

[PATCH v8 5/9] dt-bindings: add document for dw_hdmi

2014-11-12 Thread Andy Yan
Signed-off-by: Andy Yan 

---

Changes in v8:
- correct some spelling mistake
- modify ddc-i2c-bus and interrupt description

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 .../devicetree/bindings/drm/bridge/dw_hdmi.txt | 40 ++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt

diff --git a/Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt 
b/Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt
new file mode 100644
index 000..0558442
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt
@@ -0,0 +1,40 @@
+DesignWare HDMI bridge bindings
+
+Required properities:
+- compatible: platform specific such as:
+   * "fsl,imx6q-hdmi"
+   * "fsl,imx6dl-hdmi"
+   * "rockchip,rk3288-dw-hdmi"
+- reg: physical base address of the controller and length
+- ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+- interrupts: The HDMI interrupt number
+
+Optional properties
+- reg-io-width: the width of the reg:1,4, default set to 1 if not present
+
+Example:
+   hdmi: hdmi@012 {
+   compatible = "fsl,imx6q-hdmi";
+   reg = <0x0012 0x9000>;
+   interrupts = <0 115 0x04>;
+   gpr = <&gpr>;
+   clocks = <&clks 123>, <&clks 124>;
+   clock-names = "iahb", "isfr";
+   ddc-i2c-bus = <&i2c2>;
+
+   port@0 {
+   reg = <0>;
+
+   hdmi_mux_0: endpoint {
+   remote-endpoint = <&ipu1_di0_hdmi>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   hdmi_mux_1: endpoint {
+   remote-endpoint = <&ipu1_di1_hdmi>;
+   };
+   };
+   };
-- 
1.9.1


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


[PATCH v8 6/9] drm: bridge/dw_hdmi: add support for multi byte register width access

2014-11-12 Thread Andy Yan
On rockchip rk3288, only word(32-bit) accesses are
permitted for hdmi registers.  Byte width accesses (writeb,
readb) generate an imprecise external abort.

Signed-off-by: Andy Yan 

---

Changes in v8: None
Changes in v7: None
Changes in v6:
- move some modification to  patch#6
- refactor register access without reg_shift

Changes in v5:
- refactor reg-io-width

Changes in v4: None
Changes in v3:
- split multi register access to one indepent patch

Changes in v2: None

 drivers/gpu/drm/bridge/dw_hdmi.c | 57 +++-
 1 file changed, 51 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index e9f0dfe..978c709 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -101,6 +101,11 @@ struct hdmi_data_info {
struct hdmi_vmode video_mode;
 };
 
+union dw_reg_ptr {
+   u32 __iomem *p32;
+   u8 __iomem *p8;
+};
+
 struct dw_hdmi {
struct drm_connector connector;
struct drm_encoder encoder;
@@ -121,20 +126,43 @@ struct dw_hdmi {
 
struct regmap *regmap;
struct i2c_adapter *ddc;
-   void __iomem *regs;
+   union dw_reg_ptr regs;
 
unsigned int sample_rate;
int ratio;
+
+   void (*write)(struct dw_hdmi *hdmi, u8 val, int offset);
+   u8 (*read)(struct dw_hdmi *hdmi, int offset);
 };
 
+static void dw_hdmi_writel(struct dw_hdmi *hdmi, u8 val, int offset)
+{
+   writel(val, hdmi->regs.p32 + offset);
+}
+
+static u8 dw_hdmi_readl(struct dw_hdmi *hdmi, int offset)
+{
+   return readl(hdmi->regs.p32 + offset);
+}
+
+static void dw_hdmi_writeb(struct dw_hdmi *hdmi, u8 val, int offset)
+{
+   writeb(val, hdmi->regs.p8 + offset);
+}
+
+static u8 dw_hdmi_readb(struct dw_hdmi *hdmi, int offset)
+{
+   return readb(hdmi->regs.p8 + offset);
+}
+
 static inline void hdmi_writeb(struct dw_hdmi *hdmi, u8 val, int offset)
 {
-   writeb(val, hdmi->regs + offset);
+   hdmi->write(hdmi, val, offset);
 }
 
 static inline u8 hdmi_readb(struct dw_hdmi *hdmi, int offset)
 {
-   return readb(hdmi->regs + offset);
+   return hdmi->read(hdmi, offset);
 }
 
 static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg)
@@ -1499,6 +1527,23 @@ static int dw_hdmi_bind(struct device *dev, struct 
device *master, void *data)
struct device_node *ddc_node;
struct resource *iores;
int ret, irq;
+   u32 val = 1;
+
+   of_property_read_u32(np, "reg-io-width", &val);
+
+   switch (val) {
+   case 4:
+   hdmi->write = dw_hdmi_writel;
+   hdmi->read = dw_hdmi_readl;
+   break;
+   case 1:
+   hdmi->write = dw_hdmi_writeb;
+   hdmi->read = dw_hdmi_readb;
+   break;
+   default:
+   dev_err(dev, "reg-io-width must be 1 or 4\n");
+   return -EINVAL;
+   }
 
ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
if (ddc_node) {
@@ -1525,9 +1570,9 @@ static int dw_hdmi_bind(struct device *dev, struct device 
*master, void *data)
return ret;
 
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   hdmi->regs = devm_ioremap_resource(dev, iores);
-   if (IS_ERR(hdmi->regs))
-   return PTR_ERR(hdmi->regs);
+   hdmi->regs.p32 = devm_ioremap_resource(dev, iores);
+   if (IS_ERR(hdmi->regs.p32))
+   return PTR_ERR(hdmi->regs.p32);
 
if (hdmi->plat_data->setup)
hdmi->priv = hdmi->plat_data->setup(pdev);
-- 
1.9.1


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


[PATCH v8 7/9] drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode

2014-11-12 Thread Andy Yan
From: Yakir Yang 

keep the connector & birdge in dw_hdmi.c, handle encoder
in dw_hdmi-imx.c, as most of the encoder operation are
platform specific such as crtc select and panel format
set

Signed-off-by: Andy Yan 
Signed-off-by: Yakir Yang 

---

Changes in v8: None
Changes in v7: None
Changes in v6:
- move some modification from patch#5

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/gpu/drm/bridge/dw_hdmi.c  | 228 +++---
 drivers/staging/imx-drm/dw_hdmi-imx.c | 145 ++---
 include/drm/bridge/dw_hdmi.h  |  13 +-
 3 files changed, 199 insertions(+), 187 deletions(-)

diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index 978c709..ed75147 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -11,7 +11,6 @@
  * Copyright (C) 2010, Guennadi Liakhovetski 
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -108,7 +107,8 @@ union dw_reg_ptr {
 
 struct dw_hdmi {
struct drm_connector connector;
-   struct drm_encoder encoder;
+   struct drm_encoder *encoder;
+   struct drm_bridge *bridge;
 
enum dw_hdmi_devtype dev_type;
struct device *dev;
@@ -1319,6 +1319,50 @@ static void dw_hdmi_poweroff(struct dw_hdmi *hdmi)
dw_hdmi_phy_disable(hdmi);
 }
 
+static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
+   struct drm_display_mode *mode,
+   struct drm_display_mode *adjusted_mode)
+{
+   struct dw_hdmi *hdmi = bridge->driver_private;
+
+   dw_hdmi_setup(hdmi, mode);
+
+   /* Store the display mode for plugin/DKMS poweron events */
+   memcpy(&hdmi->previous_mode, mode, sizeof(hdmi->previous_mode));
+}
+
+static bool dw_hdmi_bridge_mode_fixup(struct drm_bridge *bridge,
+ const struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
+{
+   return true;
+}
+
+static void dw_hdmi_bridge_disable(struct drm_bridge *bridge)
+{
+   struct dw_hdmi *hdmi = bridge->driver_private;
+
+   dw_hdmi_poweroff(hdmi);
+}
+
+static void dw_hdmi_bridge_enable(struct drm_bridge *bridge)
+{
+   struct dw_hdmi *hdmi = bridge->driver_private;
+
+   dw_hdmi_poweron(hdmi);
+}
+
+static void dw_hdmi_bridge_destroy(struct drm_bridge *bridge)
+{
+   drm_bridge_cleanup(bridge);
+   kfree(bridge);
+}
+
+static void dw_hdmi_bridge_nope(struct drm_bridge *bridge)
+{
+   /* do nothing */
+}
+
 static enum drm_connector_status dw_hdmi_connector_detect(struct drm_connector
*connector, bool force)
 {
@@ -1360,60 +1404,7 @@ static struct drm_encoder 
*dw_hdmi_connector_best_encoder(struct drm_connector
struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
 connector);
 
-   return &hdmi->encoder;
-}
-
-static void dw_hdmi_encoder_mode_set(struct drm_encoder *encoder,
-   struct drm_display_mode *mode,
-   struct drm_display_mode *adjusted_mode)
-{
-   struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder);
-
-   dw_hdmi_setup(hdmi, mode);
-
-   /* Store the display mode for plugin/DKMS poweron events */
-   memcpy(&hdmi->previous_mode, mode, sizeof(hdmi->previous_mode));
-}
-
-static bool dw_hdmi_encoder_mode_fixup(struct drm_encoder *encoder,
-   const struct drm_display_mode *mode,
-   struct drm_display_mode *adjusted_mode)
-{
-   return true;
-}
-
-static void dw_hdmi_encoder_disable(struct drm_encoder *encoder)
-{
-}
-
-static void dw_hdmi_encoder_dpms(struct drm_encoder *encoder, int mode)
-{
-   struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder);
-
-   if (mode)
-   dw_hdmi_poweroff(hdmi);
-   else
-   dw_hdmi_poweron(hdmi);
-}
-
-static void dw_hdmi_encoder_prepare(struct drm_encoder *encoder)
-{
-   struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder);
-
-   dw_hdmi_poweroff(hdmi);
-
-   if (hdmi->plat_data->encoder_prepare)
-   hdmi->plat_data->encoder_prepare(&hdmi->connector, encoder);
-}
-
-static void dw_hdmi_encoder_commit(struct drm_encoder *encoder)
-{
-   struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder);
-
-   if (hdmi->plat_data->encoder_commit)
-   hdmi->plat_data->encoder_commit(hdmi->priv, encoder);
-
-   dw_hdmi_poweron(hdmi);
+   return hdmi->encoder;
 }
 
 void dw_hdmi_connector_destroy(struct drm_connector *connector)
@@ -1422,19 +1413,6 @@ void dw_hdmi_connector_destroy(struct drm_connector 
*connector)
drm_connector_cleanup(connector);
 }
 
-static struct drm_encoder_funcs dw_hdmi_encoder_funcs = {
-   .destroy = drm_encoder_cle

[PATCH v8 8/9] dt-bindings: Add documentation for rockchip dw hdmi

2014-11-12 Thread Andy Yan
Signed-off-by: Andy Yan 

---

Changes in v8:
- Add documentation for rockchip dw hdmi

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 .../devicetree/bindings/video/dw_hdmi-rockchip.txt | 43 ++
 1 file changed, 43 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt

diff --git a/Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt 
b/Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt
new file mode 100644
index 000..6ea6764
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt
@@ -0,0 +1,43 @@
+Rockchip specific extensions to the Synopsys Designware HDMI
+
+
+Required properties:
+- compatible: "rockchip,rk3288-dw-hdmi";
+- reg: physical base address of the controller and length
+- ddc-i2c-bus:  phandle of an I2C controller used for DDC EDID probing
+- clocks: from common clock binding: handle to hdmi clock.
+- clock-names: should be "clk" "hdcp_clk"
+- rockchip,grf: this soc should set GRF regs to mux vopl/vopb.
+- interrupts: HDMI interrupt number
+- ports: contain a port node with endpoint definitions as defined in
+  Documentation/devicetree/bindings/media/video-interfaces.txt. For
+  vopb,set the reg = <0> and set the reg = <1> for vopl.
+- reg-io-width: the width of the reg:1,4, the value should be 4 on
+  rk3288 platform
+
+Example:
+hdmi: hdmi@ff98 {
+   compatible = "rockchip,rk3288-dw-hdmi";
+   reg = <0xff98 0x2>;
+   reg-io-width = <4>;
+   ddc-i2c-bus = <&i2c5>;
+   rockchip,grf = <&grf>;
+   interrupts = ;
+   clocks = <&cru  PCLK_HDMI_CTRL>, <&cru SCLK_HDMI_HDCP>;
+   clock-names = "clk", "hdcp_clk";
+   status = "disabled";
+   ports {
+   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   hdmi_in_vopb: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <&vopb_out_hdmi>;
+   };
+   hdmi_in_vopl: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <&vopl_out_hdmi>;
+   };
+   };
+   };
+};
-- 
1.9.1


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


[PATCH v8 9/9] drm: bridge/dw_hdmi: add rockchip rk3288 support

2014-11-12 Thread Andy Yan
rk3288 hdmi is compatible with Designware hdmi

this patch is depend on patch by Mark Yao Add drm
driver for Rockchip Socs

see https://lkml.org/lkml/2014/10/8/201

Signed-off-by: Andy Yan 
Signed-off-by: Yakir Yang 

---

Changes in v8:
- add support for rockchip rk3288 hdmi

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/gpu/drm/bridge/dw_hdmi.c|  66 --
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 319 
 include/drm/bridge/dw_hdmi.h|   1 +
 3 files changed, 374 insertions(+), 12 deletions(-)
 create mode 100644 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index ed75147..a8071c1 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -668,11 +668,15 @@ static inline void hdmi_phy_test_dout(struct dw_hdmi 
*hdmi,
 
 static bool hdmi_phy_wait_i2c_done(struct dw_hdmi *hdmi, int msec)
 {
-   while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
+   u32 val;
+
+   while ((val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
if (msec-- == 0)
return false;
udelay(1000);
}
+   hdmi_writeb(hdmi, val, HDMI_IH_I2CMPHY_STAT0);
+
return true;
 }
 
@@ -815,24 +819,45 @@ static int hdmi_phy_configure(struct dw_hdmi *hdmi, 
unsigned char prep,
 
hdmi_phy_i2c_write(hdmi, 0x, 0x13);  /* PLLPHBYCTRL */
hdmi_phy_i2c_write(hdmi, 0x0006, 0x17);
-   /* RESISTANCE TERM 133Ohm Cfg */
-   hdmi_phy_i2c_write(hdmi, 0x0005, 0x19);  /* TXTERM */
-   /* PREEMP Cgf 0.00 */
-   hdmi_phy_i2c_write(hdmi, 0x800d, 0x09);  /* CKSYMTXCTRL */
+
+   if (hdmi->dev_type != RK3288_HDMI) {
+   /* RESISTANCE TERM 133Ohm Cfg */
+   hdmi_phy_i2c_write(hdmi, 0x0005, 0x19);  /* TXTERM */
+   /* PREEMP Cgf 0.00 */
+   hdmi_phy_i2c_write(hdmi, 0x800d, 0x09);  /* CKSYMTXCTRL */
+   } else {
+   if (curr_ctr[i].mpixelclock <= 7425) {
+   /* RESISTANCE TERM 100Ohm Cfg */
+   hdmi_phy_i2c_write(hdmi, 0x0004, 0x19);
+   hdmi_phy_i2c_write(hdmi, 0x8009, 0x09);
+   } else if (curr_ctr[i].mpixelclock <= 14850) {
+   /* RESISTANCE TERM 100Ohm Cfg */
+   hdmi_phy_i2c_write(hdmi, 0x0004, 0x19);
+   hdmi_phy_i2c_write(hdmi, 0x8029, 0x09);
+   } else {
+   /* RESISTANCE TERM 133Ohm Cfg */
+   hdmi_phy_i2c_write(hdmi, 0x0005, 0x19);
+   hdmi_phy_i2c_write(hdmi, 0x8039, 0x09);
+   }
+   }
/* TX/CK LVL 10 */
hdmi_phy_i2c_write(hdmi, 0x01ad, 0x0E);  /* VLEVCTRL */
/* REMOVE CLK TERM */
hdmi_phy_i2c_write(hdmi, 0x8000, 0x05);  /* CKCALCTRL */
 
-   dw_hdmi_phy_enable_power(hdmi, 1);
+   if (hdmi->dev_type != RK3288_HDMI) {
+   dw_hdmi_phy_enable_power(hdmi, 1);
 
-   /* toggle TMDS enable */
-   dw_hdmi_phy_enable_tmds(hdmi, 0);
-   dw_hdmi_phy_enable_tmds(hdmi, 1);
+   /* toggle TMDS enable */
+   dw_hdmi_phy_enable_tmds(hdmi, 0);
+   dw_hdmi_phy_enable_tmds(hdmi, 1);
 
-   /* gen2 tx power on */
-   dw_hdmi_phy_gen2_txpwron(hdmi, 1);
-   dw_hdmi_phy_gen2_pddq(hdmi, 0);
+   /* gen2 tx power on */
+   dw_hdmi_phy_gen2_txpwron(hdmi, 1);
+   dw_hdmi_phy_gen2_pddq(hdmi, 0);
+   } else {
+   hdmi_writeb(hdmi, 0x6e, HDMI_PHY_CONF0);
+   }
 
/*Wait for PHY PLL lock */
msec = 5;
@@ -1398,6 +1423,20 @@ static int dw_hdmi_connector_get_modes(struct 
drm_connector *connector)
return 0;
 }
 
+static enum drm_mode_status
+dw_hdmi_connector_mode_valid(struct drm_connector *connector,
+struct drm_display_mode *mode)
+{
+   struct dw_hdmi *hdmi = container_of(connector,
+   struct dw_hdmi, connector);
+   enum drm_mode_status mode_status = MODE_OK;
+
+   if (hdmi->plat_data->mode_valid)
+   mode_status = hdmi->plat_data->mode_valid(connector, mode);
+
+   return mode_status;
+}
+
 static struct drm_encoder *dw_hdmi_connector_best_encoder(struct drm_connector
   *connector)
 {
@@ -1422,6 +1461,7 @@ static struct drm_connector_funcs dw_hdmi_connector_funcs 
= {
 
 static struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs = {
.get_modes = dw_hdmi_connector_get_modes,
+   .mode_valid = dw_hdmi_connector_mode_valid,
.best_encoder = dw_hdmi_connector_best_encoder,
 };
 
@@ -1514,6 +1554,8 @@ static int dw_hdmi_register(struct drm_device *drm, 

(( CONTACT DR. JIM OVIA FOR YOUR COMPENSATION PAYMENT ))

2014-11-12 Thread U/N
United Nations Compensation Unit, In Affiliation with World Bank Our Ref: 
U.N.O/W.B.O/11/2014/1982/05/9.
 
 
 
 
Congratulations Beneficiary,
 
 
 
 
You may not understand why this mail came to you. We have been having a meeting 
for quit sometime now and we just came to a logical conclusion few days ago in 
affiliation with the World Bank president. This email is to few well listed 
people that have been scammed in any part of the world, the UNITED NATIONS in 
Affiliation with WORLD BANK have agreed to compensate them with the sum of 
USD5,000,000.00 Dollars each.
 
 
 
These includes every foreign contractors that may have not received their 
contract sum, and people that have had an unfinished transaction or 
international businesses that failed due to Government problems etc. We found 
your email in the list of those who are to benefit from these compensation 
exercise and that is why we are contacting you, this have been agreed upon and 
have been signed.
 
 
 
You are advised to contact Dr. Jim Ovia of our paying Bank in Africa, as he is 
our representative in Africa. Contact him immediately for your Cheque/ 
International Bank Draft of USD5,000,000.00 Dollars.Your payment is in form of 
a Bank Draft for security purpose, he will send it to you and you can clear it 
in any bank of your choice. Therefore, you should send him your full Name and 
telephone number your correct mailing address where you want him to send the 
Draft to you. Contact Dr. Jim Ovia of ZENITH BANK PLC with your Code Payment: 
U.N.O/W.B.O/11/2014/1982/05/9 immediately for your Cheque at the given address 
below:
 
 
 
 
Bank Name: Zenith Bank Plc.
 
 
Contact Official: Dr. Jim Ovia
 
 
Email: jim.o...@zenithbankplc.fh2web.com
 
 
Phone: +2348183400711
 
 
 
I apologize on behalf of the United Nation organization for any delay you might 
have encountered in receiving your fund in the past. Thanks and God bless you 
and your family. Hoping to hear from you as soon as you cash your Bank Draft. 
Making the world a better place. You are required to contact the above person 
and furnish him with the following of your information that will be required to 
avoid any mistakes:-
 
 
 
1. Your Full name:
 
2. Your Country:
 
3. Contact Address:
 
4. Telephone Number:
 
5. Fax Number:
 
6. Marital Status:
 
7. Occupation:
 
8. Sex:
 
9. Age:
 
 
 
 
Congratulations, and I look forward to hear from you as soon as you confirm 
your payment making the world a better place.
 
 
 
Regards,
 
 
 
Ms. Valerie Amos.
United Nations Secretary General for Humanitarian Affairs,
Emergency Relief Coordinator.
http://www.un.org/sg/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [V2 PATCH 04/10] added media agnostic (MA) USB packet handling

2014-11-12 Thread Oliver Neukum
On Mon, 2014-11-10 at 18:09 -0800, Stephanie Wallick wrote:
> +/**
> + * Compares 2 request IDs. Returns true if a is less than b. Handles
> request id
> + * wraparound.
> + */
> +bool mausb_req_id_lt(u8 a, u8 b)

Unify such functions. It's just silly to have so many of them.

> +/**
> + * Calculates the total length of data contained in an ms_pkt (in
> bytes).
> + * Returns the length of the kvec, or 0 on an error.
> + */
> +static int mausb_ms_data_length(struct ms_pkt *pkt)
> +{
> +   int i;
> +   int total_length;
> +   struct kvec *current_kvec;
> +
> +   for (i = 0; i < pkt->nents; ++i) {
> +   current_kvec = &pkt->kvec[i];
> +   if (NULL == current_kvec)
> +   return -EINVAL;
> +   else
> +   total_length += current_kvec->iov_len;
> +   }
> +
> +   return total_length;
> +}
> +

Regards
Oliver

-- 
Oliver Neukum 

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


[PATCH 11/15] staging: unisys: Controlvm_payload_bytes_buffered camel case

2014-11-12 Thread Jeffrey
Changed the static ulong the file parser.c
Controlvm_payload_bytes_buffered =>controlvm_payload_bytes_buffered

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 48faba2..be384c8 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -29,7 +29,7 @@
  * incoming payloads.  This serves as a throttling mechanism.
  */
 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
-static ulong Controlvm_Payload_Bytes_Buffered;
+static ulong controlvm_payload_bytes_buffered;
 
 struct parser_context_tag {
ulong allocbytes;
@@ -57,7 +57,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 * '\0'-terminated
 */
allocbytes++;
-   if ((Controlvm_Payload_Bytes_Buffered + bytes)
+   if ((controlvm_payload_bytes_buffered + bytes)
> MAX_CONTROLVM_PAYLOAD_BYTES) {
ERRDRV("%s (%s:%d) - prevented allocation of %d bytes to 
prevent exceeding throttling max (%d)",
   __func__, __FILE__, __LINE__, allocbytes,
@@ -144,7 +144,7 @@ Away:
rgn = NULL;
}
if (rc) {
-   Controlvm_Payload_Bytes_Buffered += ctx->param_bytes;
+   controlvm_payload_bytes_buffered += ctx->param_bytes;
} else {
if (ctx) {
parser_done(ctx);
@@ -252,7 +252,7 @@ parser_done(struct parser_context_tag *ctx)
 {
if (!ctx)
return;
-   Controlvm_Payload_Bytes_Buffered -= ctx->param_bytes;
+   controlvm_payload_bytes_buffered -= ctx->param_bytes;
kfree(ctx);
 }
 
-- 
1.7.1

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


[PATCH 15/15] staging: unisys: parser_param_start camel cases

2014-11-12 Thread Jeffrey
Fixed camel cases in the void parser_param_start in parser.c
Away => cleanups

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 1c52e97..3432afa 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -218,7 +218,7 @@ parser_param_start(struct parser_context_tag *ctx,
if (ctx == NULL) {
ERRDRV("%s (%s:%d) - no context",
   __func__, __FILE__, __LINE__);
-   goto Away;
+   goto cleanups;
}
phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
switch (which_string) {
@@ -243,7 +243,7 @@ parser_param_start(struct parser_context_tag *ctx,
break;
}
 
-Away:
+cleanups:
return;
 }
 
-- 
1.7.1

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


[PATCH 04/15] staging: unisys: parser_simpleString_get camel case

2014-11-12 Thread Jeffrey
changed the char pointer parser_simpleString_get to parser_simple-
string_get in the file parser.h and this affected the file parser.h
parser_simpleString_get => parser_simplestring_get

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |2 +-
 drivers/staging/unisys/visorchipset/parser.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 46b645c..b2d7ba6 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -174,7 +174,7 @@ parser_init_bytestream(u64 addr, u32 bytes, BOOL isLocal, 
BOOL *tryAgain)
 /* Obtain '\0'-terminated copy of string in payload area.
  */
 char *
-parser_simpleString_get(PARSER_CONTEXT *ctx)
+parser_simplestring_get(PARSER_CONTEXT *ctx)
 {
if (!ctx->byte_stream)
return NULL;
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index aa3cb0f..b12846f 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -40,7 +40,7 @@ void parser_param_start(PARSER_CONTEXT *ctx, 
PARSER_WHICH_STRING which_string);
 void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
 void *parser_string_get(PARSER_CONTEXT *ctx);
 uuid_le parser_id_get(PARSER_CONTEXT *ctx);
-char *parser_simpleString_get(PARSER_CONTEXT *ctx);
+char *parser_simplestring_get(PARSER_CONTEXT *ctx);
 void *parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
 void parser_done(PARSER_CONTEXT *ctx);
 
-- 
1.7.1

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


[PATCH 14/15] staging: unisys: parser_init_bytestream camel cases parser.c

2014-11-12 Thread Jeffrey
Fixed the camel cases in parser_init_bytestream in parser.c
isLocal => is_local
tryAgain => tryagain

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 000e166..1c52e97 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -166,9 +166,9 @@ parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL 
*tryagain)
  * parser_byteStream_get() to obtain the data.
  */
 struct parser_context_tag *
-parser_init_bytestream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, BOOL *tryagain)
 {
-   return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain);
+   return parser_init_guts(addr, bytes, is_local, FALSE, tryagain);
 }
 
 /* Obtain '\0'-terminated copy of string in payload area.
-- 
1.7.1

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


[PATCH 01/15] staging: unisys: PARSER_CONTEXT_Tag camel case

2014-11-12 Thread Jeffrey
Changed the camel case PARSER_CONTEXT_Tag to parser_context_tag in
the files parser.h and parser.c
PARSER_CONTEXT_Tag => parser_context_tag

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |2 +-
 drivers/staging/unisys/visorchipset/parser.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 9edbd3b..9ef699c 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -31,7 +31,7 @@
 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
 static ulong Controlvm_Payload_Bytes_Buffered;
 
-struct PARSER_CONTEXT_Tag {
+struct parser_context_tag {
ulong allocbytes;
ulong param_bytes;
u8 *curr;
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 9fbe3b5..73bdc54 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -31,7 +31,7 @@ typedef enum {
PARSERSTRING_NAME,
 } PARSER_WHICH_STRING;
 
-typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
+typedef struct parser_context_tag PARSER_CONTEXT;
 
 PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain);
 PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal,
-- 
1.7.1

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


[PATCH 10/15] staging: unisys: braces parser.c camel case

2014-11-12 Thread Jeffrey
Added pair of braces to an if statement on line 146

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 671aaaf..48faba2 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -143,9 +143,9 @@ Away:
visor_memregion_destroy(rgn);
rgn = NULL;
}
-   if (rc)
+   if (rc) {
Controlvm_Payload_Bytes_Buffered += ctx->param_bytes;
-   else {
+   } else {
if (ctx) {
parser_done(ctx);
ctx = NULL;
-- 
1.7.1

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


[PATCH 00/15] parser.h and parser.c patches

2014-11-12 Thread Jeffrey
Sorry for the amount of patches given I was told to be a little
conservative with my patches. I grouped the camel cases together
based on which struct or void they come from to make it easier.
The first seven are patches for parser.h and the last eight are
for parser.c, but they will still affect other files

Jeffrey (15):
  staging: unisys: PARSER_CONTEXT_Tag camel case
  staging: unisys: parser_init & parser_init_byteStream camel case
  staging: unisys: parser_init_byteStream camel case
  staging: unisys: parser_simpleString_get camel case
  staging: unisys: parser_byteStream_get camel case
  staging: unisys: PARSER_CONTEXT typedef
  staging: unisys: PARSER_WHICH_STRING typedef
  staging: unisys: spaces after casts parser.c
  staging: unisys: Logical continuation parser.c
  staging: unisys: braces parser.c camel case
  staging: unisys: Controlvm_payload_bytes_buffered camel case
  staging: unisys: parser_init_guts camel cases
  staging: unisys: parser_init camel cases parser.c
  staging: unisys: parser_init_bytestream camel cases parser.c
  staging: unisys: parser_param_start camel cases

 drivers/staging/unisys/visorchipset/parser.c   |  117 ++--
 drivers/staging/unisys/visorchipset/parser.h   |   29 +++---
 .../unisys/visorchipset/visorchipset_main.c|   12 +-
 3 files changed, 81 insertions(+), 77 deletions(-)

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


[PATCH 12/15] staging: unisys: parser_init_guts camel cases

2014-11-12 Thread Jeffrey
Fixed the camel cases for the arguments inside the struct
parser_init_struct
isLocal => is_local
tryAgain => tryagain
Away => cleanups
hasStandardPayloadHeader => has_standard_payload_header

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |   42 +-
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index be384c8..682996f 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -41,8 +41,8 @@ struct parser_context_tag {
 };
 
 static struct parser_context_tag *
-parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
-BOOL hasStandardPayloadHeader, BOOL *tryAgain)
+parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
+BOOL has_standard_payload_header, BOOL *tryagain)
 {
int allocbytes = sizeof(struct parser_context_tag) + bytes;
struct parser_context_tag *rc = NULL;
@@ -50,9 +50,9 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
 
-   if (tryAgain)
-   *tryAgain = FALSE;
-   if (!hasStandardPayloadHeader)
+   if (tryagain)
+   *tryagain = FALSE;
+   if (!has_standard_payload_header)
/* alloc and 0 extra byte to ensure payload is
 * '\0'-terminated
 */
@@ -62,19 +62,19 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
ERRDRV("%s (%s:%d) - prevented allocation of %d bytes to 
prevent exceeding throttling max (%d)",
   __func__, __FILE__, __LINE__, allocbytes,
   MAX_CONTROLVM_PAYLOAD_BYTES);
-   if (tryAgain)
-   *tryAgain = TRUE;
+   if (tryagain)
+   *tryagain = TRUE;
rc = NULL;
-   goto Away;
+   goto cleanups;
}
ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
if (ctx == NULL) {
ERRDRV("%s (%s:%d) - failed to allocate %d bytes",
   __func__, __FILE__, __LINE__, allocbytes);
-   if (tryAgain)
-   *tryAgain = TRUE;
+   if (tryagain)
+   *tryagain = TRUE;
rc = NULL;
-   goto Away;
+   goto cleanups;
}
 
ctx->allocbytes = allocbytes;
@@ -82,7 +82,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
ctx->curr = NULL;
ctx->bytes_remaining = 0;
ctx->byte_stream = FALSE;
-   if (isLocal) {
+   if (is_local) {
void *p;
 
if (addr > virt_to_phys(high_memory - 1)) {
@@ -90,7 +90,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   __func__,
   (unsigned long long)addr, (ulong)bytes);
rc = NULL;
-   goto Away;
+   goto cleanups;
}
p = __va((ulong)(addr));
memcpy(ctx->data, p, bytes);
@@ -98,17 +98,17 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
rgn = visor_memregion_create(addr, bytes);
if (!rgn) {
rc = NULL;
-   goto Away;
+   goto cleanups;
}
if (visor_memregion_read(rgn, 0, ctx->data, bytes) < 0) {
rc = NULL;
-   goto Away;
+   goto cleanups;
}
}
-   if (!hasStandardPayloadHeader) {
+   if (!has_standard_payload_header) {
ctx->byte_stream = TRUE;
rc = ctx;
-   goto Away;
+   goto cleanups;
}
phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
if (phdr->total_length != bytes) {
@@ -116,7 +116,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   __func__,
   (ulong)(phdr->total_length), (ulong)(bytes));
rc = NULL;
-   goto Away;
+   goto cleanups;
}
if (phdr->total_length < phdr->header_length) {
ERRDRV("%s - total length < header length (%lu < %lu)",
@@ -124,7 +124,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   (ulong)(phdr->total_length),
   (ulong)(phdr->header_length));
rc = NULL;
-   goto Away;
+   goto cleanups;
}
if (phdr->header_length <
sizeof(struct spar_controlvm_parameters_header)) {
@@ -134,11 +134,11 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   (ulong)(sizeof(

[PATCH 09/15] staging: unisys: Logical continuation parser.c

2014-11-12 Thread Jeffrey
Put "||" operator on line 390 where it belongs, to have a proper
logical continuation

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index fa2a678..671aaaf 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -387,8 +387,8 @@ parser_param_get(struct parser_context_tag *ctx, char *nam, 
int namesize)
break;
}
} else
-   if (pscan[i] == ',' || pscan[i] == ';'
-   || pscan[i] == '\0') {
+   if (pscan[i] == ',' || pscan[i] == ';' ||
+   pscan[i] == '\0') {
value_length = i;
break;
}
-- 
1.7.1

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


[PATCH 07/15] staging: unisys: PARSER_WHICH_STRING typedef

2014-11-12 Thread Jeffrey
Removed the typedef PARSER_WHICH_STRING in parser.h and added enum
in front of it at every instance of the variable in parser.c, and
parser.h

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |2 +-
 drivers/staging/unisys/visorchipset/parser.h |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index c38de48..6f82d55 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -211,7 +211,7 @@ parser_id_get(struct parser_context_tag *ctx)
 
 void
 parser_param_start(struct parser_context_tag *ctx,
-  PARSER_WHICH_STRING which_string)
+  enum parser_which_string which_string)
 {
struct spar_controlvm_parameters_header *phdr = NULL;
 
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index f06540a..a2a6765 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -24,12 +24,12 @@
 #include "timskmod.h"
 #include "channel.h"
 
-typedef enum {
+enum parser_which_string {
PARSERSTRING_INITIATOR,
PARSERSTRING_TARGET,
PARSERSTRING_CONNECTION,
PARSERSTRING_NAME,
-} PARSER_WHICH_STRING;
+};
 
 struct parser_context_tag *parser_init(u64 addr, u32 bytes, BOOL is_local,
   BOOL *tryagain);
@@ -37,7 +37,7 @@ struct parser_context_tag *parser_init_bytestream(u64 addr, 
u32 bytes,
  BOOL is_local,
  BOOL *tryagain);
 void parser_param_start(struct parser_context_tag *ctx,
-   PARSER_WHICH_STRING which_string);
+   enum parser_which_string which_string);
 void *parser_param_get(struct parser_context_tag *ctx, char *nam, int 
namesize);
 void *parser_string_get(struct parser_context_tag *ctx);
 uuid_le parser_id_get(struct parser_context_tag *ctx);
-- 
1.7.1

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


[PATCH 05/15] staging: unisys: parser_byteStream_get camel case

2014-11-12 Thread Jeffrey
Changed the camel case parser_byteStream_get to parser_bytestream_
get in parser.h and this also changed in the file parser.c
parser_byteStream => parser_bytestream

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |2 +-
 drivers/staging/unisys/visorchipset/parser.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index b2d7ba6..7bfaa61 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -186,7 +186,7 @@ parser_simplestring_get(PARSER_CONTEXT *ctx)
 /* Obtain a copy of the buffer in the payload area.
  */
 void *
-parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
+parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
 {
if (!ctx->byte_stream)
return NULL;
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index b12846f..d079984 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -41,7 +41,7 @@ void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int 
namesize);
 void *parser_string_get(PARSER_CONTEXT *ctx);
 uuid_le parser_id_get(PARSER_CONTEXT *ctx);
 char *parser_simplestring_get(PARSER_CONTEXT *ctx);
-void *parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
+void *parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
 void parser_done(PARSER_CONTEXT *ctx);
 
 #endif
-- 
1.7.1

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


[PATCH 02/15] staging: unisys: parser_init & parser_init_byteStream camel case

2014-11-12 Thread Jeffrey
Fixed all of the camel cases in the two structs parser_init and
parser_init_byteStream in parser.h
isLocal => is_local
tryAgain => tryagain

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 73bdc54..b8901c6 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -33,9 +33,9 @@ typedef enum {
 
 typedef struct parser_context_tag PARSER_CONTEXT;
 
-PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain);
-PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal,
-  BOOL *tryAgain);
+PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL 
*tryagain);
+PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL is_local,
+  BOOL *tryagain);
 void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
 void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
 void *parser_string_get(PARSER_CONTEXT *ctx);
-- 
1.7.1

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


[PATCH 06/15] staging: unisys: PARSER_CONTEXT typedef

2014-11-12 Thread Jeffrey
Removed typedef declaration for PARSER_CONTEXT on line 34 of
parser.h and replaced every instance of PARSER_CONTEXT with
"struct parser_context_tag" because PARSER_CONTEXT is actually
parser_context_tag

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c   |   27 ++-
 drivers/staging/unisys/visorchipset/parser.h   |   23 +
 .../unisys/visorchipset/visorchipset_main.c|   10 ---
 3 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 7bfaa61..c38de48 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -40,13 +40,13 @@ struct parser_context_tag {
char data[0];
 };
 
-static PARSER_CONTEXT *
+static struct parser_context_tag *
 parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 BOOL hasStandardPayloadHeader, BOOL *tryAgain)
 {
-   int allocbytes = sizeof(PARSER_CONTEXT) + bytes;
-   PARSER_CONTEXT *rc = NULL;
-   PARSER_CONTEXT *ctx = NULL;
+   int allocbytes = sizeof(struct parser_context_tag) + bytes;
+   struct parser_context_tag *rc = NULL;
+   struct parser_context_tag *ctx = NULL;
struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -154,7 +154,7 @@ Away:
return rc;
 }
 
-PARSER_CONTEXT *
+struct parser_context_tag *
 parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
 {
return parser_init_guts(addr, bytes, isLocal, TRUE, tryAgain);
@@ -165,7 +165,7 @@ parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL 
*tryAgain)
  * structures.  Afterwards, you can call parser_simpleString_get() or
  * parser_byteStream_get() to obtain the data.
  */
-PARSER_CONTEXT *
+struct parser_context_tag *
 parser_init_bytestream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
 {
return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain);
@@ -174,7 +174,7 @@ parser_init_bytestream(u64 addr, u32 bytes, BOOL isLocal, 
BOOL *tryAgain)
 /* Obtain '\0'-terminated copy of string in payload area.
  */
 char *
-parser_simplestring_get(PARSER_CONTEXT *ctx)
+parser_simplestring_get(struct parser_context_tag *ctx)
 {
if (!ctx->byte_stream)
return NULL;
@@ -186,7 +186,7 @@ parser_simplestring_get(PARSER_CONTEXT *ctx)
 /* Obtain a copy of the buffer in the payload area.
  */
 void *
-parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
+parser_bytestream_get(struct parser_context_tag *ctx, ulong *nbytes)
 {
if (!ctx->byte_stream)
return NULL;
@@ -196,7 +196,7 @@ parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
 }
 
 uuid_le
-parser_id_get(PARSER_CONTEXT *ctx)
+parser_id_get(struct parser_context_tag *ctx)
 {
struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -210,7 +210,8 @@ parser_id_get(PARSER_CONTEXT *ctx)
 }
 
 void
-parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string)
+parser_param_start(struct parser_context_tag *ctx,
+  PARSER_WHICH_STRING which_string)
 {
struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -247,7 +248,7 @@ Away:
 }
 
 void
-parser_done(PARSER_CONTEXT *ctx)
+parser_done(struct parser_context_tag *ctx)
 {
if (!ctx)
return;
@@ -290,7 +291,7 @@ string_length_no_trail(char *s, int len)
  *parameter
  */
 void *
-parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize)
+parser_param_get(struct parser_context_tag *ctx, char *nam, int namesize)
 {
u8 *pscan, *pnam = nam;
ulong nscan;
@@ -446,7 +447,7 @@ parser_param_get(PARSER_CONTEXT *ctx, char *nam, int 
namesize)
 }
 
 void *
-parser_string_get(PARSER_CONTEXT *ctx)
+parser_string_get(struct parser_context_tag *ctx)
 {
u8 *pscan;
ulong nscan;
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index d079984..f06540a 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -31,17 +31,18 @@ typedef enum {
PARSERSTRING_NAME,
 } PARSER_WHICH_STRING;
 
-typedef struct parser_context_tag PARSER_CONTEXT;
-
-PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL 
*tryagain);
-PARSER_CONTEXT *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
+struct parser_context_tag *parser_init(u64 addr, u32 bytes, BOOL is_local,
   BOOL *tryagain);
-void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
-void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
-void *parser_string_get(PARSER_CONTEXT *ctx);
-uuid_le parser_id_get(PARSER_CONTEXT *ctx);
-char *parser_simplestring_get(PARSER_CONTEXT *ctx);
-void *parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
-void parser_done(PARSER_CONTEXT *ctx);
+st

[PATCH 13/15] staging: unisys: parser_init camel cases parser.c

2014-11-12 Thread Jeffrey
Fixed the camel cases inside the definition of the struct
parser_init in parser.c
isLocal => is_local
tryAgain => tryagain

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 682996f..000e166 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -155,9 +155,9 @@ cleanups:
 }
 
 struct parser_context_tag *
-parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL *tryagain)
 {
-   return parser_init_guts(addr, bytes, isLocal, TRUE, tryAgain);
+   return parser_init_guts(addr, bytes, is_local, TRUE, tryagain);
 }
 
 /* Call this instead of parser_init() if the payload area consists of just
-- 
1.7.1

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


[PATCH 03/15] staging: unisys: parser_init_byteStream camel case

2014-11-12 Thread Jeffrey
Changed the struct pointer parser_init_byteStream to
parser_init_bytestream on line 37 in parser.h, parser.c and visor-
chipset_main.c
parser_init_byteStream => parser_init_bytestream

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c   |2 +-
 drivers/staging/unisys/visorchipset/parser.h   |2 +-
 .../unisys/visorchipset/visorchipset_main.c|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 9ef699c..46b645c 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -166,7 +166,7 @@ parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL 
*tryAgain)
  * parser_byteStream_get() to obtain the data.
  */
 PARSER_CONTEXT *
-parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init_bytestream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
 {
return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain);
 }
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index b8901c6..aa3cb0f 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -34,7 +34,7 @@ typedef enum {
 typedef struct parser_context_tag PARSER_CONTEXT;
 
 PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL 
*tryagain);
-PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL is_local,
+PARSER_CONTEXT *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
   BOOL *tryagain);
 void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
 void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c8f7bea..5010c65 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1811,7 +1811,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
BOOL retry = FALSE;
 
parser_ctx =
-   parser_init_byteStream(parametersAddr, parametersBytes,
+   parser_init_bytestream(parametersAddr, parametersBytes,
   isLocalAddr, &retry);
if (!parser_ctx) {
if (retry) {
-- 
1.7.1

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


[PATCH 08/15] staging: unisys: spaces after casts parser.c

2014-11-12 Thread Jeffrey
Removed all spaces before casts in parser.c

Signed-off-by: Jeffrey 
---
 drivers/staging/unisys/visorchipset/parser.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 6f82d55..fa2a678 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -88,11 +88,11 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
if (addr > virt_to_phys(high_memory - 1)) {
ERRDRV("%s - bad local address (0x%-16.16Lx for %lu)",
   __func__,
-  (unsigned long long) addr, (ulong) bytes);
+  (unsigned long long)addr, (ulong)bytes);
rc = NULL;
goto Away;
}
-   p = __va((ulong) (addr));
+   p = __va((ulong)(addr));
memcpy(ctx->data, p, bytes);
} else {
rgn = visor_memregion_create(addr, bytes);
@@ -114,15 +114,15 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
if (phdr->total_length != bytes) {
ERRDRV("%s - bad total length %lu (should be %lu)",
   __func__,
-  (ulong) (phdr->total_length), (ulong) (bytes));
+  (ulong)(phdr->total_length), (ulong)(bytes));
rc = NULL;
goto Away;
}
if (phdr->total_length < phdr->header_length) {
ERRDRV("%s - total length < header length (%lu < %lu)",
   __func__,
-  (ulong) (phdr->total_length),
-  (ulong) (phdr->header_length));
+  (ulong)(phdr->total_length),
+  (ulong)(phdr->header_length));
rc = NULL;
goto Away;
}
@@ -130,7 +130,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
sizeof(struct spar_controlvm_parameters_header)) {
ERRDRV("%s - header is too small (%lu < %lu)",
   __func__,
-  (ulong) (phdr->header_length),
+  (ulong)(phdr->header_length),
   (ulong)(sizeof(
struct spar_controlvm_parameters_header)));
rc = NULL;
@@ -192,7 +192,7 @@ parser_bytestream_get(struct parser_context_tag *ctx, ulong 
*nbytes)
return NULL;
if (nbytes)
*nbytes = ctx->param_bytes;
-   return (void *) ctx->data;
+   return (void *)ctx->data;
 }
 
 uuid_le
@@ -407,7 +407,7 @@ parser_param_get(struct parser_context_tag *ctx, char *nam, 
int namesize)
if (value == NULL)
return NULL;
memcpy(value, pscan, value_length);
-   ((u8 *) (value))[value_length] = '\0';
+   ((u8 *)(value))[value_length] = '\0';
 
pscan += orig_value_length;
nscan -= orig_value_length;
@@ -475,6 +475,6 @@ parser_string_get(struct parser_context_tag *ctx)
return NULL;
if (value_length > 0)
memcpy(value, pscan, value_length);
-   ((u8 *) (value))[value_length] = '\0';
+   ((u8 *)(value))[value_length] = '\0';
return value;
 }
-- 
1.7.1

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


Re: [PATCH 00/15] parser.h and parser.c patches

2014-11-12 Thread Dan Carpenter
Your from header and sign offs are still wrong.  Should be your full
name.

regards,
dan carpenter

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


[PATCH] staging: comedi: fix scan_end_arg == chanlist_len assumption

2014-11-12 Thread Ian Abbott
Some comedi drivers allow the `scan_end_arg` value of an asynchronous
command to be a multiple (> 1) of the `chanlist_len` although most
require them to be the same value.

`comedi_bytes_per_scan()` is incorrectly using `chanlist_len` as the
length of the scan.  Change it to use `scan_end_arg`.

`comedi_nsamples_left()` is incorrectly using `cur_chan` as the current
sample position in the scan (it is actually the current position in the
channel list).  Change it to use the actual sample position in the scan.
(Unfortunately we only have the current scan position in bytes currently,
so convert that to a sample position.)

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 82ac845..e516ed9 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -317,10 +317,10 @@ unsigned int comedi_bytes_per_scan(struct 
comedi_subdevice *s)
case COMEDI_SUBD_DO:
case COMEDI_SUBD_DIO:
bits_per_sample = 8 * comedi_bytes_per_sample(s);
-   num_samples = DIV_ROUND_UP(cmd->chanlist_len, bits_per_sample);
+   num_samples = DIV_ROUND_UP(cmd->scan_end_arg, bits_per_sample);
break;
default:
-   num_samples = cmd->chanlist_len;
+   num_samples = cmd->scan_end_arg;
break;
}
return comedi_samples_to_bytes(s, num_samples);
@@ -384,11 +384,13 @@ unsigned int comedi_nsamples_left(struct comedi_subdevice 
*s,
/* +1 to force comedi_nscans_left() to return the scans left */
unsigned int nscans = (nsamples / cmd->scan_end_arg) + 1;
unsigned int scans_left = comedi_nscans_left(s, nscans);
+   unsigned int scan_pos =
+   comedi_bytes_to_samples(s, async->scan_progress);
unsigned long long samples_left = 0;
 
if (scans_left) {
samples_left = ((unsigned long long)scans_left *
-  cmd->scan_end_arg) - async->cur_chan;
+   cmd->scan_end_arg) - scan_pos;
}
 
if (samples_left < nsamples)
-- 
2.1.1

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


Re: [PATCH 02/15] staging: unisys: parser_init & parser_init_byteStream camel case

2014-11-12 Thread Dan Carpenter
On Wed, Nov 12, 2014 at 09:10:01AM -0500, Jeffrey wrote:
> Fixed all of the camel cases in the two structs parser_init and
> parser_init_byteStream in parser.h
> isLocal => is_local
> tryAgain => tryagain

Use "try_again" instead of "tryagain".

The one thing per patch rule is a bit vague.  Really it's "one complete
thing" per patch and not 1 thing split across five patches.  Now we're
in a state where the .c and .h file don't match so that's bad.

Also if there are are minor closely related things then you are allowed
to do those in the same patch.  This is a very tricky part of the rule.
But changing the .h file is a minor part of changing the .c file and
normally you would barely even comment on it in the changelog because
it's obvious when you need to change the .h file if you change the .c
file.

Also fix parser_init_byteStream at the same time.

Breaking the patches up is supposed to make reviewing easier but this
is making it harder.

Sorry to come down so hard one for this.  Please redo these.

regards,
dan carpenter

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


[PATCH 12/30] staging: comedi: dmm32at: use 8255 module for Digital I/O subdevice

2014-11-12 Thread Hartley Sweeten
On Wednesday, November 12, 2014 3:12 AM, Ian Abbott wrote:
> On 11/11/14 23:55, H Hartley Sweeten wrote:
>> The Dimond-MM-32-AT board uses an internal 82C55-type digital I/O circuit to
>> provide the 24 digital I/O lines. The only quirk is the need to set the page
>> selection bits in the control register to select page 1 addresses.
>>
>> Instead of duplicating the 8255 code, provide an (*io) callback and use the
>> 8255 module to support this subdevice.
>>
>> This also removes the need for the private data in this driver.
>
> The patch is fine, but there's a bug in the original code which means we 
> might need the private data back (unless the DMM32AT_CNTRL register is 
> read-write rather than read-only).  The bug is that the ISR routine 
> clobbers the page selection bits in the register.  To avoid that, the 
> current page would either need to be stored in private data or read from 
> the register (if possible) to avoid clobbering it, and updates to the 
> register would need a spin-lock.

Ian,

Thanks for the review.

The write to the Miscellaneous Control register (DMM32AT_CTRL_REG) in
the ISR routine is actually safe. According to the user manual:

INTRST  Writing a 1 to this location resets the interrupt request circuit on the
board. The programmer must write a 1 to this bit during the interrupt
service routine, or further interrupts will not occur. Writing a 1 to 
this
bit does not disturb the values of the PAGE bits.

The only other writes to the DMM32AT_CTRL_REG are in:

dmm32at_reset() - sets the RESETA bit to cause a full reset of the board

dmm32at_ai_cmd() - sets INTRST to reset the interrupt (this is probably not
necessary, maybe it should be moved to the (*cancel)).

dmm32at_setaitimer() - selects the 8254 page

dmm32at_8255_io() - selects the 8255 page

The only place the protection is needed is in the dmm32at_setaitimer() and
dmm32at_8255_io() functions.

The PAGE bits are readable in the FIFO Status register (DMM32AT_FIFO_STATUS_REG)
but a spin-lock is probably safer. Could we use the comedi_device 'spinlock' 
for this?
The core does not seem to use it. Is this just ageneral purpose spin-lock for 
the drivers?
It really needs a comment of some sort.

Thanks,
Hartley

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


[PATCH for 3.18] staging: r8188eu: Fix scheduling while atomic error introduced in commit fadbe0cd

2014-11-12 Thread Larry Finger
In commit fadbe0cd5292851608e2e01b91d9295fa287b9fe entitled "staging:
rtl8188eu:Remove rtw_zmalloc(), wrapper for kzalloc()", the author failed
to note that the original code in the wrapper tested whether the caller
could sleep, and set the flags argument to kzalloc() appropriately.
After the patch, GFP_KERNEL is used unconditionally. Unfortunately, several
of the routines may be entered from an interrupt routine and generate
a BUG splat for every such call. Routine rtw_sitesurvey_cmd() is used in the
example below:

BUG: sleeping function called from invalid context at mm/slub.c:1240
in_atomic(): 1, irqs_disabled(): 0, pid: 756, name: wpa_supplicant
INFO: lockdep is turned off.
CPU: 2 PID: 756 Comm: wpa_supplicant Tainted: GWC O   3.18.0-rc4+ #34
Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.20   04/17/2014
c90005557000 880216fafaa8 816b0bbf 
8800c3b58000 880216fafac8 8107af77 0001
0010 880216fafb18 811b06ce 
Call Trace:
 [] dump_stack+0x4e/0x71
 [] __might_sleep+0xf7/0x120
 [] kmem_cache_alloc_trace+0x4e/0x1f0
 [] ? rtw_sitesurvey_cmd+0x56/0x2a0 [r8188eu]
 [] rtw_sitesurvey_cmd+0x56/0x2a0 [r8188eu]
 [] rtw_do_join+0x22d/0x370 [r8188eu]
 [] rtw_set_802_11_ssid+0x218/0x3d0 [r8188eu]
 [] rtw_wx_set_essid+0x1e5/0x410 [r8188eu]
 [] ? rtw_wx_get_rate+0x50/0x50 [r8188eu]
 [] ioctl_standard_iw_point+0x151/0x3f0
 [] ioctl_standard_call+0xb2/0xe0
 [] ? rtnl_lock+0x17/0x20
 [] ? iw_handler_get_private+0x70/0x70
 [] ? call_commit_handler+0x40/0x40
 [] wireless_process_ioctl+0x176/0x1c0
 [] wext_handle_ioctl+0x69/0xc0
 [] dev_ioctl+0x309/0x5e0
 [] ? call_rcu+0x17/0x20
 [] sock_ioctl+0x142/0x2e0
 [] do_vfs_ioctl+0x300/0x520
 [] ? __audit_syscall_entry+0xb4/0x110
 [] ? __audit_syscall_entry+0xb4/0x110
 [] ? do_audit_syscall_entry+0x6c/0x70
 [] SyS_ioctl+0x81/0xa0
 [] system_call_fastpath+0x12/0x17

Additional routines that generate this BUG are rtw_joinbss_cmd(),
rtw_dynamic_chk_wk_cmd(), rtw_lps_ctrl_wk_cmd(), rtw_rpt_timer_cfg_cmd(),
rtw_ps_cmd(), report_survey_event(), report_join_res(), survey_timer_hdl(),
and rtw_check_bcn_info().

Signed-off-by: Larry Finger 
Cc: navin patidar 
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c   | 22 +++---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c  | 12 ++--
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c |  2 +-
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c 
b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index a1cc788..4b43462 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -275,11 +275,11 @@ u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct 
ndis_802_11_ssid *ssid,
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1);
 
-   ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
+   ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
 
-   psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_KERNEL);
+   psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_ATOMIC);
if (psurveyPara == NULL) {
kfree(ph2c);
return _FAIL;
@@ -405,7 +405,7 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct 
wlan_network *pnetwork)
else
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+Join cmd: 
SSid =[%s]\n", pmlmepriv->assoc_ssid.Ssid));
 
-   pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
+   pcmd = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (pcmd == NULL) {
res = _FAIL;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: 
memory allocate for cmd_obj fail!!!\n"));
@@ -754,13 +754,13 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter)
u8  res = _SUCCESS;
 
 
-   ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
+   ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL) {
res = _FAIL;
goto exit;
}
 
-   pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), 
GFP_KERNEL);
+   pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), 
GFP_ATOMIC);
if (pdrvextra_cmd_parm == NULL) {
kfree(ph2c);
res = _FAIL;
@@ -966,13 +966,13 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 
lps_ctrl_type, u8 enqueue)
u8  res = _SUCCESS;
 
if (enqueue) {
-   ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
+   ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL) {
res = _FAIL;
goto exit;
}
 
-   pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), 
GFP_KE

Re: [PATCH 12/30] staging: comedi: dmm32at: use 8255 module for Digital I/O subdevice

2014-11-12 Thread Ian Abbott

On 12/11/14 16:07, Hartley Sweeten wrote:

On Wednesday, November 12, 2014 3:12 AM, Ian Abbott wrote:

On 11/11/14 23:55, H Hartley Sweeten wrote:

The Dimond-MM-32-AT board uses an internal 82C55-type digital I/O circuit to
provide the 24 digital I/O lines. The only quirk is the need to set the page
selection bits in the control register to select page 1 addresses.

Instead of duplicating the 8255 code, provide an (*io) callback and use the
8255 module to support this subdevice.

This also removes the need for the private data in this driver.


The patch is fine, but there's a bug in the original code which means we
might need the private data back (unless the DMM32AT_CNTRL register is
read-write rather than read-only).  The bug is that the ISR routine
clobbers the page selection bits in the register.  To avoid that, the
current page would either need to be stored in private data or read from
the register (if possible) to avoid clobbering it, and updates to the
register would need a spin-lock.


Ian,

Thanks for the review.

The write to the Miscellaneous Control register (DMM32AT_CTRL_REG) in
the ISR routine is actually safe. According to the user manual:

INTRST  Writing a 1 to this location resets the interrupt request circuit on the
board. The programmer must write a 1 to this bit during the interrupt
service routine, or further interrupts will not occur. Writing a 1 to 
this
bit does not disturb the values of the PAGE bits.


Oh right, so the other bits in the written value get ignored if that bit 
is set.




The only other writes to the DMM32AT_CTRL_REG are in:

dmm32at_reset() - sets the RESETA bit to cause a full reset of the board

dmm32at_ai_cmd() - sets INTRST to reset the interrupt (this is probably not
necessary, maybe it should be moved to the (*cancel)).

dmm32at_setaitimer() - selects the 8254 page

dmm32at_8255_io() - selects the 8255 page

The only place the protection is needed is in the dmm32at_setaitimer() and
dmm32at_8255_io() functions.

The PAGE bits are readable in the FIFO Status register (DMM32AT_FIFO_STATUS_REG)
but a spin-lock is probably safer. Could we use the comedi_device 'spinlock' 
for this?
The core does not seem to use it. Is this just ageneral purpose spin-lock for 
the drivers?
It really needs a comment of some sort.


Yes, it's general purpose for the driver and the comedi core doesn't use 
it itself.  I don't think the spin-lock is strictly necessary in the 
dmm32at_setaitimer() and dmm32at_8255_io() functions as they currently 
only get called while dev->mutex is locked.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] staging: comedi: fix scan_end_arg == chanlist_len assumption

2014-11-12 Thread Hartley Sweeten
On Wednesday, November 12, 2014 9:01 AM, Ian Abbott wrote:
> Some comedi drivers allow the `scan_end_arg` value of an asynchronous
> command to be a multiple (> 1) of the `chanlist_len` although most
> require them to be the same value.
>
> `comedi_bytes_per_scan()` is incorrectly using `chanlist_len` as the
> length of the scan.  Change it to use `scan_end_arg`.
>
> `comedi_nsamples_left()` is incorrectly using `cur_chan` as the current
> sample position in the scan (it is actually the current position in the
> channel list).  Change it to use the actual sample position in the scan.
> (Unfortunately we only have the current scan position in bytes currently,
> so convert that to a sample position.)
>
> Signed-off-by: Ian Abbott 
> ---
>  drivers/staging/comedi/drivers.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Reviewed-by: H Hartley Sweeten 

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


RE: [PATCH 12/30] staging: comedi: dmm32at: use 8255 module for Digital I/O subdevice

2014-11-12 Thread Hartley Sweeten
On Wednesday, November 12, 2014 9:20 AM, Ian Abbott wrote:
> On 12/11/14 16:07, Hartley Sweeten wrote:
>> The write to the Miscellaneous Control register (DMM32AT_CTRL_REG) in
>> the ISR routine is actually safe. According to the user manual:
>>
>> INTRST   Writing a 1 to this location resets the interrupt request 
>> circuit on the
>>  board. The programmer must write a 1 to this bit during the interrupt
>>  service routine, or further interrupts will not occur. Writing a 1 to 
>> this
>>  bit does not disturb the values of the PAGE bits.
>
> Oh right, so the other bits in the written value get ignored if that bit 
> is set.
>>
>> The only other writes to the DMM32AT_CTRL_REG are in:
>>
>> dmm32at_reset() - sets the RESETA bit to cause a full reset of the board
>>
>> dmm32at_ai_cmd() - sets INTRST to reset the interrupt (this is probably not
>>  necessary, maybe it should be moved to the (*cancel)).
>>
>> dmm32at_setaitimer() - selects the 8254 page
>>
>> dmm32at_8255_io() - selects the 8255 page
>>
>> The only place the protection is needed is in the dmm32at_setaitimer() and
>> dmm32at_8255_io() functions.
>>
>> The PAGE bits are readable in the FIFO Status register 
>> (DMM32AT_FIFO_STATUS_REG)
>> but a spin-lock is probably safer. Could we use the comedi_device 'spinlock' 
>> for this?
>> The core does not seem to use it. Is this just ageneral purpose spin-lock 
>> for the drivers?
>> It really needs a comment of some sort.
>
> Yes, it's general purpose for the driver and the comedi core doesn't use 
> it itself.  I don't think the spin-lock is strictly necessary in the 
> dmm32at_setaitimer() and dmm32at_8255_io() functions as they currently 
> only get called while dev->mutex is locked.

OK, so no change needed.

Side-note...

Currently the board reset also probes the board to try and "verify" that the
board is actually a dmm32at. Do you think this is actually necessary?

I feel the board reset just needs to set the RESETA bit to reset the board.
This causes a full reset of all features of the board, including the DACs, the
FIFO, the digital I/O, and all internal registers. The other writes to the board
registers are not  needed since they are only setup the registers for the
verify check.

The udelay() calls can also probably be removed since there is no mention
of a delay needed after the reset in the user manual.

There is still the issue of the SD1/0 bits in the AI status register. These
provide feedback of how the jumpers are set to configure the AI channels
for single-ended or differential input. This could be worked out so the
differential mode actually works.

Your thoughts...

Hartley

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


[PATCH 08/10] staging: unisys: parser.c space after casts

2014-11-12 Thread Jeffrey Brown
Removed all spaces after casts in parser.c

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 02cacec..17c1649 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -88,11 +88,11 @@ parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
if (addr > virt_to_phys(high_memory - 1)) {
ERRDRV("%s - bad local address (0x%-16.16Lx for %lu)",
   __func__,
-  (unsigned long long) addr, (ulong) bytes);
+  (unsigned long long)addr, (ulong)bytes);
rc = NULL;
goto cleanups;
}
-   p = __va((ulong) (addr));
+   p = __va((ulong)(addr));
memcpy(ctx->data, p, bytes);
} else {
rgn = visor_memregion_create(addr, bytes);
@@ -114,15 +114,15 @@ parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
if (phdr->total_length != bytes) {
ERRDRV("%s - bad total length %lu (should be %lu)",
   __func__,
-  (ulong) (phdr->total_length), (ulong) (bytes));
+  (ulong)(phdr->total_length), (ulong)(bytes));
rc = NULL;
goto cleanups;
}
if (phdr->total_length < phdr->header_length) {
ERRDRV("%s - total length < header length (%lu < %lu)",
   __func__,
-  (ulong) (phdr->total_length),
-  (ulong) (phdr->header_length));
+  (ulong)(phdr->total_length),
+  (ulong)(phdr->header_length));
rc = NULL;
goto cleanups;
}
@@ -130,7 +130,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
sizeof(struct spar_controlvm_parameters_header)) {
ERRDRV("%s - header is too small (%lu < %lu)",
   __func__,
-  (ulong) (phdr->header_length),
+  (ulong)(phdr->header_length),
   (ulong)(sizeof(
struct spar_controlvm_parameters_header)));
rc = NULL;
@@ -192,7 +192,7 @@ parser_bytestream_get(struct parser_context_tag *ctx, ulong 
*nbytes)
return NULL;
if (nbytes)
*nbytes = ctx->param_bytes;
-   return (void *) ctx->data;
+   return (void *)ctx->data;
 }
 
 uuid_le
@@ -407,7 +407,7 @@ parser_param_get(struct parser_context_tag *ctx, char *nam, 
int namesize)
if (value == NULL)
return NULL;
memcpy(value, pscan, value_length);
-   ((u8 *) (value))[value_length] = '\0';
+   ((u8 *)(value))[value_length] = '\0';
 
pscan += orig_value_length;
nscan -= orig_value_length;
@@ -475,6 +475,6 @@ parser_string_get(struct parser_context_tag *ctx)
return NULL;
if (value_length > 0)
memcpy(value, pscan, value_length);
-   ((u8 *) (value))[value_length] = '\0';
+   ((u8 *)(value))[value_length] = '\0';
return value;
 }
-- 
1.8.4

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


[PATCH 06/10] staging: unisys: Controlvm_Payload_Bytes_Buffered camel case

2014-11-12 Thread Jeffrey Brown
Changed the camel case of the static ulong Controlvm_Payload_Bytes_
Buffered
Controlvm_Payload_Bytes_Buffered =>controlvm_payload_bytes_buffered

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index fad3fdb..88abbeb 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -29,7 +29,7 @@
  * incoming payloads.  This serves as a throttling mechanism.
  */
 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
-static ulong Controlvm_Payload_Bytes_Buffered;
+static ulong controlvm_payload_bytes_buffered;
 
 struct parser_context_tag {
ulong allocbytes;
@@ -57,7 +57,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 * '\0'-terminated
 */
allocbytes++;
-   if ((Controlvm_Payload_Bytes_Buffered + bytes)
+   if ((controlvm_payload_bytes_buffered + bytes)
> MAX_CONTROLVM_PAYLOAD_BYTES) {
ERRDRV("%s (%s:%d) - prevented allocation of %d bytes to 
prevent exceeding throttling max (%d)",
   __func__, __FILE__, __LINE__, allocbytes,
@@ -144,7 +144,7 @@ Away:
rgn = NULL;
}
if (rc)
-   Controlvm_Payload_Bytes_Buffered += ctx->param_bytes;
+   controlvm_payload_bytes_buffered += ctx->param_bytes;
else {
if (ctx) {
parser_done(ctx);
@@ -252,7 +252,7 @@ parser_done(struct parser_context_tag *ctx)
 {
if (!ctx)
return;
-   Controlvm_Payload_Bytes_Buffered -= ctx->param_bytes;
+   controlvm_payload_bytes_buffered -= ctx->param_bytes;
kfree(ctx);
 }
 
-- 
1.8.4

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


[PATCH 04/10] staging: unisys: PARSER_CONTEXT typedef

2014-11-12 Thread Jeffrey Brown
Completely removed all trace of the typedef of PARSER_CONTEXT
and replaced all instance of that typedef with parser_context_tag
also changed PARSER_CONTEXT_Tag
PARSER_CONTEXT_Tag => parser_context_tag

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c   | 29 +++---
 drivers/staging/unisys/visorchipset/parser.h   | 26 +--
 .../unisys/visorchipset/visorchipset_main.c| 10 +---
 3 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 50180f3..4a880b8 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -31,7 +31,7 @@
 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
 static ulong Controlvm_Payload_Bytes_Buffered;
 
-struct PARSER_CONTEXT_Tag {
+struct parser_context_tag {
ulong allocbytes;
ulong param_bytes;
u8 *curr;
@@ -40,13 +40,13 @@ struct PARSER_CONTEXT_Tag {
char data[0];
 };
 
-static PARSER_CONTEXT *
+static struct parser_context_tag *
 parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 BOOL hasStandardPayloadHeader, BOOL *tryAgain)
 {
-   int allocbytes = sizeof(PARSER_CONTEXT) + bytes;
-   PARSER_CONTEXT *rc = NULL;
-   PARSER_CONTEXT *ctx = NULL;
+   int allocbytes = sizeof(struct parser_context_tag) + bytes;
+   struct parser_context_tag *rc = NULL;
+   struct parser_context_tag *ctx = NULL;
struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -154,7 +154,7 @@ Away:
return rc;
 }
 
-PARSER_CONTEXT *
+struct parser_context_tag *
 parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
return parser_init_guts(addr, bytes, is_local, TRUE, try_again);
@@ -165,7 +165,7 @@ parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL 
*try_again)
  * structures.  Afterwards, you can call parser_simpleString_get() or
  * parser_byteStream_get() to obtain the data.
  */
-PARSER_CONTEXT *
+struct parser_context_tag *
 parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
return parser_init_guts(addr, bytes, is_local, FALSE, try_again);
@@ -174,7 +174,7 @@ parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, 
BOOL *try_again)
 /* Obtain '\0'-terminated copy of string in payload area.
  */
 char *
-parser_simplestring_get(PARSER_CONTEXT *ctx)
+parser_simplestring_get(struct parser_context_tag *ctx)
 {
if (!ctx->byte_stream)
return NULL;
@@ -186,7 +186,7 @@ parser_simplestring_get(PARSER_CONTEXT *ctx)
 /* Obtain a copy of the buffer in the payload area.
  */
 void *
-parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
+parser_bytestream_get(struct parser_context_tag *ctx, ulong *nbytes)
 {
if (!ctx->byte_stream)
return NULL;
@@ -196,7 +196,7 @@ parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
 }
 
 uuid_le
-parser_id_get(PARSER_CONTEXT *ctx)
+parser_id_get(struct parser_context_tag *ctx)
 {
struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -210,7 +210,8 @@ parser_id_get(PARSER_CONTEXT *ctx)
 }
 
 void
-parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string)
+parser_param_start(struct parser_context_tag *ctx,
+  PARSER_WHICH_STRING which_string)
 {
struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -247,7 +248,7 @@ Away:
 }
 
 void
-parser_done(PARSER_CONTEXT *ctx)
+parser_done(struct parser_context_tag *ctx)
 {
if (!ctx)
return;
@@ -290,7 +291,7 @@ string_length_no_trail(char *s, int len)
  *parameter
  */
 void *
-parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize)
+parser_param_get(struct parser_context_tag *ctx, char *nam, int namesize)
 {
u8 *pscan, *pnam = nam;
ulong nscan;
@@ -446,7 +447,7 @@ parser_param_get(PARSER_CONTEXT *ctx, char *nam, int 
namesize)
 }
 
 void *
-parser_string_get(PARSER_CONTEXT *ctx)
+parser_string_get(struct parser_context_tag *ctx)
 {
u8 *pscan;
ulong nscan;
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index fa12df8..de3f37b 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -31,18 +31,18 @@ typedef enum {
PARSERSTRING_NAME,
 } PARSER_WHICH_STRING;
 
-typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
-
-PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
-   BOOL *try_again);
-PARSER_CONTEXT  *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
-   BOOL *try_again);
-void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
-void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
-void *parser_string_get(PARSER_CONTEX

[PATCH 00/10] parser.h and parser.c patches

2014-11-12 Thread Jeffrey Brown
Sorry for all of the messy patches from before but here
are the improved patches for parser.h and parser.c.
The camel cases are grouped on functions and structs
that occurs in both files.

Jeffrey Brown (10):
  staging: unisys: parser_init camel cases
  staging: unisys: parser_init_byteStream camel case
  staging: unisys: simpleString_get & byteStream_get camel case
  staging: unisys: PARSER_CONTEXT typedef
  staging: unisys: PARSER_WHICH_STRING typedef
  staging: unisys: Controlvm_Payload_Bytes_Buffered camel case
  staging: unisys: parser_init_guts and parser_param_start camel case
  staging: unisys: parser.c space after casts
  staging: unisys: parser.c braces
  staging: unisys: parser.c logical continuation

 drivers/staging/unisys/visorchipset/parser.c   | 117 +++--
 drivers/staging/unisys/visorchipset/parser.h   |  29 ++---
 .../unisys/visorchipset/visorchipset_main.c|  12 ++-
 3 files changed, 81 insertions(+), 77 deletions(-)

-- 
1.8.4

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


[PATCH 01/10] staging: unisys: parser_init camel cases

2014-11-12 Thread Jeffrey Brown
Fixed camel cases for parser_init
isLocal => is_local
tryAgain => try_again

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 drivers/staging/unisys/visorchipset/parser.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 9edbd3b..38264c6 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -155,9 +155,9 @@ Away:
 }
 
 PARSER_CONTEXT *
-parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
-   return parser_init_guts(addr, bytes, isLocal, TRUE, tryAgain);
+   return parser_init_guts(addr, bytes, is_local, TRUE, try_again);
 }
 
 /* Call this instead of parser_init() if the payload area consists of just
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 9fbe3b5..4f26413 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -33,7 +33,8 @@ typedef enum {
 
 typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
 
-PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain);
+PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
+   BOOL *try_again);
 PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal,
   BOOL *tryAgain);
 void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
-- 
1.8.4

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


[PATCH 02/10] staging: unisys: parser_init_byteStream camel case

2014-11-12 Thread Jeffrey Brown
Changed the camel cases for the struct parser_init_bytestream
parser_init_byteStream => parser_init_bytestream
isLocal => is_local
tryAgain => try_again

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c| 4 ++--
 drivers/staging/unisys/visorchipset/parser.h| 4 ++--
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 38264c6..8cd3b4f 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -166,9 +166,9 @@ parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL 
*try_again)
  * parser_byteStream_get() to obtain the data.
  */
 PARSER_CONTEXT *
-parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
-   return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain);
+   return parser_init_guts(addr, bytes, is_local, FALSE, try_again);
 }
 
 /* Obtain '\0'-terminated copy of string in payload area.
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 4f26413..10b922e 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -35,8 +35,8 @@ typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
 
 PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
BOOL *try_again);
-PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal,
-  BOOL *tryAgain);
+PARSER_CONTEXT  *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
+  BOOL *try_again);
 void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
 void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
 void *parser_string_get(PARSER_CONTEXT *ctx);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c8f7bea..5010c65 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1811,7 +1811,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
BOOL retry = FALSE;
 
parser_ctx =
-   parser_init_byteStream(parametersAddr, parametersBytes,
+   parser_init_bytestream(parametersAddr, parametersBytes,
   isLocalAddr, &retry);
if (!parser_ctx) {
if (retry) {
-- 
1.8.4

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


[PATCH 07/10] staging: unisys: parser_init_guts and parser_param_start camel case

2014-11-12 Thread Jeffrey Brown
Fixed camel cases in the struct parser_init_guts and an Away camel
case in parser_param_start
isLocal => is_local
tryAgain => try_again
HasStandardPayloadHeader => has_standard_payload_header
Away => cleanups

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 46 ++--
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 88abbeb..02cacec 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -41,8 +41,8 @@ struct parser_context_tag {
 };
 
 static struct parser_context_tag *
-parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
-BOOL hasStandardPayloadHeader, BOOL *tryAgain)
+parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
+BOOL has_standard_payload_header, BOOL *try_again)
 {
int allocbytes = sizeof(struct parser_context_tag) + bytes;
struct parser_context_tag *rc = NULL;
@@ -50,9 +50,9 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
 
-   if (tryAgain)
-   *tryAgain = FALSE;
-   if (!hasStandardPayloadHeader)
+   if (try_again)
+   *try_again = FALSE;
+   if (!has_standard_payload_header)
/* alloc and 0 extra byte to ensure payload is
 * '\0'-terminated
 */
@@ -62,19 +62,19 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
ERRDRV("%s (%s:%d) - prevented allocation of %d bytes to 
prevent exceeding throttling max (%d)",
   __func__, __FILE__, __LINE__, allocbytes,
   MAX_CONTROLVM_PAYLOAD_BYTES);
-   if (tryAgain)
-   *tryAgain = TRUE;
+   if (try_again)
+   *try_again = TRUE;
rc = NULL;
-   goto Away;
+   goto cleanups;
}
ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
if (ctx == NULL) {
ERRDRV("%s (%s:%d) - failed to allocate %d bytes",
   __func__, __FILE__, __LINE__, allocbytes);
-   if (tryAgain)
-   *tryAgain = TRUE;
+   if (try_again)
+   *try_again = TRUE;
rc = NULL;
-   goto Away;
+   goto cleanups;
}
 
ctx->allocbytes = allocbytes;
@@ -82,7 +82,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
ctx->curr = NULL;
ctx->bytes_remaining = 0;
ctx->byte_stream = FALSE;
-   if (isLocal) {
+   if (is_local) {
void *p;
 
if (addr > virt_to_phys(high_memory - 1)) {
@@ -90,7 +90,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   __func__,
   (unsigned long long) addr, (ulong) bytes);
rc = NULL;
-   goto Away;
+   goto cleanups;
}
p = __va((ulong) (addr));
memcpy(ctx->data, p, bytes);
@@ -98,17 +98,17 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
rgn = visor_memregion_create(addr, bytes);
if (!rgn) {
rc = NULL;
-   goto Away;
+   goto cleanups;
}
if (visor_memregion_read(rgn, 0, ctx->data, bytes) < 0) {
rc = NULL;
-   goto Away;
+   goto cleanups;
}
}
-   if (!hasStandardPayloadHeader) {
+   if (!has_standard_payload_header) {
ctx->byte_stream = TRUE;
rc = ctx;
-   goto Away;
+   goto cleanups;
}
phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
if (phdr->total_length != bytes) {
@@ -116,7 +116,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   __func__,
   (ulong) (phdr->total_length), (ulong) (bytes));
rc = NULL;
-   goto Away;
+   goto cleanups;
}
if (phdr->total_length < phdr->header_length) {
ERRDRV("%s - total length < header length (%lu < %lu)",
@@ -124,7 +124,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   (ulong) (phdr->total_length),
   (ulong) (phdr->header_length));
rc = NULL;
-   goto Away;
+   goto cleanups;
}
if (phdr->header_length <
sizeof(struct spar_controlvm_parameters_header)) {
@@ -134,11 +134,11 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
   (ulong)(siz

[PATCH 05/10] staging: unisys: PARSER_WHICH_STRING typedef

2014-11-12 Thread Jeffrey Brown
Removed the typedef of PARSER_WHICH_STRING and replaced all
instance of the typedef with enum parser_which_string. Also
changed the name of it to parser_which_string
PARSER_WHICH_STRING => parser_which_string

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 2 +-
 drivers/staging/unisys/visorchipset/parser.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 4a880b8..fad3fdb 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -211,7 +211,7 @@ parser_id_get(struct parser_context_tag *ctx)
 
 void
 parser_param_start(struct parser_context_tag *ctx,
-  PARSER_WHICH_STRING which_string)
+  enum parser_which_string which_string)
 {
struct spar_controlvm_parameters_header *phdr = NULL;
 
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index de3f37b..5b802fc 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -24,12 +24,12 @@
 #include "timskmod.h"
 #include "channel.h"
 
-typedef enum {
+enum parser_which_string {
PARSERSTRING_INITIATOR,
PARSERSTRING_TARGET,
PARSERSTRING_CONNECTION,
PARSERSTRING_NAME,
-} PARSER_WHICH_STRING;
+};
 
 struct parser_context_tag *parser_init(u64 addr, u32 bytes, BOOL is_local,
   BOOL *try_again);
@@ -37,7 +37,7 @@ struct parser_context_tag *parser_init_bytestream(u64 addr, 
u32 bytes,
  BOOL is_local,
  BOOL *try_again);
 void parser_param_start(struct parser_context_tag *ctx,
-   PARSER_WHICH_STRING which_string);
+   enum parser_which_string which_string);
 void *parser_param_get(struct parser_context_tag *ctx, char *nam, int 
namesize);
 void *parser_string_get(struct parser_context_tag *ctx);
 uuid_le parser_id_get(struct parser_context_tag *ctx);
-- 
1.8.4

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


[PATCH 09/10] staging: unisys: parser.c braces

2014-11-12 Thread Jeffrey Brown
Inserted a necessary brace for an if statement on line 146 of
parser.c

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 17c1649..6381e59 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -143,9 +143,9 @@ cleanups:
visor_memregion_destroy(rgn);
rgn = NULL;
}
-   if (rc)
+   if (rc) {
controlvm_payload_bytes_buffered += ctx->param_bytes;
-   else {
+   } else {
if (ctx) {
parser_done(ctx);
ctx = NULL;
-- 
1.8.4

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


[PATCH 03/10] staging: unisys: simpleString_get & byteStream_get camel case

2014-11-12 Thread Jeffrey Brown
Fixed the camel case for parser_byteStream_get and
parser_simpleString_get
parser_simpleString_get => parser_simplestring_get
parser_byteStream_get => parser_bytestream_get

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 drivers/staging/unisys/visorchipset/parser.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 8cd3b4f..50180f3 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -174,7 +174,7 @@ parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, 
BOOL *try_again)
 /* Obtain '\0'-terminated copy of string in payload area.
  */
 char *
-parser_simpleString_get(PARSER_CONTEXT *ctx)
+parser_simplestring_get(PARSER_CONTEXT *ctx)
 {
if (!ctx->byte_stream)
return NULL;
@@ -186,7 +186,7 @@ parser_simpleString_get(PARSER_CONTEXT *ctx)
 /* Obtain a copy of the buffer in the payload area.
  */
 void *
-parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
+parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
 {
if (!ctx->byte_stream)
return NULL;
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 10b922e..fa12df8 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -36,13 +36,13 @@ typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
 PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
BOOL *try_again);
 PARSER_CONTEXT  *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
-  BOOL *try_again);
+   BOOL *try_again);
 void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
 void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
 void *parser_string_get(PARSER_CONTEXT *ctx);
 uuid_le parser_id_get(PARSER_CONTEXT *ctx);
-char *parser_simpleString_get(PARSER_CONTEXT *ctx);
-void *parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
+char *parser_simplestring_get(PARSER_CONTEXT *ctx);
+void *parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
 void parser_done(PARSER_CONTEXT *ctx);
 
 #endif
-- 
1.8.4

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


[PATCH 10/10] staging: unisys: parser.c logical continuation

2014-11-12 Thread Jeffrey Brown
Fixed a logical continuation on line 391 by placing the '||'
operator on line 390

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 6381e59..5f6a7b2 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -387,8 +387,8 @@ parser_param_get(struct parser_context_tag *ctx, char *nam, 
int namesize)
break;
}
} else
-   if (pscan[i] == ',' || pscan[i] == ';'
-   || pscan[i] == '\0') {
+   if (pscan[i] == ',' || pscan[i] == ';' ||
+   pscan[i] == '\0') {
value_length = i;
break;
}
-- 
1.8.4

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


[PATCH 04/71] staging: unisys: kzalloc visorchipset_main.c

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Inserted preferred sizeof statements for kzalloc in visorchipset_
main.c
line 1127: kzalloc(sizeof(*pBusInfo)...)
line 1277: kzalloc(sizeof(*pDevInfo)...)

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index eaa7a8a..14ecb0e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1124,7 +1124,7 @@ bus_create(struct controlvm_message *inmsg)
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
goto Away;
}
-   pBusInfo = kzalloc(sizeof(struct visorchipset_bus_info), GFP_KERNEL);
+   pBusInfo = kzalloc(sizeof(*pBusInfo), GFP_KERNEL);
if (pBusInfo == NULL) {
LOGERR("CONTROLVM_BUS_CREATE Failed: bus %lu kzalloc failed",
   busNo);
@@ -1274,7 +1274,7 @@ my_device_create(struct controlvm_message *inmsg)
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
goto Away;
}
-   pDevInfo = kzalloc(sizeof(struct visorchipset_device_info), GFP_KERNEL);
+   pDevInfo = kzalloc(sizeof(*pDevInfo), GFP_KERNEL);
if (pDevInfo == NULL) {
LOGERR("CONTROLVM_DEVICE_CREATE Failed: busNo=%lu, devNo=%lu 
kmaloc failed",
   busNo, devNo);
-- 
1.8.4

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


[PATCH 00/71] visorchipset_main.c patches

2014-11-12 Thread Jeffrey Brown
I am really sorry about the exterme number of patches I
gave you, it was a very large file to take care of I could
make the number of patches a little less if you want. The
patches start off simple by taking care of trivial stuff
like alignment and space after casts.  The patches go into
the camel cases. The camel cases are grouped  based on the name
of the function or structs they are in. If they don't belong
to one then they get a patch on their own. Last but not least
the typedefs are done and the array checks are fixed

Jeffrey (71):
  staging: unisys: space after a cast visorchipset_main.c
  staging: unisys: Alignment fixes visorchipset_main.c
  staging: unisys: visorchipset_main.c logical continuations
  staging: unisys: kzalloc visorchipset_main.c
  staging: unisys: visorchipset_main.c braces and spaces
  staging: unisys: Poll_jiffies camel case
  staging: unisys: Most_recent_message_jiffies
  staging: unisys: Periodic_controlvm_work camel case
  stating: unisys: Periodic_controlvm_workqueue camel case
  staging: unisys: NotifierLock camel case
  staging: unisys: controlvm_message_header camel case
  staging: unisys: static const uuid_le camel case
  staging: unisys: invalid bus/device number camel cases
  staging: unisys: controlvm_message_packet camel case
  staging: unisys: LIST_HEAD info list camel cases
  staging: unisys: Controlvm_channel camel case
  staging: unisys: Test_Vnic_channel camel case
  staging: unisys: LIVEDUMP_INFO camel cases
  staging: unisys: Controlvm_payload_info camel case
  staging: unisys: Livedump_info camel case
  staging: unisys: Controlvm_pending_msg camel case
  staging: unisys: Putfile_buffer_list_pool_name camel case
  staging: unisys: Putfile_buffer_list_pool camel case
  staging: unisys: Putfile_request_list camel case
  staging: unisys: atomic_t camel case
  staging: unisys: Parahotplug_request_list camel case
  staging: unisys: visorchipset_busdev_notifiers camel cases
  staging: unisys: bus_create_response camel cases
  staging: unisys: bus_destroy_response camel cases
  staging: unisys: device_create_response camel cases
  staging: unisys: device_destroy_response camel cases
  staging: unisys: device_resume_response camel cases
  staging: unisys: BusDev_Responders camel case
  staging: unisys: Controlvm_Pending_Msg_Valid camel case
  staging: unisys: Parahotplug_request_list_lock camel case
  staging: unisys: MajorDev camel case
  staging: unisys: platform_device camel case
  staging: unisys: controlvm prototype camel cases
  staging: unisys: toolAction camel cases
  staging: unisys: efisparindication camel cases
  staging: unisys: textId camel cases
  staging: unisys: remainingSteps camel cases
  staging: unisys: busInfo_clear camel cases
  staging: unisys: devInfo_clear camel case
  staging: unisys: chipset_init camel cases
  staging: unisys: controlvm camel cases
  staging: unisys: visorchipset_save_message camel cases
  staging: unisys: bus_responder camel case
  staging: unisys: device_changestate_responder camel cases
  staging: unisys: device_responder camel cases
  staging: unisys: bus_epilog camel cases
  staging: unisys: device_epilog camel case
  staging: unisys: bus_create camel cases
  staging: unisys: bus_destroy camel cases
  staging: unisys: bus_configure camel case
  staging: unisys: my_device_create camel cases
  staging: unisys: my_device_changestate camel case
  staging: unisys: my_device_destroy camel cases
  staging: unisys: initialize_controlvm_payload_info camel case
  staging: unisys: initialize_controlvm_payload camel case
  staging: unisys: chipset camel cases
  staging: unisys: handle_command camel cases
  staging: unisys: controlvm_periodic_work camel cases
  staging: unisys: setup_crash_devices_work_queue camel cases
  staging: unisys: visorchipset_init camel cases
  staging: unisys: testUnicode camel case
  staging: unisys: Unnecessary parentheses
  staging: unisys: MESSAGE_ENVELOPE typedef
  staging: unisys: CONTROLVM_PAYLOAD_INFO typedef
  staging: unisys: LIVEDUMP_INFO typedef
  staging: unisys: static const chars visorchipset_main.c

 .../unisys/visorchipset/visorchipset_main.c| 1270 ++--
 1 file changed, 639 insertions(+), 631 deletions(-)

-- 
1.8.4

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


[PATCH 05/71] staging: unisys: visorchipset_main.c braces and spaces

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Inserted and formatted braces properly, also removed unnecessary
spaces that were usually surrounding the braces

Signed-off-by: Jeffrey Brown 
---
 .../unisys/visorchipset/visorchipset_main.c| 24 +-
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 14ecb0e..fef28c0 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -485,7 +485,6 @@ static ssize_t textid_store(struct device *dev, struct 
device_attribute *attr,
return count;
 }
 
-
 static ssize_t remaining_steps_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
@@ -956,9 +955,9 @@ bus_epilog(u32 busNo,
if (needResponse) {
memcpy(&pBusInfo->pending_msg_hdr, msgHdr,
   sizeof(struct controlvm_message_header));
-   } else
+   } else {
pBusInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
-
+   }
down(&NotifierLock);
if (response == CONTROLVM_RESP_SUCCESS) {
switch (cmd) {
@@ -1033,9 +1032,9 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
if (needResponse) {
memcpy(&pDevInfo->pending_msg_hdr, msgHdr,
   sizeof(struct controlvm_message_header));
-   } else
+   } else {
pDevInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
-
+   }
down(&NotifierLock);
if (response >= 0) {
switch (cmd) {
@@ -1114,7 +1113,6 @@ bus_create(struct controlvm_message *inmsg)
int rc = CONTROLVM_RESP_SUCCESS;
struct visorchipset_bus_info *pBusInfo = NULL;
 
-
pBusInfo = findbus(&BusInfoList, busNo);
if (pBusInfo && (pBusInfo->state.created == 1)) {
LOGERR("CONTROLVM_BUS_CREATE Failed: bus %lu already exists",
@@ -2004,8 +2002,9 @@ controlvm_periodic_work(struct work_struct *work)
inmsg = ControlVm_Pending_Msg;
ControlVm_Pending_Msg_Valid = FALSE;
gotACommand = TRUE;
-   } else
+   } else {
gotACommand = read_controlvm_event(&inmsg);
+   }
}
 
handle_command_failed = FALSE;
@@ -2057,7 +2056,6 @@ Away:
 static void
 setup_crash_devices_work_queue(struct work_struct *work)
 {
-
struct controlvm_message localCrashCreateBusMsg;
struct controlvm_message localCrashCreateDevMsg;
struct controlvm_message msg;
@@ -2138,9 +2136,9 @@ setup_crash_devices_work_queue(struct work_struct *work)
}
 
/* reuse IOVM create bus message */
-   if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0)
+   if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0) {
bus_create(&localCrashCreateBusMsg);
-   else {
+   } else {
LOGERR("CrashCreateBusMsg is null, no dump will be taken");
POSTCODE_LINUX_2(CRASH_DEV_BUS_NULL_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
@@ -2148,9 +2146,9 @@ setup_crash_devices_work_queue(struct work_struct *work)
}
 
/* reuse create device message for storage device */
-   if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0)
+   if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0) {
my_device_create(&localCrashCreateDevMsg);
-   else {
+   } else {
LOGERR("CrashCreateDevMsg is null, no dump will be taken");
POSTCODE_LINUX_2(CRASH_DEV_DEV_NULL_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
@@ -2195,7 +2193,6 @@ device_destroy_response(ulong busNo, ulong devNo, int 
response)
 void
 visorchipset_device_pause_response(ulong bus_no, ulong dev_no, int response)
 {
-
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
 bus_no, dev_no, response,
 segment_state_standby);
@@ -2479,7 +2476,6 @@ visorchipset_init(void)
 DIAG_SEVERITY_ERR);
goto Away;
}
-
}
 
Visorchipset_platform_device.dev.devt = MajorDev;
-- 
1.8.4

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


[PATCH 01/71] staging: unisys: space after a cast visorchipset_main.c

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Removed all spaces after casts in visorchipset_main.c

Signed-off-by: Jeffrey Brown 
---
 .../unisys/visorchipset/visorchipset_main.c| 62 +++---
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c8f7bea..003b6f3 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -542,7 +542,7 @@ testUnicode(void)
 static void
 busInfo_clear(void *v)
 {
-   struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) (v);
+   struct visorchipset_bus_info *p = (struct visorchipset_bus_info *)(v);
 
if (p->proc_object) {
visor_proc_DestroyObject(p->proc_object);
@@ -700,7 +700,7 @@ controlvm_init_response(struct controlvm_message *msg,
msg->hdr.payload_max_bytes = 0;
if (response < 0) {
msg->hdr.flags.failed = 1;
-   msg->hdr.completion_status = (u32) (-response);
+   msg->hdr.completion_status = (u32)(-response);
}
 }
 
@@ -851,7 +851,7 @@ bus_responder(enum controlvm_id cmdId, ulong busNo, int 
response)
LOGERR("bus_responder no pending msg");
return; /* no controlvm response needed */
}
-   if (p->pending_msg_hdr.id != (u32) cmdId) {
+   if (p->pending_msg_hdr.id != (u32)cmdId) {
LOGERR("expected=%d, found=%d", cmdId, p->pending_msg_hdr.id);
return;
}
@@ -923,7 +923,7 @@ device_responder(enum controlvm_id cmdId, ulong busNo, 
ulong devNo,
LOGERR("device_responder no pending msg");
return; /* no controlvm response needed */
}
-   if (p->pending_msg_hdr.id != (u32) cmdId) {
+   if (p->pending_msg_hdr.id != (u32)cmdId) {
LOGERR("expected=%d, found=%d", cmdId, p->pending_msg_hdr.id);
return;
}
@@ -1399,14 +1399,14 @@ initialize_controlvm_payload_info(HOSTADDRESS 
phys_addr, u64 offset, u32 bytes,
memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
if ((offset == 0) || (bytes == 0)) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: 
request_payload_offset=%llu request_payload_bytes=%llu!",
-(u64) offset, (u64) bytes);
+(u64)offset, (u64)bytes);
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto Away;
}
payload = ioremap_cache(phys_addr + offset, bytes);
if (payload == NULL) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: ioremap_cache %llu for 
%llu bytes failed",
-(u64) offset, (u64) bytes);
+(u64)offset, (u64)bytes);
rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
goto Away;
}
@@ -1415,7 +1415,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, 
u64 offset, u32 bytes,
info->bytes = bytes;
info->ptr = payload;
LOGINF("offset=%llu, bytes=%lu, ptr=%p",
-  (u64) (info->offset), (ulong) (info->bytes), info->ptr);
+  (u64)(info->offset), (ulong)(info->bytes), info->ptr);
 
 Away:
if (rc < 0) {
@@ -1819,9 +1819,9 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
return FALSE;
}
LOGWRN("parsing failed");
-   LOGWRN("inmsg.hdr.Id=0x%lx", (ulong) inmsg.hdr.id);
-   LOGWRN("parametersAddr=0x%llx", (u64) parametersAddr);
-   LOGWRN("parametersBytes=%lu", (ulong) parametersBytes);
+   LOGWRN("inmsg.hdr.Id=0x%lx", (ulong)inmsg.hdr.id);
+   LOGWRN("parametersAddr=0x%llx", (u64)parametersAddr);
+   LOGWRN("parametersBytes=%lu", (ulong)parametersBytes);
LOGWRN("isLocalAddr=%d", isLocalAddr);
}
}
@@ -1838,42 +1838,42 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
switch (inmsg.hdr.id) {
case CONTROLVM_CHIPSET_INIT:
LOGINF("CHIPSET_INIT(#busses=%lu,#switches=%lu)",
-  (ulong) inmsg.cmd.init_chipset.bus_count,
-  (ulong) inmsg.cmd.init_chipset.switch_count);
+  (ulong)inmsg.cmd.init_chipset.bus_count,
+  (ulong)inmsg.cmd.init_chipset.switch_count);
chipset_init(&inmsg);
break;
case CONTROLVM_BUS_CREATE:
LOGINF("BUS_CREATE(%lu,#devs=%lu)",
-  (ulong) cmd->create_bus.bus_no,
-  (ulong) cmd->create_bus.dev_count);
+  (ulong)cmd->create_bus.bus_no,
+  (ulong)cmd->create_bus.dev_count);
bus_

[PATCH 41/71] staging: unisys: textId camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the u32 textId to textid in the static ssize_ts textid_show
and textid_store
textId => textid

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 80a81cc..b7da582 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -459,27 +459,27 @@ static ssize_t error_store(struct device *dev, struct 
device_attribute *attr,
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
   char *buf)
 {
-   u32 textId;
+   u32 textid;
 
visorchannel_read(controlvm_channel, offsetof(
struct spar_controlvm_channel_protocol, installation_text_id),
-   &textId, sizeof(u32));
-   return scnprintf(buf, PAGE_SIZE, "%i\n", textId);
+   &textid, sizeof(u32));
+   return scnprintf(buf, PAGE_SIZE, "%i\n", textid);
 }
 
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
 {
-   u32 textId;
+   u32 textid;
int ret;
 
-   if (kstrtou32(buf, 10, &textId) != 0)
+   if (kstrtou32(buf, 10, &textid) != 0)
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
 offsetof(struct 
spar_controlvm_channel_protocol,
  installation_text_id),
- &textId, sizeof(u32));
+ &textid, sizeof(u32));
if (ret)
return ret;
return count;
-- 
1.8.4

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


[PATCH 10/71] staging: unisys: NotifierLock camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Replaced the static DEFINE_SEMAPHORE NotifierLock with notifierlock
NotifierLock => notifierlock

Signed-off-by: Jeffrey Brown 
---
 .../staging/unisys/visorchipset/visorchipset_main.c| 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 58ffe19..8099c21 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -69,7 +69,7 @@ static u8 chipset_events[MAX_CHIPSET_EVENTS] = { 0, 0 };
 
 static struct delayed_work periodic_controlvm_work;
 static struct workqueue_struct *periodic_controlvm_workqueue;
-static DEFINE_SEMAPHORE(NotifierLock);
+static DEFINE_SEMAPHORE(notifierlock);
 
 typedef struct {
struct controlvm_message message;
@@ -600,7 +600,7 @@ visorchipset_register_busdev_server(
struct visorchipset_busdev_responders *responders,
struct ultra_vbus_deviceinfo *driver_info)
 {
-   down(&NotifierLock);
+   down(¬ifierlock);
if (notifiers == NULL) {
memset(&BusDev_Server_Notifiers, 0,
   sizeof(BusDev_Server_Notifiers));
@@ -615,7 +615,7 @@ visorchipset_register_busdev_server(
bus_device_info_init(driver_info, "chipset", "visorchipset",
 VERSION, NULL);
 
-   up(&NotifierLock);
+   up(¬ifierlock);
 }
 EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server);
 
@@ -625,7 +625,7 @@ visorchipset_register_busdev_client(
struct visorchipset_busdev_responders *responders,
struct ultra_vbus_deviceinfo *driver_info)
 {
-   down(&NotifierLock);
+   down(¬ifierlock);
if (notifiers == NULL) {
memset(&BusDev_Client_Notifiers, 0,
   sizeof(BusDev_Client_Notifiers));
@@ -639,7 +639,7 @@ visorchipset_register_busdev_client(
if (driver_info)
bus_device_info_init(driver_info, "chipset(bolts)",
 "visorchipset", VERSION, NULL);
-   up(&NotifierLock);
+   up(¬ifierlock);
 }
 EXPORT_SYMBOL_GPL(visorchipset_register_busdev_client);
 
@@ -958,7 +958,7 @@ bus_epilog(u32 busNo,
} else {
pBusInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
}
-   down(&NotifierLock);
+   down(¬ifierlock);
if (response == CONTROLVM_RESP_SUCCESS) {
switch (cmd) {
case CONTROLVM_BUS_CREATE:
@@ -1003,7 +1003,7 @@ bus_epilog(u32 busNo,
;
else
bus_responder(cmd, busNo, response);
-   up(&NotifierLock);
+   up(¬ifierlock);
 }
 
 static void
@@ -1035,7 +1035,7 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
} else {
pDevInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
}
-   down(&NotifierLock);
+   down(¬ifierlock);
if (response >= 0) {
switch (cmd) {
case CONTROLVM_DEVICE_CREATE:
@@ -1102,7 +1102,7 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
;
else
device_responder(cmd, busNo, devNo, response);
-   up(&NotifierLock);
+   up(¬ifierlock);
 }
 
 static void
-- 
1.8.4

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


[PATCH 13/71] staging: unisys: invalid bus/device number camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed two static ulongs that are supposed to represent invalid
bus/device numbers
g_diagpoolBusNo => g_diagpoolbusno
g_diagpoolDevNo => g_diagpooldevno

Signed-off-by: Jeffrey Brown 
---
 .../staging/unisys/visorchipset/visorchipset_main.c| 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 566fef7..4a1b69b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -82,8 +82,8 @@ static struct controlvm_message_header g_deldumpmsghdr;
 static const uuid_le ultradiagpoolchannelprotocolguid =
SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xff is an invalid Bus/Device number */
-static ulong g_diagpoolBusNo = 0xff;
-static ulong g_diagpoolDevNo = 0xff;
+static ulong g_diagpoolbusno = 0xff;
+static ulong g_diagpooldevno = 0xff;
 static struct controlvm_message_packet g_DeviceChangeStatePacket;
 
 /* Only VNIC and VHBA channels are sent to visorclientbus (aka
@@ -720,9 +720,9 @@ controlvm_respond(struct controlvm_message_header *msgHdr, 
int response)
* back the deviceChangeState structure in the packet. */
if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
g_DeviceChangeStatePacket.device_change_state.bus_no ==
-   g_diagpoolBusNo &&
+   g_diagpoolbusno &&
g_DeviceChangeStatePacket.device_change_state.dev_no ==
-   g_diagpoolDevNo)
+   g_diagpooldevno)
outmsg.cmd = g_DeviceChangeStatePacket;
if (outmsg.hdr.flags.test_message == 1) {
LOGINF("%s controlvm_msg=0x%x response=%d for test message",
@@ -1073,8 +1073,8 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
/* this is lite pause where channel is
 * still valid just 'pause' of it
 */
-   if (busNo == g_diagpoolBusNo &&
-   devNo == g_diagpoolDevNo) {
+   if (busNo == g_diagpoolbusno &&
+   devNo == g_diagpooldevno) {

LOGINF("DEVICE_CHANGESTATE(DiagpoolChannel busNo=%d devNo=%d is pausing...)",
   busNo, devNo);
/* this will trigger the
@@ -1305,10 +1305,10 @@ Away:
/* get the bus and devNo for DiagPool channel */
if (pDevInfo &&
is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
-   g_diagpoolBusNo = busNo;
-   g_diagpoolDevNo = devNo;
+   g_diagpoolbusno = busNo;
+   g_diagpooldevno = devNo;
LOGINF("CONTROLVM_DEVICE_CREATE for DiagPool channel: 
busNo=%lu, devNo=%lu",
-  g_diagpoolBusNo, g_diagpoolDevNo);
+  g_diagpoolbusno, g_diagpooldevno);
}
device_epilog(busNo, devNo, segment_state_running,
  CONTROLVM_DEVICE_CREATE, &inmsg->hdr, rc,
-- 
1.8.4

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


[PATCH 34/71] staging: unisys: Controlvm_Pending_Msg_Valid camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static BOOL to controlvm_pending_msg_valid
Controlvm_Pending_Msg_Valid => controlvm_pending_msg_valid

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 5096a85..887e3be 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -137,7 +137,7 @@ static LIVEDUMP_INFO livedump_info;
  * process it again the next time controlvm_periodic_work() runs.
  */
 static struct controlvm_message controlvm_pending_msg;
-static BOOL ControlVm_Pending_Msg_Valid = FALSE;
+static BOOL controlvm_pending_msg_valid = FALSE;
 
 /* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
  * TRANSMIT_FILE PutFile payloads.
@@ -1994,13 +1994,13 @@ controlvm_periodic_work(struct work_struct *work)
}
}
if (!gotACommand) {
-   if (ControlVm_Pending_Msg_Valid) {
+   if (controlvm_pending_msg_valid) {
/* we throttled processing of a prior
* msg, so try to process it again
* rather than reading a new one
*/
inmsg = controlvm_pending_msg;
-   ControlVm_Pending_Msg_Valid = FALSE;
+   controlvm_pending_msg_valid = FALSE;
gotACommand = TRUE;
} else {
gotACommand = read_controlvm_event(&inmsg);
@@ -2023,7 +2023,7 @@ controlvm_periodic_work(struct work_struct *work)
*/
handle_command_failed = TRUE;
controlvm_pending_msg = inmsg;
-   ControlVm_Pending_Msg_Valid = TRUE;
+   controlvm_pending_msg_valid = TRUE;
}
}
 
-- 
1.8.4

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


[PATCH 39/71] staging: unisys: toolAction camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases of toolAction to toolaction in the static
ssize_ts toolaction_store, and toolaction_show
toolAction => toolaction

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 83382ec..d21752f 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -364,28 +364,28 @@ static ssize_t toolaction_show(struct device *dev,
   struct device_attribute *attr,
   char *buf)
 {
-   u8 toolAction;
+   u8 toolaction;
 
visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
-  tool_action), &toolAction, sizeof(u8));
-   return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
+  tool_action), &toolaction, sizeof(u8));
+   return scnprintf(buf, PAGE_SIZE, "%u\n", toolaction);
 }
 
 static ssize_t toolaction_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
 {
-   u8 toolAction;
+   u8 toolaction;
int ret;
 
-   if (kstrtou8(buf, 10, &toolAction) != 0)
+   if (kstrtou8(buf, 10, &toolaction) != 0)
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
 offsetof(struct 
spar_controlvm_channel_protocol,
  tool_action),
- &toolAction, sizeof(u8));
+ &toolaction, sizeof(u8));
 
if (ret)
return ret;
-- 
1.8.4

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


[PATCH 36/71] staging: unisys: MajorDev camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static dev_t at line 252 to majordev
Major => majordev

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1a04e5b..6263dea 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -249,7 +249,7 @@ static struct visorchipset_busdev_responders 
busdev_responders = {
 };
 
 /* info for /dev/visorchipset */
-static dev_t MajorDev = -1; /**< indicates major num for device */
+static dev_t majordev = -1; /**< indicates major num for device */
 
 /* prototypes for attributes */
 static ssize_t toolaction_show(struct device *dev,
@@ -2421,8 +2421,8 @@ visorchipset_init(void)
return -ENODEV;
}
 
-   MajorDev = MKDEV(visorchipset_major, 0);
-   rc = visorchipset_file_init(MajorDev, &controlvm_channel);
+   majordev = MKDEV(visorchipset_major, 0);
+   rc = visorchipset_file_init(majordev, &controlvm_channel);
if (rc < 0) {
ERRDRV("visorchipset_file_init(MajorDev, &ControlVm_channel): 
error (status=%d)\n", rc);
POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
@@ -2478,7 +2478,7 @@ visorchipset_init(void)
}
}
 
-   Visorchipset_platform_device.dev.devt = MajorDev;
+   Visorchipset_platform_device.dev.devt = majordev;
if (platform_device_register(&Visorchipset_platform_device) < 0) {
ERRDRV("platform_device_register(visorchipset) failed: 
(status=-1)\n");
POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR);
-- 
1.8.4

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


[PATCH 03/71] staging: unisys: visorchipset_main.c logical continuations

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Fixed all logical continuations by moving the operators to their
correct lines, (which is the line previous to the operator)

Signed-off-by: Jeffrey Brown 
---
 .../unisys/visorchipset/visorchipset_main.c| 23 +++---
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 73cd0a3..eaa7a8a 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -91,8 +91,8 @@ static struct controlvm_message_packet 
g_DeviceChangeStatePacket;
  */
 #define FOR_VISORHACKBUS(channel_type_guid) \
(((uuid_le_cmp(channel_type_guid,\
-  spar_vnic_channel_protocol_uuid) == 0)\
-   || (uuid_le_cmp(channel_type_guid,\
+  spar_vnic_channel_protocol_uuid) == 0) ||\
+  (uuid_le_cmp(channel_type_guid,\
spar_vhba_channel_protocol_uuid) == 0)))
 #define FOR_VISORBUS(channel_type_guid) 
(!(FOR_VISORHACKBUS(channel_type_guid)))
 
@@ -719,10 +719,10 @@ controlvm_respond(struct controlvm_message_header 
*msgHdr, int response)
controlvm_init_response(&outmsg, msgHdr, response);
/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
* back the deviceChangeState structure in the packet. */
-   if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE
-   && g_DeviceChangeStatePacket.device_change_state.bus_no ==
-   g_diagpoolBusNo
-   && g_DeviceChangeStatePacket.device_change_state.dev_no ==
+   if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
+   g_DeviceChangeStatePacket.device_change_state.bus_no ==
+   g_diagpoolBusNo &&
+   g_DeviceChangeStatePacket.device_change_state.dev_no ==
g_diagpoolDevNo)
outmsg.cmd = g_DeviceChangeStatePacket;
if (outmsg.hdr.flags.test_message == 1) {
@@ -1074,8 +1074,8 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
/* this is lite pause where channel is
 * still valid just 'pause' of it
 */
-   if (busNo == g_diagpoolBusNo
-   && devNo == g_diagpoolDevNo) {
+   if (busNo == g_diagpoolBusNo &&
+   devNo == g_diagpoolDevNo) {

LOGINF("DEVICE_CHANGESTATE(DiagpoolChannel busNo=%d devNo=%d is pausing...)",
   busNo, devNo);
/* this will trigger the
@@ -1838,8 +1838,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
if (!isLocalAddr) {
controlvm_init_response(&ackmsg, &inmsg.hdr,
CONTROLVM_RESP_SUCCESS);
-   if ((ControlVm_channel)
-   &&
+   if ((ControlVm_channel) &&
(!visorchannel_signalinsert
 (ControlVm_channel, CONTROLVM_QUEUE_ACK, &ackmsg)))
LOGWRN("failed to send ACK failed");
@@ -1975,8 +1974,8 @@ controlvm_periodic_work(struct work_struct *work)
/* Check events to determine if response to CHIPSET_READY
 * should be sent
 */
-   if (visorchipset_holdchipsetready
-   && (g_ChipSetMsgHdr.id != CONTROLVM_INVALID)) {
+   if (visorchipset_holdchipsetready &&
+   (g_ChipSetMsgHdr.id != CONTROLVM_INVALID)) {
if (check_chipset_events() == 1) {
LOGINF("Sending CHIPSET_READY response");
controlvm_respond(&g_ChipSetMsgHdr, 0);
-- 
1.8.4

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


[PATCH 18/71] staging: unisys: LIVEDUMP_INFO camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases for the variables for the struct LIVEDUMP_
INFO
Dumpcapture_header => dumpcapture_header
Gettextdump_header => gettextdump_header
Dumpcomplete_header => dumpcomplete_header
Gettextdump_outstanding => gettextdump_outstanding

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 992b2c3..67d959e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -117,10 +117,10 @@ static CONTROLVM_PAYLOAD_INFO ControlVm_payload_info;
 static struct channel_header *test_vnic_channel;
 
 typedef struct {
-   struct controlvm_message_header Dumpcapture_header;
-   struct controlvm_message_header Gettextdump_header;
-   struct controlvm_message_header Dumpcomplete_header;
-   BOOL Gettextdump_outstanding;
+   struct controlvm_message_header dumpcapture_header;
+   struct controlvm_message_header gettextdump_header;
+   struct controlvm_message_header dumpcomplete_header;
+   BOOL gettextdump_outstanding;
u32 crc32;
ulong length;
atomic_t buffers_in_use;
-- 
1.8.4

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


[PATCH 02/71] staging: unisys: Alignment fixes visorchipset_main.c

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Fixed all alignment issues in visorchipset_main.c, kept the 80
character warnings in mind when doing so, and if there are any
warnings coming from this patch it is most likely that there was
an 80 character warning at the line before I fixed the alignment

Signed-off-by: Jeffrey Brown 
---
 .../unisys/visorchipset/visorchipset_main.c| 166 +++--
 1 file changed, 89 insertions(+), 77 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 003b6f3..73cd0a3 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -253,45 +253,52 @@ static dev_t MajorDev = -1; /**< indicates major num for 
device */
 
 /* prototypes for attributes */
 static ssize_t toolaction_show(struct device *dev,
-   struct device_attribute *attr, char *buf);
+  struct device_attribute *attr,
+  char *buf);
 static ssize_t toolaction_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+   struct device_attribute *attr,
+   const char *buf, size_t count);
 static DEVICE_ATTR_RW(toolaction);
 
 static ssize_t boottotool_show(struct device *dev,
-   struct device_attribute *attr, char *buf);
+  struct device_attribute *attr, char *buf);
 static ssize_t boottotool_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+   struct device_attribute *attr,
+   const char *buf, size_t count);
 static DEVICE_ATTR_RW(boottotool);
 
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
-   char *buf);
+ char *buf);
 static ssize_t error_store(struct device *dev, struct device_attribute *attr,
-   const char *buf, size_t count);
+  const char *buf, size_t count);
 static DEVICE_ATTR_RW(error);
 
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
-   char *buf);
+  char *buf);
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
-   const char *buf, size_t count);
+   const char *buf, size_t count);
 static DEVICE_ATTR_RW(textid);
 
 static ssize_t remaining_steps_show(struct device *dev,
-   struct device_attribute *attr, char *buf);
+   struct device_attribute *attr, char *buf);
 static ssize_t remaining_steps_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+struct device_attribute *attr,
+const char *buf, size_t count);
 static DEVICE_ATTR_RW(remaining_steps);
 
 static ssize_t chipsetready_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+ struct device_attribute *attr,
+ const char *buf, size_t count);
 static DEVICE_ATTR_WO(chipsetready);
 
 static ssize_t devicedisabled_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+   struct device_attribute *attr,
+   const char *buf, size_t count);
 static DEVICE_ATTR_WO(devicedisabled);
 
 static ssize_t deviceenabled_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+  struct device_attribute *attr,
+  const char *buf, size_t count);
 static DEVICE_ATTR_WO(deviceenabled);
 
 static struct attribute *visorchipset_install_attrs[] = {
@@ -360,8 +367,8 @@ static ssize_t toolaction_show(struct device *dev,
u8 toolAction;
 
visorchannel_read(ControlVm_channel,
-   offsetof(struct spar_controlvm_channel_protocol,
-  tool_action), &toolAction, sizeof(u8));
+ offsetof(struct spar_controlvm_channel_protocol,
+  tool_action), &toolAction, sizeof(u8));
return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
 }
 
@@ -376,8 +383,9 @@ static ssize_t toolaction_store(struct device *dev,
return -EINVAL;
 
ret = visorchannel_write(ControlVm_channel,
-   offsetof(struct spar_controlvm_channel_protocol, tool_action),
-   &toolAction, sizeof(u8));
+offsetof(struct 
spar_controlvm_channel_protocol,
+ tool_action),
+ &toolAction, sizeof(u8));
 
if (ret)
  

[PATCH 26/71] staging: unisys: Parahotplug_request_list camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static LIST_HEAD to parahotplug_request_list
Parahotplug_request => parahotplug_request

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7e1b176..f880f23 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -223,7 +223,7 @@ struct parahotplug_request {
struct controlvm_message msg;
 };
 
-static LIST_HEAD(Parahotplug_request_list);
+static LIST_HEAD(parahotplug_request_list);
 static DEFINE_SPINLOCK(Parahotplug_request_list_lock); /* lock for above */
 static void parahotplug_process_list(void);
 
@@ -1680,7 +1680,7 @@ parahotplug_process_list(void)
 
spin_lock(&Parahotplug_request_list_lock);
 
-   list_for_each_safe(pos, tmp, &Parahotplug_request_list) {
+   list_for_each_safe(pos, tmp, ¶hotplug_request_list) {
struct parahotplug_request *req =
list_entry(pos, struct parahotplug_request, list);
if (time_after_eq(jiffies, req->expiration)) {
@@ -1711,7 +1711,7 @@ parahotplug_request_complete(int id, u16 active)
spin_lock(&Parahotplug_request_list_lock);
 
/* Look for a request matching "id". */
-   list_for_each_safe(pos, tmp, &Parahotplug_request_list) {
+   list_for_each_safe(pos, tmp, ¶hotplug_request_list) {
struct parahotplug_request *req =
list_entry(pos, struct parahotplug_request, list);
if (req->id == id) {
@@ -1773,7 +1773,7 @@ parahotplug_process_message(struct controlvm_message 
*inmsg)
* indicated it's done.
*/
spin_lock(&Parahotplug_request_list_lock);
-   list_add_tail(&(req->list), &Parahotplug_request_list);
+   list_add_tail(&(req->list), ¶hotplug_request_list);
spin_unlock(&Parahotplug_request_list_lock);
 
parahotplug_request_kickoff(req);
-- 
1.8.4

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


[PATCH 42/71] staging: unisys: remainingSteps camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel case of remainingSteps in the static ssize_ts of
remaining_steps_show and remaining_steps_store
remainingSteps => remainingsteps

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b7da582..d3070dd 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -488,29 +488,29 @@ static ssize_t textid_store(struct device *dev, struct 
device_attribute *attr,
 static ssize_t remaining_steps_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
-   u16 remainingSteps;
+   u16 remainingsteps;
 
visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   installation_remaining_steps),
-  &remainingSteps, sizeof(u16));
-   return scnprintf(buf, PAGE_SIZE, "%hu\n", remainingSteps);
+  &remainingsteps, sizeof(u16));
+   return scnprintf(buf, PAGE_SIZE, "%hu\n", remainingsteps);
 }
 
 static ssize_t remaining_steps_store(struct device *dev,
 struct device_attribute *attr,
 const char *buf, size_t count)
 {
-   u16 remainingSteps;
+   u16 remainingsteps;
int ret;
 
-   if (kstrtou16(buf, 10, &remainingSteps) != 0)
+   if (kstrtou16(buf, 10, &remainingsteps) != 0)
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
 offsetof(struct 
spar_controlvm_channel_protocol,
  installation_remaining_steps),
- &remainingSteps, sizeof(u16));
+ &remainingsteps, sizeof(u16));
if (ret)
return ret;
return count;
-- 
1.8.4

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


[PATCH 38/71] staging: unisys: controlvm prototype camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel case msgHdr to msghdr in the static voids
controlvm_respond, controlvm_respond_chipset_init, & controlvm_-
respond_physdev_changestate
msgHdr => msghdr

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 5e7def3..83382ec 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -351,13 +351,13 @@ static struct platform_device 
visorchipset_platform_device = {
 };
 
 /* Function prototypes */
-static void controlvm_respond(struct controlvm_message_header *msgHdr,
+static void controlvm_respond(struct controlvm_message_header *msghdr,
  int response);
 static void controlvm_respond_chipset_init(
-   struct controlvm_message_header *msgHdr, int response,
+   struct controlvm_message_header *msghdr, int response,
enum ultra_chipset_feature features);
 static void controlvm_respond_physdev_changestate(
-   struct controlvm_message_header *msgHdr, int response,
+   struct controlvm_message_header *msghdr, int response,
struct spar_segment_state state);
 
 static ssize_t toolaction_show(struct device *dev,
-- 
1.8.4

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


[PATCH 47/71] staging: unisys: visorchipset_save_message camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases for the void visorchipset_save_message
localSavedCrashMsgOffset -> localsavedcrashmsgoffset
localSavedCrashMsgCount -> localsavedcrashmsgcount

Signed-off-by: Jeffrey Brown 
---
 .../staging/unisys/visorchipset/visorchipset_main.c| 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 8e18fb1..c96473d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -772,25 +772,25 @@ void
 visorchipset_save_message(struct controlvm_message *msg,
  enum crash_obj_type type)
 {
-   u32 localSavedCrashMsgOffset;
-   u16 localSavedCrashMsgCount;
+   u32 localsavedcrashmsgoffset;
+   u16 localsavedcrashmsgcount;
 
/* get saved message count */
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   saved_crash_message_count),
- &localSavedCrashMsgCount, sizeof(u16)) < 0) {
+ &localsavedcrashmsgcount, sizeof(u16)) < 0) {
LOGERR("failed to get Saved Message Count");
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
}
 
-   if (localSavedCrashMsgCount != CONTROLVM_CRASHMSG_MAX) {
+   if (localsavedcrashmsgcount != CONTROLVM_CRASHMSG_MAX) {
LOGERR("Saved Message Count incorrect %d",
-  localSavedCrashMsgCount);
+  localsavedcrashmsgcount);
POSTCODE_LINUX_3(CRASH_DEV_COUNT_FAILURE_PC,
-localSavedCrashMsgCount,
+localsavedcrashmsgcount,
 POSTCODE_SEVERITY_ERR);
return;
}
@@ -799,7 +799,7 @@ visorchipset_save_message(struct controlvm_message *msg,
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   saved_crash_message_offset),
- &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
+ &localsavedcrashmsgoffset, sizeof(u32)) < 0) {
LOGERR("failed to get Saved Message Offset");
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
@@ -808,7 +808,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 
if (type == CRASH_BUS) {
if (visorchannel_write(controlvm_channel,
-  localSavedCrashMsgOffset,
+  localsavedcrashmsgoffset,
   msg,
   sizeof(struct controlvm_message)) < 0) {
LOGERR("SAVE_MSG_BUS_FAILURE: Failed to write 
CrashCreateBusMsg!");
@@ -818,7 +818,7 @@ visorchipset_save_message(struct controlvm_message *msg,
}
} else {
if (visorchannel_write(controlvm_channel,
-  localSavedCrashMsgOffset +
+  localsavedcrashmsgoffset +
   sizeof(struct controlvm_message), msg,
   sizeof(struct controlvm_message)) < 0) {
LOGERR("SAVE_MSG_DEV_FAILURE: Failed to write 
CrashCreateDevMsg!");
-- 
1.8.4

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


[PATCH 31/71] staging: unisys: device_destroy_response camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases for the static void device_destroy_response
busNo -> busno
devNo -> devno

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index a0371de..dca74d4 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -236,7 +236,7 @@ static struct visorchipset_busdev_notifiers 
busdev_client_notifiers;
 static void bus_create_response(ulong busno, int response);
 static void bus_destroy_response(ulong busno, int response);
 static void device_create_response(ulong busno, ulong devno, int response);
-static void device_destroy_response(ulong busNo, ulong devNo, int response);
+static void device_destroy_response(ulong busno, ulong devno, int response);
 static void device_resume_response(ulong busNo, ulong devNo, int response);
 
 static struct visorchipset_busdev_responders BusDev_Responders = {
@@ -2185,9 +2185,9 @@ device_create_response(ulong busno, ulong devno, int 
response)
 }
 
 static void
-device_destroy_response(ulong busNo, ulong devNo, int response)
+device_destroy_response(ulong busno, ulong devno, int response)
 {
-   device_responder(CONTROLVM_DEVICE_DESTROY, busNo, devNo, response);
+   device_responder(CONTROLVM_DEVICE_DESTROY, busno, devno, response);
 }
 
 void
-- 
1.8.4

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


[PATCH 09/71] stating: unisys: Periodic_controlvm_workqueue camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed this static struct pointer to periodic_controlvm_workqueue
Periodic_controlvm_workqueue => periodic_controlvm_workqueue

Signed-off-by: Jeffrey Brown 
---
 .../staging/unisys/visorchipset/visorchipset_main.c| 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 2edf841..58ffe19 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -68,7 +68,7 @@ static int clientregistered;
 static u8 chipset_events[MAX_CHIPSET_EVENTS] = { 0, 0 };
 
 static struct delayed_work periodic_controlvm_work;
-static struct workqueue_struct *Periodic_controlvm_workqueue;
+static struct workqueue_struct *periodic_controlvm_workqueue;
 static DEFINE_SEMAPHORE(NotifierLock);
 
 typedef struct {
@@ -2049,7 +2049,7 @@ Away:
}
}
 
-   queue_delayed_work(Periodic_controlvm_workqueue,
+   queue_delayed_work(periodic_controlvm_workqueue,
   &periodic_controlvm_work, poll_jiffies);
 }
 
@@ -2162,7 +2162,7 @@ Away:
 
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
 
-   queue_delayed_work(Periodic_controlvm_workqueue,
+   queue_delayed_work(periodic_controlvm_workqueue,
   &periodic_controlvm_work, poll_jiffies);
 }
 
@@ -2455,10 +2455,10 @@ visorchipset_init(void)
else
INIT_DELAYED_WORK(&periodic_controlvm_work,
  controlvm_periodic_work);
-   Periodic_controlvm_workqueue =
+   periodic_controlvm_workqueue =
create_singlethread_workqueue("visorchipset_controlvm");
 
-   if (Periodic_controlvm_workqueue == NULL) {
+   if (periodic_controlvm_workqueue == NULL) {
ERRDRV("cannot create controlvm workqueue: 
(status=%d)\n",
   -ENOMEM);
POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
@@ -2468,7 +2468,7 @@ visorchipset_init(void)
}
most_recent_message_jiffies = jiffies;
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-   rc = queue_delayed_work(Periodic_controlvm_workqueue,
+   rc = queue_delayed_work(periodic_controlvm_workqueue,
&periodic_controlvm_work, poll_jiffies);
if (rc < 0) {

ERRDRV("queue_delayed_work(Periodic_controlvm_workqueue, 
&Periodic_controlvm_work, Poll_jiffies): error (status=%d)\n", rc);
@@ -2508,9 +2508,9 @@ visorchipset_exit(void)
;
} else {
cancel_delayed_work(&periodic_controlvm_work);
-   flush_workqueue(Periodic_controlvm_workqueue);
-   destroy_workqueue(Periodic_controlvm_workqueue);
-   Periodic_controlvm_workqueue = NULL;
+   flush_workqueue(periodic_controlvm_workqueue);
+   destroy_workqueue(periodic_controlvm_workqueue);
+   periodic_controlvm_workqueue = NULL;
destroy_controlvm_payload_info(&ControlVm_payload_info);
}
Test_Vnic_channel = NULL;
-- 
1.8.4

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


[PATCH 44/71] staging: unisys: devInfo_clear camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static void devInfo_clear to devinfo_clear
devInfo_clear => devinfo_clear

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ef7bd4f..1ceb016 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -565,7 +565,7 @@ businfo_clear(void *v)
 }
 
 static void
-devInfo_clear(void *v)
+devinfo_clear(void *v)
 {
struct visorchipset_device_info *p =
(struct visorchipset_device_info *)(v);
@@ -656,7 +656,7 @@ cleanup_controlvm_structures(void)
}
 
list_for_each_entry_safe(di, tmp_di, &devinfolist, entry) {
-   devInfo_clear(di);
+   devinfo_clear(di);
list_del(&di->entry);
kfree(di);
}
@@ -936,7 +936,7 @@ device_responder(enum controlvm_id cmdId, ulong busNo, 
ulong devNo,
controlvm_respond(&p->pending_msg_hdr, response);
p->pending_msg_hdr.id = CONTROLVM_INVALID;
if (need_clear)
-   devInfo_clear(p);
+   devinfo_clear(p);
 }
 
 static void
-- 
1.8.4

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


[PATCH 07/71] staging: unisys: Most_recent_message_jiffies

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static ulong to most_recent_message_jiffies
Most_recent_message_jiffies => most_recent_message_jiffies

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6fe2495..9f52d5c 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -51,7 +51,7 @@
 */
 #define MIN_IDLE_SECONDS 10
 static ulong poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-static ulong Most_recent_message_jiffies;  /* when we got our last
+static ulong most_recent_message_jiffies;  /* when we got our last
 * controlvm message */
 static inline char *
 NONULLSTR(char *s)
@@ -2009,7 +2009,7 @@ controlvm_periodic_work(struct work_struct *work)
 
handle_command_failed = FALSE;
while (gotACommand && (!handle_command_failed)) {
-   Most_recent_message_jiffies = jiffies;
+   most_recent_message_jiffies = jiffies;
if (handle_command(inmsg,
   visorchannel_get_physaddr
   (ControlVm_channel)))
@@ -2033,7 +2033,7 @@ controlvm_periodic_work(struct work_struct *work)
 Away:
 
if (time_after(jiffies,
-  Most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) {
+  most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) {
/* it's been longer than MIN_IDLE_SECONDS since we
* processed our last controlvm message; slow down the
* polling
@@ -2466,7 +2466,7 @@ visorchipset_init(void)
rc = -ENOMEM;
goto Away;
}
-   Most_recent_message_jiffies = jiffies;
+   most_recent_message_jiffies = jiffies;
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
rc = queue_delayed_work(Periodic_controlvm_workqueue,
&Periodic_controlvm_work, poll_jiffies);
-- 
1.8.4

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


[PATCH 25/71] staging: unisys: atomic_t camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the varaible Visorchipset_cache_buffers_in_use to
visorchipset_cache_buffers_in_use
Visorchipset_cache_buffer_in_use =>visorchipset_cache_buffer_in_use

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ed06d7b..7e1b176 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -214,7 +214,7 @@ struct putfile_request {
int completion_status;
 };
 
-static atomic_t Visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
+static atomic_t visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
 
 struct parahotplug_request {
struct list_head list;
@@ -2291,7 +2291,7 @@ visorchipset_cache_alloc(struct kmem_cache *pool, BOOL 
ok_to_block,
LOGERR("kmem_cache_alloc failed early @%s:%d\n", fn, ln);
return NULL;
}
-   atomic_inc(&Visorchipset_cache_buffers_in_use);
+   atomic_inc(&visorchipset_cache_buffers_in_use);
return p;
 }
 
@@ -2304,7 +2304,7 @@ visorchipset_cache_free(struct kmem_cache *pool, void *p, 
char *fn, int ln)
LOGERR("NULL pointer @%s:%d\n", fn, ln);
return;
}
-   atomic_dec(&Visorchipset_cache_buffers_in_use);
+   atomic_dec(&visorchipset_cache_buffers_in_use);
kmem_cache_free(pool, p);
 }
 
-- 
1.8.4

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


[PATCH 08/71] staging: unisys: Periodic_controlvm_work camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed this camel case to periodic_controlvm_work
Periodic_controlvm_work => periodic_controlvm_work

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 9f52d5c..2edf841 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -67,7 +67,7 @@ static int clientregistered;
 #define MAX_CHIPSET_EVENTS 2
 static u8 chipset_events[MAX_CHIPSET_EVENTS] = { 0, 0 };
 
-static struct delayed_work Periodic_controlvm_work;
+static struct delayed_work periodic_controlvm_work;
 static struct workqueue_struct *Periodic_controlvm_workqueue;
 static DEFINE_SEMAPHORE(NotifierLock);
 
@@ -2050,7 +2050,7 @@ Away:
}
 
queue_delayed_work(Periodic_controlvm_workqueue,
-  &Periodic_controlvm_work, poll_jiffies);
+  &periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -2163,7 +2163,7 @@ Away:
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
 
queue_delayed_work(Periodic_controlvm_workqueue,
-  &Periodic_controlvm_work, poll_jiffies);
+  &periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -2450,10 +2450,10 @@ visorchipset_init(void)
} else {
/* if booting in a crash kernel */
if (visorchipset_crash_kernel)
-   INIT_DELAYED_WORK(&Periodic_controlvm_work,
+   INIT_DELAYED_WORK(&periodic_controlvm_work,
  setup_crash_devices_work_queue);
else
-   INIT_DELAYED_WORK(&Periodic_controlvm_work,
+   INIT_DELAYED_WORK(&periodic_controlvm_work,
  controlvm_periodic_work);
Periodic_controlvm_workqueue =
create_singlethread_workqueue("visorchipset_controlvm");
@@ -2469,7 +2469,7 @@ visorchipset_init(void)
most_recent_message_jiffies = jiffies;
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
rc = queue_delayed_work(Periodic_controlvm_workqueue,
-   &Periodic_controlvm_work, poll_jiffies);
+   &periodic_controlvm_work, poll_jiffies);
if (rc < 0) {

ERRDRV("queue_delayed_work(Periodic_controlvm_workqueue, 
&Periodic_controlvm_work, Poll_jiffies): error (status=%d)\n", rc);
POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
@@ -2507,7 +2507,7 @@ visorchipset_exit(void)
if (visorchipset_disable_controlvm) {
;
} else {
-   cancel_delayed_work(&Periodic_controlvm_work);
+   cancel_delayed_work(&periodic_controlvm_work);
flush_workqueue(Periodic_controlvm_workqueue);
destroy_workqueue(Periodic_controlvm_workqueue);
Periodic_controlvm_workqueue = NULL;
-- 
1.8.4

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


[PATCH 06/71] staging: unisys: Poll_jiffies camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static ulong Poll_jiffies to poll_jiffies using
refactor and rename
Poll_jiffies => poll_jiffies

Signed-off-by: Jeffrey Brown 
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index fef28c0..6fe2495 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -50,7 +50,7 @@
 * message, we switch back to fast polling mode.
 */
 #define MIN_IDLE_SECONDS 10
-static ulong Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
+static ulong poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
 static ulong Most_recent_message_jiffies;  /* when we got our last
 * controlvm message */
 static inline char *
@@ -2038,19 +2038,19 @@ Away:
* processed our last controlvm message; slow down the
* polling
*/
-   if (Poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_SLOW) {
+   if (poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_SLOW) {
LOGINF("switched to slow controlvm polling");
-   Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
+   poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
}
} else {
-   if (Poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_FAST) {
-   Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
+   if (poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_FAST) {
+   poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
LOGINF("switched to fast controlvm polling");
}
}
 
queue_delayed_work(Periodic_controlvm_workqueue,
-  &Periodic_controlvm_work, Poll_jiffies);
+  &Periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -2160,10 +2160,10 @@ setup_crash_devices_work_queue(struct work_struct *work)
 
 Away:
 
-   Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
+   poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
 
queue_delayed_work(Periodic_controlvm_workqueue,
-  &Periodic_controlvm_work, Poll_jiffies);
+  &Periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -2467,9 +2467,9 @@ visorchipset_init(void)
goto Away;
}
Most_recent_message_jiffies = jiffies;
-   Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
+   poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
rc = queue_delayed_work(Periodic_controlvm_workqueue,
-   &Periodic_controlvm_work, Poll_jiffies);
+   &Periodic_controlvm_work, poll_jiffies);
if (rc < 0) {

ERRDRV("queue_delayed_work(Periodic_controlvm_workqueue, 
&Periodic_controlvm_work, Poll_jiffies): error (status=%d)\n", rc);
POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
-- 
1.8.4

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


[PATCH 19/71] staging: unisys: Controlvm_payload_info camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed this variable to controlvm_payload_info
Controlvm_payload_info => controlvm_payload_info

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 67d959e..0094401 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -112,7 +112,7 @@ typedef struct {
 } CONTROLVM_PAYLOAD_INFO;
 
 /* Manages the request payload in the controlvm channel */
-static CONTROLVM_PAYLOAD_INFO ControlVm_payload_info;
+static CONTROLVM_PAYLOAD_INFO controlvm_payload_info;
 
 static struct channel_header *test_vnic_channel;
 
@@ -1469,7 +1469,7 @@ initialize_controlvm_payload(void)
}
initialize_controlvm_payload_info(phys_addr,
  payloadOffset, payloadBytes,
- &ControlVm_payload_info);
+ &controlvm_payload_info);
 }
 
 /*  Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset.
@@ -2386,7 +2386,7 @@ visorchipset_init(void)
 
memset(&BusDev_Server_Notifiers, 0, sizeof(BusDev_Server_Notifiers));
memset(&BusDev_Client_Notifiers, 0, sizeof(BusDev_Client_Notifiers));
-   memset(&ControlVm_payload_info, 0, sizeof(ControlVm_payload_info));
+   memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
memset(&LiveDump_info, 0, sizeof(LiveDump_info));
atomic_set(&LiveDump_info.buffers_in_use, 0);
 
@@ -2511,7 +2511,7 @@ visorchipset_exit(void)
flush_workqueue(periodic_controlvm_workqueue);
destroy_workqueue(periodic_controlvm_workqueue);
periodic_controlvm_workqueue = NULL;
-   destroy_controlvm_payload_info(&ControlVm_payload_info);
+   destroy_controlvm_payload_info(&controlvm_payload_info);
}
test_vnic_channel = NULL;
if (Putfile_buffer_list_pool) {
-- 
1.8.4

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


[PATCH 14/71] staging: unisys: controlvm_message_packet camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel case g_DeviceChangeStatePacket to g_deicechange-
statepacket
g_DeviceChangeStatePacket => g_devicechangestatepacket

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4a1b69b..add38d5 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -84,7 +84,7 @@ static const uuid_le ultradiagpoolchannelprotocolguid =
 /* 0xff is an invalid Bus/Device number */
 static ulong g_diagpoolbusno = 0xff;
 static ulong g_diagpooldevno = 0xff;
-static struct controlvm_message_packet g_DeviceChangeStatePacket;
+static struct controlvm_message_packet g_devicechangestatepacket;
 
 /* Only VNIC and VHBA channels are sent to visorclientbus (aka
  * "visorhackbus")
@@ -719,11 +719,11 @@ controlvm_respond(struct controlvm_message_header 
*msgHdr, int response)
/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
* back the deviceChangeState structure in the packet. */
if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
-   g_DeviceChangeStatePacket.device_change_state.bus_no ==
+   g_devicechangestatepacket.device_change_state.bus_no ==
g_diagpoolbusno &&
-   g_DeviceChangeStatePacket.device_change_state.dev_no ==
+   g_devicechangestatepacket.device_change_state.dev_no ==
g_diagpooldevno)
-   outmsg.cmd = g_DeviceChangeStatePacket;
+   outmsg.cmd = g_devicechangestatepacket;
if (outmsg.hdr.flags.test_message == 1) {
LOGINF("%s controlvm_msg=0x%x response=%d for test message",
   __func__, outmsg.hdr.id, response);
@@ -1884,7 +1884,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
/* when sending back the response to Command */
my_device_changestate(&inmsg);
g_diagmsghdr = inmsg.hdr;
-   g_DeviceChangeStatePacket = inmsg.cmd;
+   g_devicechangestatepacket = inmsg.cmd;
break;
}
break;
-- 
1.8.4

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


[PATCH 23/71] staging: unisys: Putfile_buffer_list_pool camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static struct Putfile_buffer_list_pool to
putfile_buffer_list_pool
Putfile_buffer_list_pool => putfile_buffer_list_pool

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4b717cd..401b5ee 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -142,7 +142,7 @@ static BOOL ControlVm_Pending_Msg_Valid = FALSE;
 /* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
  * TRANSMIT_FILE PutFile payloads.
  */
-static struct kmem_cache *Putfile_buffer_list_pool;
+static struct kmem_cache *putfile_buffer_list_pool;
 static const char putfile_buffer_list_pool_name[] =
"controlvm_putfile_buffer_list_pool";
 
@@ -2435,11 +2435,11 @@ visorchipset_init(void)
 
memset(&g_deldumpmsghdr, 0, sizeof(struct controlvm_message_header));
 
-   Putfile_buffer_list_pool =
+   putfile_buffer_list_pool =
kmem_cache_create(putfile_buffer_list_pool_name,
  sizeof(struct putfile_buffer_entry),
  0, SLAB_HWCACHE_ALIGN, NULL);
-   if (!Putfile_buffer_list_pool) {
+   if (!putfile_buffer_list_pool) {
ERRDRV("failed to alloc Putfile_buffer_list_pool: 
(status=-1)\n");
POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
rc = -1;
@@ -2514,9 +2514,9 @@ visorchipset_exit(void)
destroy_controlvm_payload_info(&controlvm_payload_info);
}
test_vnic_channel = NULL;
-   if (Putfile_buffer_list_pool) {
-   kmem_cache_destroy(Putfile_buffer_list_pool);
-   Putfile_buffer_list_pool = NULL;
+   if (putfile_buffer_list_pool) {
+   kmem_cache_destroy(putfile_buffer_list_pool);
+   putfile_buffer_list_pool = NULL;
}
 
cleanup_controlvm_structures();
-- 
1.8.4

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


[PATCH 60/71] staging: unisys: initialize_controlvm_payload camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Fixed the static void initialize_controlvm_payload camel cases
payloadOffset -> payloadoffset
payloadBytes -> payloadbytes

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 78cb05c..c09b554 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1446,13 +1446,13 @@ static void
 initialize_controlvm_payload(void)
 {
HOSTADDRESS phys_addr = visorchannel_get_physaddr(controlvm_channel);
-   u64 payloadOffset = 0;
-   u32 payloadBytes = 0;
+   u64 payloadoffset = 0;
+   u32 payloadbytes = 0;
 
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   request_payload_offset),
- &payloadOffset, sizeof(payloadOffset)) < 0) {
+ &payloadoffset, sizeof(payloadoffset)) < 0) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed to read controlvm 
channel!");
POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
@@ -1461,14 +1461,14 @@ initialize_controlvm_payload(void)
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   request_payload_bytes),
- &payloadBytes, sizeof(payloadBytes)) < 0) {
+ &payloadbytes, sizeof(payloadbytes)) < 0) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed to read controlvm 
channel!");
POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
}
initialize_controlvm_payload_info(phys_addr,
- payloadOffset, payloadBytes,
+ payloadoffset, payloadbytes,
  &controlvm_payload_info);
 }
 
-- 
1.8.4

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


[PATCH 32/71] staging: unisys: device_resume_response camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases fore the static void device_resume_response
busNo -> busno
devNo -> devno

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index dca74d4..1ef4487 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -237,7 +237,7 @@ static void bus_create_response(ulong busno, int response);
 static void bus_destroy_response(ulong busno, int response);
 static void device_create_response(ulong busno, ulong devno, int response);
 static void device_destroy_response(ulong busno, ulong devno, int response);
-static void device_resume_response(ulong busNo, ulong devNo, int response);
+static void device_resume_response(ulong busno, ulong devno, int response);
 
 static struct visorchipset_busdev_responders BusDev_Responders = {
.bus_create = bus_create_response,
@@ -2200,10 +2200,10 @@ visorchipset_device_pause_response(ulong bus_no, ulong 
dev_no, int response)
 EXPORT_SYMBOL_GPL(visorchipset_device_pause_response);
 
 static void
-device_resume_response(ulong busNo, ulong devNo, int response)
+device_resume_response(ulong busno, ulong devno, int response)
 {
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
-busNo, devNo, response,
+busno, devno, response,
 segment_state_running);
 }
 
-- 
1.8.4

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


[PATCH 12/71] staging: unisys: static const uuid_le camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the uuid_le  UltraDiagpoolChannelProtocolGuid to
ultradiagpoolchannelprotocolguid in visorchipset_main.c
UltraDiagpoolChannelProtocolGuid => ultradiagpoolchannelprotocolguid

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1ad243f..566fef7 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -79,7 +79,7 @@ typedef struct {
 static struct controlvm_message_header g_diagmsghdr;
 static struct controlvm_message_header g_chipsetmsghdr;
 static struct controlvm_message_header g_deldumpmsghdr;
-static const uuid_le UltraDiagPoolChannelProtocolGuid =
+static const uuid_le ultradiagpoolchannelprotocolguid =
SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xff is an invalid Bus/Device number */
 static ulong g_diagpoolBusNo = 0xff;
@@ -97,7 +97,7 @@ static struct controlvm_message_packet 
g_DeviceChangeStatePacket;
 #define FOR_VISORBUS(channel_type_guid) 
(!(FOR_VISORHACKBUS(channel_type_guid)))
 
 #define is_diagpool_channel(channel_type_guid) \
-(uuid_le_cmp(channel_type_guid, UltraDiagPoolChannelProtocolGuid) == 0)
+(uuid_le_cmp(channel_type_guid, ultradiagpoolchannelprotocolguid) == 0)
 
 static LIST_HEAD(BusInfoList);
 static LIST_HEAD(DevInfoList);
-- 
1.8.4

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


[PATCH 43/71] staging: unisys: busInfo_clear camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Chagned the static void's name to businfo_clear
busInfo_clear => businfo_clear

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index d3070dd..ef7bd4f 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -546,7 +546,7 @@ testUnicode(void)
 #endif
 
 static void
-busInfo_clear(void *v)
+businfo_clear(void *v)
 {
struct visorchipset_bus_info *p = (struct visorchipset_bus_info *)(v);
 
@@ -650,7 +650,7 @@ cleanup_controlvm_structures(void)
struct visorchipset_device_info *di, *tmp_di;
 
list_for_each_entry_safe(bi, tmp_bi, &businfolist, entry) {
-   busInfo_clear(bi);
+   businfo_clear(bi);
list_del(&bi->entry);
kfree(bi);
}
@@ -864,7 +864,7 @@ bus_responder(enum controlvm_id cmdId, ulong busNo, int 
response)
controlvm_respond(&p->pending_msg_hdr, response);
p->pending_msg_hdr.id = CONTROLVM_INVALID;
if (need_clear) {
-   busInfo_clear(p);
+   businfo_clear(p);
delbusdevices(&devinfolist, busNo);
}
 }
-- 
1.8.4

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


[PATCH 24/71] staging: unisys: Putfile_request_list camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the static LIST_HEAD to putfile_request_list
Putfile_request_list => putfile_request_list

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 401b5ee..ed06d7b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -158,7 +158,7 @@ struct putfile_buffer_entry {
  * Each entry in this list identifies an outstanding TRANSMIT_FILE
  * conversation.
  */
-static LIST_HEAD(Putfile_request_list);
+static LIST_HEAD(putfile_request_list);
 
 /* This describes a buffer and its current state of transfer (e.g., how many
  * bytes have already been supplied as putfile data, and how many bytes are
-- 
1.8.4

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


[PATCH 30/71] staging: unisys: device_create_response camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases for ethe static void device_create_response
busNo => busno
devNo => devno

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f74210f..a0371de 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -235,7 +235,7 @@ static struct visorchipset_busdev_notifiers 
busdev_client_notifiers;
 
 static void bus_create_response(ulong busno, int response);
 static void bus_destroy_response(ulong busno, int response);
-static void device_create_response(ulong busNo, ulong devNo, int response);
+static void device_create_response(ulong busno, ulong devno, int response);
 static void device_destroy_response(ulong busNo, ulong devNo, int response);
 static void device_resume_response(ulong busNo, ulong devNo, int response);
 
@@ -2179,9 +2179,9 @@ bus_destroy_response(ulong busno, int response)
 }
 
 static void
-device_create_response(ulong busNo, ulong devNo, int response)
+device_create_response(ulong busno, ulong devno, int response)
 {
-   device_responder(CONTROLVM_DEVICE_CREATE, busNo, devNo, response);
+   device_responder(CONTROLVM_DEVICE_CREATE, busno, devno, response);
 }
 
 static void
-- 
1.8.4

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


[PATCH 52/71] staging: unisys: device_epilog camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases in the static void device_epilog
busNo -> busno
devNo -> devNo
msgHdr -> msghdr
needResponse -> needresponse
pDevInfo -> pdevinfo

Signed-off-by: Jeffrey Brown 
---
 .../unisys/visorchipset/visorchipset_main.c| 40 +++---
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 26cfb59..217d628 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1007,40 +1007,40 @@ bus_epilog(u32 busno,
 }
 
 static void
-device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
- struct controlvm_message_header *msgHdr, int response,
- BOOL needResponse, BOOL for_visorbus)
+device_epilog(u32 busno, u32 devno, struct spar_segment_state state, u32 cmd,
+ struct controlvm_message_header *msghdr, int response,
+ BOOL needresponse, BOOL for_visorbus)
 {
struct visorchipset_busdev_notifiers *notifiers = NULL;
BOOL notified = FALSE;
 
-   struct visorchipset_device_info *pDevInfo =
-   finddevice(&devinfolist, busNo, devNo);
+   struct visorchipset_device_info *pdevinfo =
+   finddevice(&devinfolist, busno, devno);
char *envp[] = {
"SPARSP_DIAGPOOL_PAUSED_STATE = 1",
NULL
};
 
-   if (!pDevInfo) {
-   LOGERR("HUH? bad busNo=%d, devNo=%d", busNo, devNo);
+   if (!pdevinfo) {
+   LOGERR("HUH? bad busNo=%d, devNo=%d", busno, devno);
return;
}
if (for_visorbus)
notifiers = &busdev_server_notifiers;
else
notifiers = &busdev_client_notifiers;
-   if (needResponse) {
-   memcpy(&pDevInfo->pending_msg_hdr, msgHdr,
+   if (needresponse) {
+   memcpy(&pdevinfo->pending_msg_hdr, msghdr,
   sizeof(struct controlvm_message_header));
} else {
-   pDevInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
+   pdevinfo->pending_msg_hdr.id = CONTROLVM_INVALID;
}
down(¬ifierlock);
if (response >= 0) {
switch (cmd) {
case CONTROLVM_DEVICE_CREATE:
if (notifiers->device_create) {
-   (*notifiers->device_create) (busNo, devNo);
+   (*notifiers->device_create) (busno, devno);
notified = TRUE;
}
break;
@@ -1050,8 +1050,8 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
state.operating ==
segment_state_running.operating) {
if (notifiers->device_resume) {
-   (*notifiers->device_resume) (busNo,
-devNo);
+   (*notifiers->device_resume) (busno,
+devno);
notified = TRUE;
}
}
@@ -1063,8 +1063,8 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
 * where server is lost
 */
if (notifiers->device_pause) {
-   (*notifiers->device_pause) (busNo,
-   devNo);
+   (*notifiers->device_pause) (busno,
+   devno);
notified = TRUE;
}
} else if (state.alive == segment_state_paused.alive &&
@@ -1073,10 +1073,10 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
/* this is lite pause where channel is
 * still valid just 'pause' of it
 */
-   if (busNo == g_diagpoolbusno &&
-   devNo == g_diagpooldevno) {
+   if (busno == g_diagpoolbusno &&
+   devno == g_diagpooldevno) {

LOGINF("DEVICE_CHANGESTATE(DiagpoolChannel busNo=%d devNo=%d is pausing...)",
-  busNo, devNo);
+  busno, devno);
/* this will trigger the
 

[PATCH 27/71] staging: unisys: visorchipset_busdev_notifiers camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases that manages the info for a CONTROLVM_DUMP_
CAPTURESTATE and CONTROLVM/REPORTEVENT
BusDev_Server_Notifiers => busdev_server_notifiers
BusDev_Client_Notifiers => busdev_client_notifiers

Signed-off-by: Jeffrey Brown 
---
 .../unisys/visorchipset/visorchipset_main.c| 40 +++---
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f880f23..7bb2171 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -230,8 +230,8 @@ static void parahotplug_process_list(void);
 /* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
  * CONTROLVM_REPORTEVENT.
  */
-static struct visorchipset_busdev_notifiers BusDev_Server_Notifiers;
-static struct visorchipset_busdev_notifiers BusDev_Client_Notifiers;
+static struct visorchipset_busdev_notifiers busdev_server_notifiers;
+static struct visorchipset_busdev_notifiers busdev_client_notifiers;
 
 static void bus_create_response(ulong busNo, int response);
 static void bus_destroy_response(ulong busNo, int response);
@@ -602,11 +602,11 @@ visorchipset_register_busdev_server(
 {
down(¬ifierlock);
if (notifiers == NULL) {
-   memset(&BusDev_Server_Notifiers, 0,
-  sizeof(BusDev_Server_Notifiers));
+   memset(&busdev_server_notifiers, 0,
+  sizeof(busdev_server_notifiers));
serverregistered = 0;   /* clear flag */
} else {
-   BusDev_Server_Notifiers = *notifiers;
+   busdev_server_notifiers = *notifiers;
serverregistered = 1;   /* set flag */
}
if (responders)
@@ -627,11 +627,11 @@ visorchipset_register_busdev_client(
 {
down(¬ifierlock);
if (notifiers == NULL) {
-   memset(&BusDev_Client_Notifiers, 0,
-  sizeof(BusDev_Client_Notifiers));
+   memset(&busdev_client_notifiers, 0,
+  sizeof(busdev_client_notifiers));
clientregistered = 0;   /* clear flag */
} else {
-   BusDev_Client_Notifiers = *notifiers;
+   busdev_client_notifiers = *notifiers;
clientregistered = 1;   /* set flag */
}
if (responders)
@@ -972,24 +972,24 @@ bus_epilog(u32 busNo,
* either server or client devices
* - BusDev_Client can handle ONLY client
* devices */
-   if (BusDev_Server_Notifiers.bus_create) {
-   (*BusDev_Server_Notifiers.bus_create) (busNo);
+   if (busdev_server_notifiers.bus_create) {
+   (*busdev_server_notifiers.bus_create) (busNo);
notified = TRUE;
}
if ((!pBusInfo->flags.server) /*client */ &&
-   BusDev_Client_Notifiers.bus_create) {
-   (*BusDev_Client_Notifiers.bus_create) (busNo);
+   busdev_client_notifiers.bus_create) {
+   (*busdev_client_notifiers.bus_create) (busNo);
notified = TRUE;
}
break;
case CONTROLVM_BUS_DESTROY:
-   if (BusDev_Server_Notifiers.bus_destroy) {
-   (*BusDev_Server_Notifiers.bus_destroy) (busNo);
+   if (busdev_server_notifiers.bus_destroy) {
+   (*busdev_server_notifiers.bus_destroy) (busNo);
notified = TRUE;
}
if ((!pBusInfo->flags.server) /*client */ &&
-   BusDev_Client_Notifiers.bus_destroy) {
-   (*BusDev_Client_Notifiers.bus_destroy) (busNo);
+   busdev_client_notifiers.bus_destroy) {
+   (*busdev_client_notifiers.bus_destroy) (busNo);
notified = TRUE;
}
break;
@@ -1026,9 +1026,9 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
return;
}
if (for_visorbus)
-   notifiers = &BusDev_Server_Notifiers;
+   notifiers = &busdev_server_notifiers;
else
-   notifiers = &BusDev_Client_Notifiers;
+   notifiers = &busdev_client_notifiers;
if (needResponse) {
memcpy(&pDevInfo->pending_msg_hdr, msgHdr,
   sizeof(struct controlvm_message_header));
@@ -2384,8 +2384,8 @@ visorchipset_init(void)
LOGINF("option - clientregwait=%d",

[PATCH 45/71] staging: unisys: chipset_init camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Cleaned up all of the camel cases in the static void chipset_init
Away -> cleanups

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1ceb016..49e5b4c 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -673,7 +673,7 @@ chipset_init(struct controlvm_message *inmsg)
if (chipset_inited) {
LOGERR("CONTROLVM_CHIPSET_INIT Failed: Already Done.");
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-   goto Away;
+   goto cleanups;
}
chipset_inited = 1;
POSTCODE_LINUX_2(CHIPSET_INIT_EXIT_PC, POSTCODE_SEVERITY_INFO);
@@ -688,7 +688,7 @@ chipset_init(struct controlvm_message *inmsg)
 * features-aware driver. */
features |= ULTRA_CHIPSET_FEATURE_REPLY;
 
-Away:
+cleanups:
if (rc < 0)
cleanup_controlvm_structures();
if (inmsg->hdr.flags.response_expected)
-- 
1.8.4

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


[PATCH 20/71] staging: unisys: Livedump_info camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed this static struct LIVEDUMP_INFO into livedump_info
Livedump_info = livedump_info

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 0094401..6536093 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -129,7 +129,7 @@ typedef struct {
 /* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
  * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
  */
-static LIVEDUMP_INFO LiveDump_info;
+static LIVEDUMP_INFO livedump_info;
 
 /* The following globals are used to handle the scenario where we are unable to
  * offload the payload from a controlvm message due to memory requirements.  In
@@ -2387,8 +2387,8 @@ visorchipset_init(void)
memset(&BusDev_Server_Notifiers, 0, sizeof(BusDev_Server_Notifiers));
memset(&BusDev_Client_Notifiers, 0, sizeof(BusDev_Client_Notifiers));
memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
-   memset(&LiveDump_info, 0, sizeof(LiveDump_info));
-   atomic_set(&LiveDump_info.buffers_in_use, 0);
+   memset(&livedump_info, 0, sizeof(livedump_info));
+   atomic_set(&livedump_info.buffers_in_use, 0);
 
if (visorchipset_testvnic) {
ERRDRV("testvnic option no longer supported: (status = %d)\n",
-- 
1.8.4

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


[PATCH 69/71] staging: unisys: CONTROLVM_PAYLOAD_INFO typedef

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the typedef struct CONTROLVM_PAYLOAD_INFO on line 107 to a
normal struct and replaced every instnace of CONTROLVM_PAYLOAD_INFO
with "struct CONTROLVM_PAYLOAD_INFO"

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6977c8d..efb1729 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -104,15 +104,15 @@ static LIST_HEAD(devinfolist);
 
 static VISORCHANNEL *controlvm_channel;
 
-typedef struct {
+struct CONTROLVM_PAYLOAD_INFO {
u8 __iomem *ptr;/* pointer to base address of payload pool */
u64 offset; /* offset from beginning of controlvm
 * channel to beginning of payload * pool */
u32 bytes;  /* number of bytes in payload pool */
-} CONTROLVM_PAYLOAD_INFO;
+};
 
 /* Manages the request payload in the controlvm channel */
-static CONTROLVM_PAYLOAD_INFO controlvm_payload_info;
+static struct CONTROLVM_PAYLOAD_INFO controlvm_payload_info;
 
 static struct channel_header *test_vnic_channel;
 
@@ -1385,12 +1385,12 @@ cleanups:
 /* When provided with the physical address of the controlvm channel
  * (phys_addr), the offset to the payload area we need to manage
  * (offset), and the size of this payload area (bytes), fills in the
- * CONTROLVM_PAYLOAD_INFO struct.  Returns TRUE for success or FALSE
+ * struct CONTROLVM_PAYLOAD_INFO struct.  Returns TRUE for success or FALSE
  * for failure.
  */
 static int
 initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
- CONTROLVM_PAYLOAD_INFO *info)
+ struct CONTROLVM_PAYLOAD_INFO *info)
 {
u8 __iomem *payload = NULL;
int rc = CONTROLVM_RESP_SUCCESS;
@@ -1401,7 +1401,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, 
u64 offset, u32 bytes,
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto cleanups;
}
-   memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
+   memset(info, 0, sizeof(struct CONTROLVM_PAYLOAD_INFO));
if ((offset == 0) || (bytes == 0)) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: 
request_payload_offset=%llu request_payload_bytes=%llu!",
   (u64)offset, (u64)bytes);
@@ -1433,13 +1433,13 @@ cleanups:
 }
 
 static void
-destroy_controlvm_payload_info(CONTROLVM_PAYLOAD_INFO *info)
+destroy_controlvm_payload_info(struct CONTROLVM_PAYLOAD_INFO *info)
 {
if (info->ptr != NULL) {
iounmap(info->ptr);
info->ptr = NULL;
}
-   memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
+   memset(info, 0, sizeof(struct CONTROLVM_PAYLOAD_INFO));
 }
 
 static void
-- 
1.8.4

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


[PATCH 70/71] staging: unisys: LIVEDUMP_INFO typedef

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the typedef LIVEDUMP_INFO to a normal struct and replaced
the only other instance of LIVEDUMP_INFO to "struct LIVEDUMP_INFO"
on line 133

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index efb1729..45b1760 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -116,7 +116,7 @@ static struct CONTROLVM_PAYLOAD_INFO controlvm_payload_info;
 
 static struct channel_header *test_vnic_channel;
 
-typedef struct {
+struct LIVEDUMP_INFO {
struct controlvm_message_header dumpcapture_header;
struct controlvm_message_header gettextdump_header;
struct controlvm_message_header dumpcomplete_header;
@@ -125,11 +125,12 @@ typedef struct {
ulong length;
atomic_t buffers_in_use;
ulong destination;
-} LIVEDUMP_INFO;
+};
+
 /* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
  * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
  */
-static LIVEDUMP_INFO livedump_info;
+static struct LIVEDUMP_INFO livedump_info;
 
 /* The following globals are used to handle the scenario where we are unable to
  * offload the payload from a controlvm message due to memory requirements.  In
-- 
1.8.4

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


[PATCH 46/71] staging: unisys: controlvm camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel case of msgHdr for the static voids of
controlvm_respond, controlvm_init_response, cnotrolvm_respond_-
chipset_init, & controlvm_respond_physdev_changestate
msgHdr => msghdr

Signed-off-by: Jeffrey Brown 
---
 .../staging/unisys/visorchipset/visorchipset_main.c| 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 49e5b4c..8e18fb1 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -697,10 +697,10 @@ cleanups:
 
 static void
 controlvm_init_response(struct controlvm_message *msg,
-   struct controlvm_message_header *msgHdr, int response)
+   struct controlvm_message_header *msghdr, int response)
 {
memset(msg, 0, sizeof(struct controlvm_message));
-   memcpy(&msg->hdr, msgHdr, sizeof(struct controlvm_message_header));
+   memcpy(&msg->hdr, msghdr, sizeof(struct controlvm_message_header));
msg->hdr.payload_bytes = 0;
msg->hdr.payload_vm_offset = 0;
msg->hdr.payload_max_bytes = 0;
@@ -711,14 +711,14 @@ controlvm_init_response(struct controlvm_message *msg,
 }
 
 static void
-controlvm_respond(struct controlvm_message_header *msgHdr, int response)
+controlvm_respond(struct controlvm_message_header *msghdr, int response)
 {
struct controlvm_message outmsg;
 
-   controlvm_init_response(&outmsg, msgHdr, response);
+   controlvm_init_response(&outmsg, msghdr, response);
/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
* back the deviceChangeState structure in the packet. */
-   if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
+   if (msghdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
g_devicechangestatepacket.device_change_state.bus_no ==
g_diagpoolbusno &&
g_devicechangestatepacket.device_change_state.dev_no ==
@@ -737,13 +737,13 @@ controlvm_respond(struct controlvm_message_header 
*msgHdr, int response)
 }
 
 static void
-controlvm_respond_chipset_init(struct controlvm_message_header *msgHdr,
+controlvm_respond_chipset_init(struct controlvm_message_header *msghdr,
   int response,
   enum ultra_chipset_feature features)
 {
struct controlvm_message outmsg;
 
-   controlvm_init_response(&outmsg, msgHdr, response);
+   controlvm_init_response(&outmsg, msghdr, response);
outmsg.cmd.init_chipset.features = features;
if (!visorchannel_signalinsert(controlvm_channel,
   CONTROLVM_QUEUE_REQUEST, &outmsg)) {
@@ -753,12 +753,12 @@ controlvm_respond_chipset_init(struct 
controlvm_message_header *msgHdr,
 }
 
 static void controlvm_respond_physdev_changestate(
-   struct controlvm_message_header *msgHdr, int response,
+   struct controlvm_message_header *msghdr, int response,
struct spar_segment_state state)
 {
struct controlvm_message outmsg;
 
-   controlvm_init_response(&outmsg, msgHdr, response);
+   controlvm_init_response(&outmsg, msghdr, response);
outmsg.cmd.device_change_state.state = state;
outmsg.cmd.device_change_state.flags.phys_device = 1;
if (!visorchannel_signalinsert(controlvm_channel,
-- 
1.8.4

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


[PATCH 21/71] staging: unisys: Controlvm_pending_msg camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed this variable to controlvm_pending_msg
Controlvm_pending_msg => controlvm_pending_msg

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6536093..30685cb 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -136,7 +136,7 @@ static LIVEDUMP_INFO livedump_info;
  * this scenario, we simply stash the controlvm message, then attempt to
  * process it again the next time controlvm_periodic_work() runs.
  */
-static struct controlvm_message ControlVm_Pending_Msg;
+static struct controlvm_message controlvm_pending_msg;
 static BOOL ControlVm_Pending_Msg_Valid = FALSE;
 
 /* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
@@ -1999,7 +1999,7 @@ controlvm_periodic_work(struct work_struct *work)
* msg, so try to process it again
* rather than reading a new one
*/
-   inmsg = ControlVm_Pending_Msg;
+   inmsg = controlvm_pending_msg;
ControlVm_Pending_Msg_Valid = FALSE;
gotACommand = TRUE;
} else {
@@ -2022,7 +2022,7 @@ controlvm_periodic_work(struct work_struct *work)
* reprocess it on our next loop
*/
handle_command_failed = TRUE;
-   ControlVm_Pending_Msg = inmsg;
+   controlvm_pending_msg = inmsg;
ControlVm_Pending_Msg_Valid = TRUE;
}
}
-- 
1.8.4

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


[PATCH 11/71] staging: unisys: controlvm_message_header camel case

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Changed the camel cases of three controlvm_message_headers that
are related to each other
g_DiagMsgHdr => g_diagmsghdr
g_ChipsetMsgHdr => g_chipsetmsghdr
g_DelDumpMsgHdr => g_deldumpmsghdr

Signed-off-by: Jeffrey Brown 
---
 .../unisys/visorchipset/visorchipset_main.c| 28 +++---
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 8099c21..1ad243f 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -76,9 +76,9 @@ typedef struct {
unsigned int crc;
 } MESSAGE_ENVELOPE;
 
-static struct controlvm_message_header g_DiagMsgHdr;
-static struct controlvm_message_header g_ChipSetMsgHdr;
-static struct controlvm_message_header g_DelDumpMsgHdr;
+static struct controlvm_message_header g_diagmsghdr;
+static struct controlvm_message_header g_chipsetmsghdr;
+static struct controlvm_message_header g_deldumpmsghdr;
 static const uuid_le UltraDiagPoolChannelProtocolGuid =
SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xff is an invalid Bus/Device number */
@@ -1520,7 +1520,7 @@ chipset_ready(struct controlvm_message_header *msgHdr)
/* Send CHIPSET_READY response when all modules have been loaded
 * and disks mounted for the partition
 */
-   g_ChipSetMsgHdr = *msgHdr;
+   g_chipsetmsghdr = *msgHdr;
LOGINF("Holding CHIPSET_READY response");
}
 }
@@ -1883,7 +1883,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
/* save the hdr and cmd structures for later use */
/* when sending back the response to Command */
my_device_changestate(&inmsg);
-   g_DiagMsgHdr = inmsg.hdr;
+   g_diagmsghdr = inmsg.hdr;
g_DeviceChangeStatePacket = inmsg.cmd;
break;
}
@@ -1973,12 +1973,12 @@ controlvm_periodic_work(struct work_struct *work)
 * should be sent
 */
if (visorchipset_holdchipsetready &&
-   (g_ChipSetMsgHdr.id != CONTROLVM_INVALID)) {
+   (g_chipsetmsghdr.id != CONTROLVM_INVALID)) {
if (check_chipset_events() == 1) {
LOGINF("Sending CHIPSET_READY response");
-   controlvm_respond(&g_ChipSetMsgHdr, 0);
+   controlvm_respond(&g_chipsetmsghdr, 0);
clear_chipset_events();
-   memset(&g_ChipSetMsgHdr, 0,
+   memset(&g_chipsetmsghdr, 0,
   sizeof(struct controlvm_message_header));
}
}
@@ -2429,11 +2429,11 @@ visorchipset_init(void)
goto Away;
}
 
-   memset(&g_DiagMsgHdr, 0, sizeof(struct controlvm_message_header));
+   memset(&g_diagmsghdr, 0, sizeof(struct controlvm_message_header));
 
-   memset(&g_ChipSetMsgHdr, 0, sizeof(struct controlvm_message_header));
+   memset(&g_chipsetmsghdr, 0, sizeof(struct controlvm_message_header));
 
-   memset(&g_DelDumpMsgHdr, 0, sizeof(struct controlvm_message_header));
+   memset(&g_deldumpmsghdr, 0, sizeof(struct controlvm_message_header));
 
Putfile_buffer_list_pool =
kmem_cache_create(Putfile_buffer_list_pool_name,
@@ -2521,11 +2521,11 @@ visorchipset_exit(void)
 
cleanup_controlvm_structures();
 
-   memset(&g_DiagMsgHdr, 0, sizeof(struct controlvm_message_header));
+   memset(&g_diagmsghdr, 0, sizeof(struct controlvm_message_header));
 
-   memset(&g_ChipSetMsgHdr, 0, sizeof(struct controlvm_message_header));
+   memset(&g_chipsetmsghdr, 0, sizeof(struct controlvm_message_header));
 
-   memset(&g_DelDumpMsgHdr, 0, sizeof(struct controlvm_message_header));
+   memset(&g_deldumpmsghdr, 0, sizeof(struct controlvm_message_header));
 
LOGINF("Channel %s (ControlVm) disconnected",
   visorchannel_id(ControlVm_channel, s));
-- 
1.8.4

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


[PATCH 65/71] staging: unisys: visorchipset_init camel cases

2014-11-12 Thread Jeffrey Brown
From: Jeffrey 

Fixed camel cases in the static int _init at line 2365
Away -> cleanups

Signed-off-by: Jeffrey Brown 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1d9aaca..3d2d435 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -2395,7 +2395,7 @@ visorchipset_init(void)
   x);
POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, x, DIAG_SEVERITY_ERR);
rc = x;
-   goto Away;
+   goto cleanups;
}
 
addr = controlvm_get_channel_address();
@@ -2426,7 +2426,7 @@ visorchipset_init(void)
if (rc < 0) {
ERRDRV("visorchipset_file_init(MajorDev, &ControlVm_channel): 
error (status=%d)\n", rc);
POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
-   goto Away;
+   goto cleanups;
}
 
memset(&g_diagmsghdr, 0, sizeof(struct controlvm_message_header));
@@ -2443,7 +2443,7 @@ visorchipset_init(void)
ERRDRV("failed to alloc Putfile_buffer_list_pool: 
(status=-1)\n");
POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
rc = -1;
-   goto Away;
+   goto cleanups;
}
if (visorchipset_disable_controlvm) {
LOGINF("visorchipset_init:controlvm disabled");
@@ -2464,7 +2464,7 @@ visorchipset_init(void)
POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
 DIAG_SEVERITY_ERR);
rc = -ENOMEM;
-   goto Away;
+   goto cleanups;
}
most_recent_message_jiffies = jiffies;
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
@@ -2474,7 +2474,7 @@ visorchipset_init(void)

ERRDRV("queue_delayed_work(Periodic_controlvm_workqueue, 
&Periodic_controlvm_work, Poll_jiffies): error (status=%d)\n", rc);
POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
 DIAG_SEVERITY_ERR);
-   goto Away;
+   goto cleanups;
}
}
 
@@ -2483,12 +2483,12 @@ visorchipset_init(void)
ERRDRV("platform_device_register(visorchipset) failed: 
(status=-1)\n");
POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR);
rc = -1;
-   goto Away;
+   goto cleanups;
}
LOGINF("visorchipset device created");
POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO);
rc = 0;
-Away:
+cleanups:
if (rc) {
LOGERR("visorchipset_init failed");
POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, rc,
-- 
1.8.4

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


  1   2   >