[PATCH] staging: lustre: ptlrpc: lproc_ptlrpc.c - fix dereferenceing user space buffer

2014-07-31 Thread Anil Belur
- this fixes sparse warning for directly deferencing user space buffer

drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33: warning: incorrect 
type in argument 2 (different address spaces)
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33:expected void 
const [noderef] asn:1*from
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33:got char const 
*buffer

Signed-off-by: Anil Belur ask...@gmail.com
---
 drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c 
b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
index 6b9c6db..455c6c7 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
@@ -628,7 +628,8 @@ out:
  * if the optional token is omitted, the operation is performed on both the
  * regular and high-priority (if the service has one) NRS head.
  */
-static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file, const char 
*buffer,
+static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file,
+   const char __user *buffer,
size_t count, loff_t *off)
 {
struct ptlrpc_service *svc = ((struct seq_file 
*)file-private_data)-private;
-- 
1.9.1

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


Re: [PATCH] Staging: rtl8192u: Staticfy debug method.

2014-07-31 Thread Dan Carpenter
You need to compile these things before sending them...

This adds a GCC warning about uncalled functions.

regards,
dan carpenter

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


Re: [PATCH] Staging: android: timed_gpio.c: improved logic of gpio_get_time()

2014-07-31 Thread Dan Carpenter
On Wed, Jul 30, 2014 at 08:47:19PM -0300, Murilo Opsfelder Araujo wrote:
 Thanks for reviewing my first patch, Joe.  How about this new one,
 guys?
 
 -- 8 --
 Consequently, made checkpatch.pl happy.
 
 Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com

This changelog is all mangled.  Try applying it with `git am`.  It
doesn't make sense to begin with.  What consequently?

regards,
dan carpenter

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


[PATCH 3/5] staging: rtl8723au: Remove never set struct pwrctrl_priv.bHWPowerdown

2014-07-31 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 21 -
 drivers/staging/rtl8723au/include/rtw_pwrctrl.h |  1 -
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 681810e..b49bf33 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -517,20 +517,15 @@ enum rt_rf_power_state RfOnOffDetect23a(struct 
rtw_adapter *pAdapter)
u8 val8;
enum rt_rf_power_state rfpowerstate = rf_off;
 
-   if (pAdapter-pwrctrlpriv.bHWPowerdown) {
-   val8 = rtl8723au_read8(pAdapter, REG_HSISR);
-   DBG_8723A(pwrdown, 0x5c(BIT7) =%02x\n, val8);
-   rfpowerstate = (val8  BIT(7)) ? rf_off : rf_on;
-   } else { /*  rf on/off */
-   rtl8723au_write8(pAdapter, REG_MAC_PINMUX_CFG,
-rtl8723au_read8(pAdapter, REG_MAC_PINMUX_CFG) 
-~BIT(3));
-   val8 = rtl8723au_read8(pAdapter, REG_GPIO_IO_SEL);
-   DBG_8723A(GPIO_IN =%02x\n, val8);
-   rfpowerstate = (val8  BIT(3)) ? rf_on : rf_off;
-   }
+   rtl8723au_write8(pAdapter, REG_MAC_PINMUX_CFG,
+rtl8723au_read8(pAdapter,
+REG_MAC_PINMUX_CFG)  ~BIT(3));
+   val8 = rtl8723au_read8(pAdapter, REG_GPIO_IO_SEL);
+   DBG_8723A(GPIO_IN =%02x\n, val8);
+   rfpowerstate = (val8  BIT(3)) ? rf_on : rf_off;
+
return rfpowerstate;
-}  /*  HalDetectPwrDownMode */
+}
 
 void _ps_open_RF23a(struct rtw_adapter *padapter);
 
diff --git a/drivers/staging/rtl8723au/include/rtw_pwrctrl.h 
b/drivers/staging/rtl8723au/include/rtw_pwrctrl.h
index be465c2..599fed9 100644
--- a/drivers/staging/rtl8723au/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8723au/include/rtw_pwrctrl.h
@@ -198,7 +198,6 @@ struct pwrctrl_priv {
enum rt_rf_power_state  rf_pwrstate;/* cur power state */
enum rt_rf_power_state  change_rfpwrstate;
 
-   u8  bHWPowerdown;/* if support hw power down */
u8  bkeepfwalive;
unsigned long PS_BBRegBackup[PSBBREG_TOTALCNT];
 };
-- 
1.9.3

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


[PATCH 5/5] staging: rtl8723au: usb_dvobj_init(): Remove unused variable 'pdev_desc'

2014-07-31 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/os_dep/usb_intf.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c 
b/drivers/staging/rtl8723au/os_dep/usb_intf.c
index c5ff1b8..865743e 100644
--- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
@@ -91,7 +91,6 @@ static int rtw_deinit_intf_priv(struct dvobj_priv *dvobj)
 static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
 {
struct dvobj_priv *pdvobjpriv;
-   struct usb_device_descriptor *pdev_desc;
struct usb_host_config   *phost_conf;
struct usb_config_descriptor *pconf_desc;
struct usb_host_interface *phost_iface;
@@ -119,8 +118,6 @@ static struct dvobj_priv *usb_dvobj_init(struct 
usb_interface *usb_intf)
pdvobjpriv-RtNumInPipes = 0;
pdvobjpriv-RtNumOutPipes = 0;
 
-   pdev_desc = pusbd-descriptor;
-
phost_conf = pusbd-actconfig;
pconf_desc = phost_conf-desc;
 
-- 
1.9.3

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


[PATCH 4/5] staging: rtl8723au: Do not duplicate kernel provided USB macros

2014-07-31 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/os_dep/usb_intf.c | 45 +++--
 1 file changed, 10 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c 
b/drivers/staging/rtl8723au/os_dep/usb_intf.c
index 06c885f..c5ff1b8 100644
--- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
@@ -59,44 +59,19 @@ static struct usb_driver rtl8723a_usb_drv = {
 
 static struct usb_driver *usb_drv = rtl8723a_usb_drv;
 
-static inline int RT_usb_endpoint_dir_in(const struct usb_endpoint_descriptor 
*epd)
-{
-   return (epd-bEndpointAddress  USB_ENDPOINT_DIR_MASK) == USB_DIR_IN;
-}
-
-static inline int RT_usb_endpoint_dir_out(const struct usb_endpoint_descriptor 
*epd)
-{
-   return (epd-bEndpointAddress  USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT;
-}
-
-static inline int RT_usb_endpoint_xfer_int(const struct 
usb_endpoint_descriptor *epd)
-{
-   return (epd-bmAttributes  USB_ENDPOINT_XFERTYPE_MASK) == 
USB_ENDPOINT_XFER_INT;
-}
-
-static inline int RT_usb_endpoint_xfer_bulk(const struct 
usb_endpoint_descriptor *epd)
-{
-   return (epd-bmAttributes  USB_ENDPOINT_XFERTYPE_MASK) == 
USB_ENDPOINT_XFER_BULK;
-}
-
 static inline int RT_usb_endpoint_is_bulk_in(const struct 
usb_endpoint_descriptor *epd)
 {
-   return RT_usb_endpoint_xfer_bulk(epd)  RT_usb_endpoint_dir_in(epd);
+   return usb_endpoint_xfer_bulk(epd)  usb_endpoint_dir_in(epd);
 }
 
 static inline int RT_usb_endpoint_is_bulk_out(const struct 
usb_endpoint_descriptor *epd)
 {
-   return RT_usb_endpoint_xfer_bulk(epd)  RT_usb_endpoint_dir_out(epd);
+   return usb_endpoint_xfer_bulk(epd)  usb_endpoint_dir_out(epd);
 }
 
 static inline int RT_usb_endpoint_is_int_in(const struct 
usb_endpoint_descriptor *epd)
 {
-   return RT_usb_endpoint_xfer_int(epd)  RT_usb_endpoint_dir_in(epd);
-}
-
-static inline int RT_usb_endpoint_num(const struct usb_endpoint_descriptor 
*epd)
-{
-   return epd-bEndpointAddress  USB_ENDPOINT_NUMBER_MASK;
+   return usb_endpoint_xfer_int(epd)  usb_endpoint_dir_in(epd);
 }
 
 static int rtw_init_intf_priv(struct dvobj_priv *dvobj)
@@ -173,25 +148,25 @@ static struct dvobj_priv *usb_dvobj_init(struct 
usb_interface *usb_intf)
 
if (RT_usb_endpoint_is_bulk_in(pendp_desc)) {
DBG_8723A(RT_usb_endpoint_is_bulk_in = %x\n,
- RT_usb_endpoint_num(pendp_desc));
+ usb_endpoint_num(pendp_desc));
pdvobjpriv-RtInPipe[pdvobjpriv-RtNumInPipes] =
-   RT_usb_endpoint_num(pendp_desc);
+   usb_endpoint_num(pendp_desc);
pdvobjpriv-RtNumInPipes++;
} else if (RT_usb_endpoint_is_int_in(pendp_desc)) {
DBG_8723A(RT_usb_endpoint_is_int_in = %x, 
Interval = %x\n,
- RT_usb_endpoint_num(pendp_desc),
+ usb_endpoint_num(pendp_desc),
  pendp_desc-bInterval);
pdvobjpriv-RtInPipe[pdvobjpriv-RtNumInPipes] =
-   RT_usb_endpoint_num(pendp_desc);
+   usb_endpoint_num(pendp_desc);
pdvobjpriv-RtNumInPipes++;
} else if (RT_usb_endpoint_is_bulk_out(pendp_desc)) {
DBG_8723A(RT_usb_endpoint_is_bulk_out = %x\n,
- RT_usb_endpoint_num(pendp_desc));
+ usb_endpoint_num(pendp_desc));

pdvobjpriv-RtOutPipe[pdvobjpriv-RtNumOutPipes] =
-   RT_usb_endpoint_num(pendp_desc);
+   usb_endpoint_num(pendp_desc);
pdvobjpriv-RtNumOutPipes++;
}
-   pdvobjpriv-ep_num[i] = RT_usb_endpoint_num(pendp_desc);
+   pdvobjpriv-ep_num[i] = usb_endpoint_num(pendp_desc);
}
}
DBG_8723A(nr_endpoint =%d, in_num =%d, out_num =%d\n\n,
-- 
1.9.3

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


[PATCH 2/5] staging: rtl8723au: Remove two never set variables

2014-07-31 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

struct registry_priv.usbss_enable and
struct pwrctrl_priv.bHWPwrPindetect are never set.

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/core/rtw_cmd.c| 13 -
 drivers/staging/rtl8723au/core/rtw_pwrctrl.c| 22 --
 drivers/staging/rtl8723au/include/drv_types.h   |  1 -
 drivers/staging/rtl8723au/include/rtw_pwrctrl.h |  1 -
 4 files changed, 37 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c 
b/drivers/staging/rtl8723au/core/rtw_cmd.c
index 25d65b2..7241a5a 100644
--- a/drivers/staging/rtl8723au/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723au/core/rtw_cmd.c
@@ -203,22 +203,9 @@ void rtw_free_evt_priv23a(struct evt_priv *pevtpriv)
 
 static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 {
-   struct drvextra_cmd_parm *pdrvextra_cmd_parm;
/* set to true to allow enqueuing cmd when hw_init_completed is false */
u8 bAllow = false;
 
-   /* To decide allow or not */
-   if (pcmdpriv-padapter-pwrctrlpriv.bHWPwrPindetect 
-   !pcmdpriv-padapter-registrypriv.usbss_enable) {
-   if (cmd_obj-cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)) {
-   pdrvextra_cmd_parm =
-   (struct drvextra_cmd_parm *)cmd_obj-parmbuf;
-   if (pdrvextra_cmd_parm-ec_id ==
-   POWER_SAVING_CTRL_WK_CID)
-   bAllow = true;
-   }
-   }
-
if (cmd_obj-cmdcode == GEN_CMD_CODE(_SetChannelPlan))
bAllow = true;
 
diff --git a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c 
b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c
index 7fbbdaf..d5fa26a 100644
--- a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c
@@ -150,34 +150,12 @@ void rtw_ps_processor23a(struct rtw_adapter*padapter)
 {
struct pwrctrl_priv *pwrpriv = padapter-pwrctrlpriv;
struct mlme_priv *pmlmepriv = padapter-mlmepriv;
-   enum rt_rf_power_state rfpwrstate;
 
pwrpriv-ps_processing = true;
 
if (pwrpriv-bips_processing == true)
goto exit;
 
-   if (padapter-pwrctrlpriv.bHWPwrPindetect) {
-   rfpwrstate = RfOnOffDetect23a(padapter);
-   DBG_8723A(- #2  %s == rfstate:%s\n, __func__,
- (rfpwrstate == rf_on)?rf_on:rf_off);
-
-   if (rfpwrstate!= pwrpriv-rf_pwrstate) {
-   if (rfpwrstate == rf_off) {
-   pwrpriv-change_rfpwrstate = rf_off;
-   padapter-bCardDisableWOHSM = true;
-   rtw_hw_suspend23a(padapter);
-   } else {
-   pwrpriv-change_rfpwrstate = rf_on;
-   rtw_hw_resume23a(padapter);
-   }
-   DBG_8723A(current rf_pwrstate(%s)\n,
- (pwrpriv-rf_pwrstate == rf_off) ?
- rf_off:rf_on);
-   }
-   pwrpriv-pwr_state_check_cnts ++;
-   }
-
if (pwrpriv-ips_mode_req == IPS_NONE)
goto exit;
 
diff --git a/drivers/staging/rtl8723au/include/drv_types.h 
b/drivers/staging/rtl8723au/include/drv_types.h
index df55e5b..9870f87 100644
--- a/drivers/staging/rtl8723au/include/drv_types.h
+++ b/drivers/staging/rtl8723au/include/drv_types.h
@@ -111,7 +111,6 @@ struct registry_priv {
u8  antdiv_cfg;
u8  antdiv_type;
 
-   u8  usbss_enable;/* 0:disable,1:enable */
u8  hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
u8  hwpwrp_detect;/* 0:disable,1:enable */
 
diff --git a/drivers/staging/rtl8723au/include/rtw_pwrctrl.h 
b/drivers/staging/rtl8723au/include/rtw_pwrctrl.h
index 1fa712f..be465c2 100644
--- a/drivers/staging/rtl8723au/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8723au/include/rtw_pwrctrl.h
@@ -199,7 +199,6 @@ struct pwrctrl_priv {
enum rt_rf_power_state  change_rfpwrstate;
 
u8  bHWPowerdown;/* if support hw power down */
-   u8  bHWPwrPindetect;
u8  bkeepfwalive;
unsigned long PS_BBRegBackup[PSBBREG_TOTALCNT];
 };
-- 
1.9.3

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


[PATCH 1/5] staging: rtl8723au: RSSI_test is never set

2014-07-31 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/odm_HWConfig.c | 7 ++-
 drivers/staging/rtl8723au/include/odm.h  | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/odm_HWConfig.c 
b/drivers/staging/rtl8723au/hal/odm_HWConfig.c
index 409fde4..29d844d 100644
--- a/drivers/staging/rtl8723au/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8723au/hal/odm_HWConfig.c
@@ -399,11 +399,8 @@ static void ODM_PhyStatusQuery23a_92CSeries(struct 
dm_odm_t *pDM_Odm,
 {
odm_RxPhyStatus92CSeries_Parsing(pDM_Odm, pPhyInfo,
 pPhyStatus, pPktinfo);
-   if (pDM_Odm-RSSI_test) {
-   /*  Select the packets to do RSSI checking for antenna 
switching. */
-   } else {
-   odm_Process_RSSIForDM(pDM_Odm, pPhyInfo, pPktinfo);
-   }
+
+   odm_Process_RSSIForDM(pDM_Odm, pPhyInfo, pPktinfo);
 }
 
 void ODM_PhyStatusQuery23a(struct dm_odm_t *pDM_Odm, struct phy_info *pPhyInfo,
diff --git a/drivers/staging/rtl8723au/include/odm.h 
b/drivers/staging/rtl8723au/include/odm.h
index 41dba62..68ff7bb 100644
--- a/drivers/staging/rtl8723au/include/odm.h
+++ b/drivers/staging/rtl8723au/include/odm.h
@@ -736,7 +736,6 @@ struct dm_odm_t {
struct false_alarm_statsFalseAlmCnt;
struct false_alarm_statsFlaseAlmCntBuddyAdapter;
struct sw_ant_swDM_SWAT_Table;
-   boolRSSI_test;
 
struct edca_turbo   DM_EDCA_Table;
u32 WMMEDCA_BE;
-- 
1.9.3

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


Re: [PATCH] Staging: rtl8192u: Staticfy debug method.

2014-07-31 Thread Fernando Apesteguía
El 31/07/2014 10:21, Dan Carpenter dan.carpen...@oracle.com escribió:

 You need to compile these things before sending them...

 This adds a GCC warning about uncalled functions.

Sorry, but I did compile it with

make C=1 M=drivers/staging

But for the function to be called, DEBUG_EPROM must be defined and I
had it defined. That's why I overlooked the warning.

Apologies.

 regards,
 dan carpenter

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


[patch] staging: comedi: ni_tio: remove some dead code

2014-07-31 Thread Dan Carpenter
These conditions can never be true because i is always one more than
NI_660X_MAX_RTSI_CHAN after the loop.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

diff --git a/drivers/staging/comedi/drivers/ni_tio.c 
b/drivers/staging/comedi/drivers/ni_tio.c
index f9f6320..9d4b46c 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -1041,14 +1041,10 @@ static unsigned ni_660x_gate_to_generic_gate(unsigned 
gate)
if (gate == NI_660X_RTSI_GATE_SEL(i))
return NI_GPCT_RTSI_GATE_SELECT(i);
}
-   if (i = NI_660X_MAX_RTSI_CHAN)
-   break;
for (i = 0; i = NI_660X_MAX_GATE_PIN; ++i) {
if (gate == NI_660X_PIN_GATE_SEL(i))
return NI_GPCT_GATE_PIN_GATE_SELECT(i);
}
-   if (i = NI_660X_MAX_GATE_PIN)
-   break;
BUG();
break;
}
@@ -1081,14 +1077,10 @@ static unsigned ni_m_gate_to_generic_gate(unsigned gate)
if (gate == NI_M_RTSI_GATE_SEL(i))
return NI_GPCT_RTSI_GATE_SELECT(i);
}
-   if (i = NI_M_MAX_RTSI_CHAN)
-   break;
for (i = 0; i = NI_M_MAX_PFI_CHAN; ++i) {
if (gate == NI_M_PFI_GATE_SEL(i))
return NI_GPCT_PFI_GATE_SELECT(i);
}
-   if (i = NI_M_MAX_PFI_CHAN)
-   break;
BUG();
break;
}
@@ -1117,14 +1109,10 @@ static unsigned ni_660x_gate2_to_generic_gate(unsigned 
gate)
if (gate == NI_660X_RTSI_GATE2_SEL(i))
return NI_GPCT_RTSI_GATE_SELECT(i);
}
-   if (i = NI_660X_MAX_RTSI_CHAN)
-   break;
for (i = 0; i = NI_660X_MAX_UP_DOWN_PIN; ++i) {
if (gate == NI_660X_UD_PIN_GATE2_SEL(i))
return NI_GPCT_UP_DOWN_PIN_GATE_SELECT(i);
}
-   if (i = NI_660X_MAX_UP_DOWN_PIN)
-   break;
BUG();
break;
}
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch] staging: comedi: ni_tio: remove some dead code

2014-07-31 Thread Ian Abbott

On 2014-07-31 10:29, Dan Carpenter wrote:

These conditions can never be true because i is always one more than
NI_660X_MAX_RTSI_CHAN after the loop.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com


Reviewed-by: Ian Abbott abbo...@mev.co.uk

--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: rtl8192u: Staticfy debug method.

2014-07-31 Thread Dan Carpenter
On Thu, Jul 31, 2014 at 11:10:33AM +0200, Fernando Apesteguía wrote:
 El 31/07/2014 10:21, Dan Carpenter dan.carpen...@oracle.com escribió:
 
  You need to compile these things before sending them...
 
  This adds a GCC warning about uncalled functions.
 
 Sorry, but I did compile it with
 
 make C=1 M=drivers/staging
 
 But for the function to be called, DEBUG_EPROM must be defined and I
 had it defined. That's why I overlooked the warning.

Ah.  Ok.

regards,
dan carpenter

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


Re: [PATCH] Staging: android: sw_sync.c: fix missing blank line after declaration

2014-07-31 Thread Murilo Opsfelder Araujo

On 07/30/2014 09:17 PM, Greg KH wrote:

Does not apply to my tree at all :(


I was using linux-next.  No checkpatch.pl warnings for sw_sync.c in 
staging-next.


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


Re: [PATCH V2] staging: dgap: introduce dgap_cleanup_nodes()

2014-07-31 Thread Mark Hounschell

On 07/31/2014 12:02 AM, Daeseok Youn wrote:

When a configration file is parsed with dgap_parsefile(),
makes nodes for saving configrations for board.

Making a node will allocate node memory and strings for saving
configrations with kstrdup().

So these are freed when dgap is unloaded or failed to initialize.

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
V2: Do not need to free for NULLNODE.

I have been too busy to solve this issue, sorry for late.

Mark, Can you test this patch? I try to make simple module which is
testing dgap_parsefile() and dgap_cleanup_nodes().



I'll be happy to, but I can't do it until Monday. I'm not where the 
hardware is until then.


Regards
Mark

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


Re: [PATCH] Staging: android: sw_sync.c: fix missing blank line after declaration

2014-07-31 Thread Yann Droneaud
Hi,

Le lundi 28 juillet 2014 à 19:38 -0300, Murilo Opsfelder Araujo a
écrit :
 Fix coding style issue.
 
 Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com

Is this some kind of game ?

The *same* patch was sent three times from three different email
addresses:

  http://lkml.kernel.org/r/1406170403-4506-1-git-send-email-xerofo...@gmail.com

From: Nicholas Krause xerofo...@gmail.com
Date: Wed, 23 Jul 2014 22:53:23 -0400
Message-Id: 1406170403-4506-1-git-send-email-xerofo...@gmail.com
Subject: [PATCH] staging: Add blank lines in sw_sync.c

  
http://lkml.kernel.org/r/1406581660-7863-1-git-send-email-adrianremo...@gmail.com

From: Adrian Remonda adrianremo...@gmail.com
Date: Mon, 28 Jul 2014 23:07:40 +0200
Message-Id: 1406581660-7863-1-git-send-email-adrianremo...@gmail.com
Subject: [PATCH] Staging: android: Missing a blank line after declarations
 in sw_sync.c This is a patch to the sw_sync.c file that fixes up a missing
 a blank warning found by the checkpatch.pl tool

  http://lkml.kernel.org/r/1406587103-5784-1-git-send-email-mopsfel...@gmail.com

From: Murilo Opsfelder Araujo mopsfel...@gmail.com
Date: Mon, 28 Jul 2014 19:38:23 -0300
Message-Id: 1406587103-5784-1-git-send-email-mopsfel...@gmail.com
Subject: [PATCH] Staging: android: sw_sync.c: fix missing blank line after
 declaration


 ---
  drivers/staging/android/sw_sync.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/staging/android/sw_sync.c 
 b/drivers/staging/android/sw_sync.c
 index a76db3f..863d4b1 100644
 --- a/drivers/staging/android/sw_sync.c
 +++ b/drivers/staging/android/sw_sync.c
 @@ -97,6 +97,7 @@ static void sw_sync_pt_value_str(struct sync_pt *sync_pt,
  char *str, int size)
  {
   struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt;
 +
   snprintf(str, size, %d, pt-value);
  }
  
 @@ -156,6 +157,7 @@ static int sw_sync_open(struct inode *inode, struct file 
 *file)
  static int sw_sync_release(struct inode *inode, struct file *file)
  {
   struct sw_sync_timeline *obj = file-private_data;
 +
   sync_timeline_destroy(obj-obj);
   return 0;
  }

Regards.

-- 
Yann Droneaud
OPTEYA


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


Re: [PATCH] Staging: android: sw_sync.c: fix missing blank line after declaration

2014-07-31 Thread Dan Carpenter
On Thu, Jul 31, 2014 at 03:00:19PM +0200, Yann Droneaud wrote:
 Hi,
 
 Le lundi 28 juillet 2014 à 19:38 -0300, Murilo Opsfelder Araujo a
 écrit :
  Fix coding style issue.
  
  Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
 
 Is this some kind of game ?
 
 The *same* patch was sent three times from three different email
 addresses:

This is just normal.

Once I saw 7 people send the same patch.  I was almost the third person
to send a fix last week.  I had the patch prepared to send, but I
happened to look at my inbox before sending.

regards,
dan carpenter

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


[PATCH 2/2] staging: dgnc: Remove unneeded dgnc_trace.c and dgnc_trace.h

2014-07-31 Thread Seunghun Lee
Removes unneeded dgnc_trace.c and dgnc_trace.h

CC: Lidza Louina lidza.lou...@gmail.com
CC: Mark Hounschell ma...@compro.net
Signed-off-by: Seunghun Lee way...@gmail.com
---
 drivers/staging/dgnc/Makefile  |2 +-
 drivers/staging/dgnc/dgnc_cls.c|1 -
 drivers/staging/dgnc/dgnc_driver.c |1 -
 drivers/staging/dgnc/dgnc_neo.c|1 -
 drivers/staging/dgnc/dgnc_trace.c  |   54 
 drivers/staging/dgnc/dgnc_trace.h  |   34 ---
 drivers/staging/dgnc/dgnc_tty.c|1 -
 7 files changed, 1 insertion(+), 93 deletions(-)
 delete mode 100644 drivers/staging/dgnc/dgnc_trace.c
 delete mode 100644 drivers/staging/dgnc/dgnc_trace.h

diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile
index 888c433..733434f 100644
--- a/drivers/staging/dgnc/Makefile
+++ b/drivers/staging/dgnc/Makefile
@@ -4,4 +4,4 @@ obj-$(CONFIG_DGNC) += dgnc.o
 
 dgnc-objs :=   dgnc_cls.o dgnc_driver.o\
dgnc_mgmt.o dgnc_neo.o\
-   dgnc_trace.o dgnc_tty.o dgnc_sysfs.o
+   dgnc_tty.o dgnc_sysfs.o
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 5a76a8e..cfa8384 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -41,7 +41,6 @@
 #include dgnc_driver.h   /* Driver main header file */
 #include dgnc_cls.h
 #include dgnc_tty.h
-#include dgnc_trace.h
 
 static inline void cls_parse_isr(struct dgnc_board *brd, uint port);
 static inline void cls_clear_break(struct channel_t *ch, int force);
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index a5be911..764613b 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -40,7 +40,6 @@
 #include dpacompat.h
 #include dgnc_mgmt.h
 #include dgnc_tty.h
-#include dgnc_trace.h
 #include dgnc_cls.h
 #include dgnc_neo.h
 #include dgnc_sysfs.h
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 9de988c..68ff116 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -41,7 +41,6 @@
 #include dgnc_driver.h   /* Driver main header file */
 #include dgnc_neo.h  /* Our header file */
 #include dgnc_tty.h
-#include dgnc_trace.h
 
 static inline void neo_parse_lsr(struct dgnc_board *brd, uint port);
 static inline void neo_parse_isr(struct dgnc_board *brd, uint port);
diff --git a/drivers/staging/dgnc/dgnc_trace.c 
b/drivers/staging/dgnc/dgnc_trace.c
deleted file mode 100644
index 3bb2259..000
--- a/drivers/staging/dgnc/dgnc_trace.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- * This is shared code between Digi's CVS archive and the
- * Linux Kernel sources.
- * Changing the source just for reformatting needlessly breaks
- * our CVS diff history.
- *
- * Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- * Thank you.
- *
- */
-
-#include linux/kernel.h
-#include linux/sched.h   /* For jiffies, task states */
-#include linux/interrupt.h   /* For tasklet and interrupt structs/defines */
-#include linux/vmalloc.h
-
-#include dgnc_driver.h
-#include dgnc_trace.h
-
-#define TRC_TO_CONSOLE 1
-
-/* file level globals */
-static char *dgnc_trcbuf;  /* the ringbuffer */
-
-/*
- * dgnc_tracer_free()
- *
- *
- */
-void dgnc_tracer_free(void)
-{
-   if (dgnc_trcbuf)
-   vfree(dgnc_trcbuf);
-}
diff --git a/drivers/staging/dgnc/dgnc_trace.h 
b/drivers/staging/dgnc/dgnc_trace.h
deleted file mode 100644
index 4f4e2b9..000
--- a/drivers/staging/dgnc/dgnc_trace.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, 

Re: [PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic

2014-07-31 Thread Tomi Valkeinen
On 31/07/14 13:11, Dexuan Cui wrote:
 -Original Message-
 From: Tomi Valkeinen [mailto:tomi.valkei...@ti.com]
 Sent: Wednesday, July 30, 2014 22:24 PM
 +static struct fb_info *hvfb_info;

 Static variables like these are usually a no-no. This prevents you from
 having multiple device instances.
 I agree.
 
  static uint screen_width = HVFB_WIDTH;
  static uint screen_height = HVFB_HEIGHT;
  static uint screen_depth;
  static uint screen_fb_size;

 +/* If true, the VSC notifies the VSP on every framebuffer change */
 +static bool synchronous_fb;
 +

 Same comment here.

 However, if (and only if) the driver is already designed to work only
 with single device instance, then this patch is probably ok. But even
 IMO the host should only provide at most 1 synthetic video device to a VM. :-)
 
 then, I'd prefer this to be handled without static variables so that the
 driver could eventually be changed to support multiple device instances.
 
 Hi Tomi,
 Maybe we can remove these static stuff:
 +static struct fb_info *hvfb_info;
 +static struct notifier_block hvfb_panic_nb = {
 + .notifier_call = hvfb_on_panic,
 +};
 by kmalloc()-ing  a new struct:
 struct hv_fb_panic_nb {
 struct fb_info *hvfb_info;
 struct notifier_block nb;
 }
 ?
 I think in hvfb_on_panic() we should be able to get the
 hvfb_info pointer by
 hvfb_info = container_of(nb, struct hv_fb_panic_nb, nb).
 
 If you like that or have a better idea, please let me know so
 I can make a new patch.

To be honest, I haven't been using notifiers much. But the above looks
ok to me.

Or maybe you can add the notifier_block and the synchronous_fb to
hvfb_par? From the notifier_block pointer you could then get hvfp_par,
and from there hvfb_info.

 Tomi




signature.asc
Description: OpenPGP digital signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: android: sw_sync.c: fix missing blank line after declaration

2014-07-31 Thread Yann Droneaud
Hi,

Le jeudi 31 juillet 2014 à 16:30 +0300, Dan Carpenter a écrit :
 On Thu, Jul 31, 2014 at 03:00:19PM +0200, Yann Droneaud wrote:
  Le lundi 28 juillet 2014 à 19:38 -0300, Murilo Opsfelder Araujo a
  écrit :
   Fix coding style issue.
   
   Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
  
  Is this some kind of game ?
  
  The *same* patch was sent three times from three different email
  addresses:
 
 This is just normal.
 
 Once I saw 7 people send the same patch.  I was almost the third person
 to send a fix last week.  I had the patch prepared to send, but I
 happened to look at my inbox before sending.
 

As the initial patch was sent by someone who has some trouble with the
way things are done here [1], it raise some, probably false, alarms.

[1] Help with flame wars
http://lists.kernelnewbies.org/pipermail/kernelnewbies/2014-July/011394.html

Regards.

-- 
Yann Droneaud
OPTEYA


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


[PATCH 04/18] staging: comedi: amplc_pci224: multiple assignments should be avoided

2014-07-31 Thread Ian Abbott
Fix checkpatch issue: CHECK: multiple assignments should be avoided.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index e34bc5e..8e5d94a 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1192,11 +1192,12 @@ static int pci224_attach_common(struct comedi_device 
*dev,
/* PCI234 range options. */
const struct comedi_lrange **range_table_list;
 
-   s-range_table_list = range_table_list =
+   range_table_list =
kmalloc(sizeof(struct comedi_lrange *) * s-n_chan,
GFP_KERNEL);
-   if (!s-range_table_list)
+   if (!range_table_list)
return -ENOMEM;
+   s-range_table_list = range_table_list;
 
if (options) {
for (n = 2; n  3 + s-n_chan; n++) {
-- 
2.0.0

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


[PATCH 10/18] staging: comedi: amplc_pci224: reduce leading whitespace in a few places

2014-07-31 Thread Ian Abbott
Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 53 +--
 1 file changed, 25 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index a7f3454..68fc407 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -500,11 +500,10 @@ static void pci224_ao_stop(struct comedi_device *dev,
spin_unlock_irqrestore(devpriv-ao_spinlock, flags);
/* Reconfigure DAC for insn_write usage. */
outw(0, dev-iobase + PCI224_DACCEN);   /* Disable channels. */
-   devpriv-daccon = COMBINE(devpriv-daccon,
- PCI224_DACCON_TRIG_SW |
- PCI224_DACCON_FIFOINTR_EMPTY,
- PCI224_DACCON_TRIG_MASK |
- PCI224_DACCON_FIFOINTR_MASK);
+   devpriv-daccon =
+COMBINE(devpriv-daccon,
+PCI224_DACCON_TRIG_SW | PCI224_DACCON_FIFOINTR_EMPTY,
+PCI224_DACCON_TRIG_MASK | PCI224_DACCON_FIFOINTR_MASK);
outw(devpriv-daccon | PCI224_DACCON_FIFORESET,
 dev-iobase + PCI224_DACCON);
 }
@@ -644,8 +643,8 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev,
else
trig = PCI224_DACCON_TRIG_EXTP;
}
-   devpriv-daccon = COMBINE(devpriv-daccon, trig,
- PCI224_DACCON_TRIG_MASK);
+   devpriv-daccon =
+   COMBINE(devpriv-daccon, trig, PCI224_DACCON_TRIG_MASK);
outw(devpriv-daccon, dev-iobase + PCI224_DACCON);
}
 
@@ -717,11 +716,11 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct 
comedi_subdevice *s,
 
err |= cfc_check_trigger_src(cmd-start_src, TRIG_INT | TRIG_EXT);
err |= cfc_check_trigger_src(cmd-scan_begin_src,
-   TRIG_EXT | TRIG_TIMER);
+TRIG_EXT | TRIG_TIMER);
err |= cfc_check_trigger_src(cmd-convert_src, TRIG_NOW);
err |= cfc_check_trigger_src(cmd-scan_end_src, TRIG_COUNT);
err |= cfc_check_trigger_src(cmd-stop_src,
-   TRIG_COUNT | TRIG_EXT | TRIG_NONE);
+TRIG_COUNT | TRIG_EXT | TRIG_NONE);
 
if (err)
return 1;
@@ -760,8 +759,8 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct 
comedi_subdevice *s,
case TRIG_EXT:
/* Force to external trigger 0. */
if (cmd-start_arg  ~CR_FLAGS_MASK) {
-   cmd-start_arg = COMBINE(cmd-start_arg, 0,
-~CR_FLAGS_MASK);
+   cmd-start_arg =
+   COMBINE(cmd-start_arg, 0, ~CR_FLAGS_MASK);
err |= -EINVAL;
}
/* The only flag allowed is CR_EDGE, which is ignored. */
@@ -786,16 +785,16 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct 
comedi_subdevice *s,
case TRIG_EXT:
/* Force to external trigger 0. */
if (cmd-scan_begin_arg  ~CR_FLAGS_MASK) {
-   cmd-scan_begin_arg = COMBINE(cmd-scan_begin_arg, 0,
- ~CR_FLAGS_MASK);
+   cmd-scan_begin_arg =
+   COMBINE(cmd-scan_begin_arg, 0, ~CR_FLAGS_MASK);
err |= -EINVAL;
}
/* Only allow flags CR_EDGE and CR_INVERT.  Ignore CR_EDGE. */
if (cmd-scan_begin_arg  CR_FLAGS_MASK 
~(CR_EDGE | CR_INVERT)) {
-   cmd-scan_begin_arg = COMBINE(cmd-scan_begin_arg, 0,
- CR_FLAGS_MASK 
- ~(CR_EDGE | CR_INVERT));
+   cmd-scan_begin_arg =
+   COMBINE(cmd-scan_begin_arg, 0,
+   CR_FLAGS_MASK  ~(CR_EDGE | CR_INVERT));
err |= -EINVAL;
}
break;
@@ -811,14 +810,14 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct 
comedi_subdevice *s,
case TRIG_EXT:
/* Force to external trigger 0. */
if (cmd-stop_arg  ~CR_FLAGS_MASK) {
-   cmd-stop_arg = COMBINE(cmd-stop_arg, 0,
-   ~CR_FLAGS_MASK);
+   cmd-stop_arg =
+   COMBINE(cmd-stop_arg, 0, ~CR_FLAGS_MASK);
err |= -EINVAL;
}
/* The only flag allowed is CR_EDGE, which is ignored. */
if (cmd-stop_arg  CR_FLAGS_MASK  ~CR_EDGE) 

[PATCH 01/18] staging: comedi: amplc_pci224: reformat some comments

2014-07-31 Thread Ian Abbott
Reformat comments to fit in with the preferred coding style, including
the copyright and comedi driver description comments at the start of the
file.  Also, remove a boiler-plate comment for the comedi device private
data structure.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 214 +-
 1 file changed, 109 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 45aba1f..72506bf 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1,102 +1,103 @@
 /*
-comedi/drivers/amplc_pci224.c
-Driver for Amplicon PCI224 and PCI234 AO boards.
-
-Copyright (C) 2005 MEV Ltd. http://www.mev.co.uk/
-
-COMEDI - Linux Control and Measurement Device Interface
-Copyright (C) 1998,2000 David A. Schleef d...@schleef.org
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ * comedi/drivers/amplc_pci224.c
+ * Driver for Amplicon PCI224 and PCI234 AO boards.
+ *
+ * Copyright (C) 2005 MEV Ltd. http://www.mev.co.uk/
+ *
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 1998,2000 David A. Schleef d...@schleef.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
 /*
-Driver: amplc_pci224
-Description: Amplicon PCI224, PCI234
-Author: Ian Abbott abbo...@mev.co.uk
-Devices: [Amplicon] PCI224 (amplc_pci224 or pci224),
-  PCI234 (amplc_pci224 or pci234)
-Updated: Wed, 22 Oct 2008 12:25:08 +0100
-Status: works, but see caveats
-
-Supports:
-
-  - ao_insn read/write
-  - ao_do_cmd mode with the following sources:
-
-- start_src TRIG_INTTRIG_EXT
-- scan_begin_srcTRIG_TIMER  TRIG_EXT
-- convert_src   TRIG_NOW
-- scan_end_src  TRIG_COUNT
-- stop_src  TRIG_COUNT  TRIG_EXTTRIG_NONE
-
-The channel list must contain at least one channel with no repeated
-channels.  The scan end count must equal the number of channels in
-the channel list.
-
-There is only one external trigger source so only one of start_src,
-scan_begin_src or stop_src may use TRIG_EXT.
-
-Configuration options - PCI224:
-  [0] - PCI bus of device (optional).
-  [1] - PCI slot of device (optional).
-  If bus/slot is not specified, the first available PCI device
-  will be used.
-  [2] - Select available ranges according to jumper LK1.  All channels
-are set to the same range:
-0=Jumper position 1-2 (factory default), 4 software-selectable
-  internal voltage references, giving 4 bipolar and 4 unipolar
-  ranges:
-[-10V,+10V], [-5V,+5V], [-2.5V,+2.5V], [-1.25V,+1.25V],
-[0,+10V], [0,+5V], [0,+2.5V], [0,1.25V].
-1=Jumper position 2-3, 1 external voltage reference, giving
-  1 bipolar and 1 unipolar range:
-[-Vext,+Vext], [0,+Vext].
-
-Configuration options - PCI234:
-  [0] - PCI bus of device (optional).
-  [1] - PCI slot of device (optional).
-  If bus/slot is not specified, the first available PCI device
-  will be used.
-  [2] - Select internal or external voltage reference according to
-jumper LK1.  This affects all channels:
-0=Jumper position 1-2 (factory default), Vref=5V internal.
-1=Jumper position 2-3, Vref=Vext external.
-  [3] - Select channel 0 range according to jumper LK2:
-0=Jumper position 2-3 (factory default), range [-2*Vref,+2*Vref]
-  (10V bipolar when options[2]=0).
-1=Jumper position 1-2, range [-Vref,+Vref]
-  (5V bipolar when options[2]=0).
-  [4] - Select channel 1 range according to jumper LK3: cf. options[3].
-  [5] - Select channel 2 range according to jumper LK4: cf. options[3].
-  [6] - Select channel 3 range according to jumper LK5: cf. options[3].
-
-Passing a zero for an option is the same as leaving it unspecified.
-
-Caveats:
-
-  1) All channels on the PCI224 share the same range.  Any change 

[PATCH 03/18] staging: comedi: amplc_pci224: blank lines aren't necessary before a close brace '}'

2014-07-31 Thread Ian Abbott
Fix checkpatch issues: CHECK: Blank lines aren't necessary before a
close brace '}'.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 6a570ef..e34bc5e 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -557,7 +557,6 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev,
/* Fixed number of scans. */
if (num_scans  devpriv-ao_stop_count)
num_scans = devpriv-ao_stop_count;
-
}
 
/* Determine how much room is in the FIFO (in samples). */
@@ -644,7 +643,6 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev,
trig = PCI224_DACCON_TRIG_EXTN;
else
trig = PCI224_DACCON_TRIG_EXTP;
-
}
devpriv-daccon = COMBINE(devpriv-daccon, trig,
  PCI224_DACCON_TRIG_MASK);
@@ -908,7 +906,6 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
for (j = 0; j  cmd-chanlist_len; j++) {
if (CR_CHAN(cmd-chanlist[j])  ch)
rank++;
-
}
devpriv-ao_scan_order[rank] = i;
}
@@ -1002,7 +999,6 @@ pci224_ao_munge(struct comedi_device *dev, struct 
comedi_subdevice *s,
/* Munge the data. */
for (i = 0; i  length; i++)
array[i] = (array[i]  shift) - offset;
-
 }
 
 /*
@@ -1038,11 +1034,9 @@ static irqreturn_t pci224_interrupt(int irq, void *d)
pci224_ao_start(dev, s);
else if (cmd-stop_src == TRIG_EXT)
pci224_ao_stop(dev, s);
-
}
if (valid_intstat  PCI224_INTR_DAC)
pci224_ao_handle_fifo(dev, s);
-
}
/* Reenable interrupt sources. */
spin_lock_irqsave(devpriv-ao_spinlock, flags);
-- 
2.0.0

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


[PATCH 08/18] staging: comedi: amplc_pci224: omit '!= 0' from logical expressions

2014-07-31 Thread Ian Abbott
Since anything non-zero is logically true, don't bother doing
not-equal comparisons with zero, except when testing for an explicit
number 0 (not as a result of bit tests for example).

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index f786237..0ac05fb 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -759,13 +759,13 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct 
comedi_subdevice *s,
break;
case TRIG_EXT:
/* Force to external trigger 0. */
-   if ((cmd-start_arg  ~CR_FLAGS_MASK) != 0) {
+   if (cmd-start_arg  ~CR_FLAGS_MASK) {
cmd-start_arg = COMBINE(cmd-start_arg, 0,
 ~CR_FLAGS_MASK);
err |= -EINVAL;
}
/* The only flag allowed is CR_EDGE, which is ignored. */
-   if ((cmd-start_arg  CR_FLAGS_MASK  ~CR_EDGE) != 0) {
+   if (cmd-start_arg  CR_FLAGS_MASK  ~CR_EDGE) {
cmd-start_arg = COMBINE(cmd-start_arg, 0,
 CR_FLAGS_MASK  ~CR_EDGE);
err |= -EINVAL;
@@ -785,14 +785,14 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct 
comedi_subdevice *s,
break;
case TRIG_EXT:
/* Force to external trigger 0. */
-   if ((cmd-scan_begin_arg  ~CR_FLAGS_MASK) != 0) {
+   if (cmd-scan_begin_arg  ~CR_FLAGS_MASK) {
cmd-scan_begin_arg = COMBINE(cmd-scan_begin_arg, 0,
  ~CR_FLAGS_MASK);
err |= -EINVAL;
}
/* Only allow flags CR_EDGE and CR_INVERT.  Ignore CR_EDGE. */
-   if ((cmd-scan_begin_arg  CR_FLAGS_MASK 
-~(CR_EDGE | CR_INVERT)) != 0) {
+   if (cmd-scan_begin_arg  CR_FLAGS_MASK 
+   ~(CR_EDGE | CR_INVERT)) {
cmd-scan_begin_arg = COMBINE(cmd-scan_begin_arg, 0,
  CR_FLAGS_MASK 
  ~(CR_EDGE | CR_INVERT));
@@ -810,13 +810,13 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct 
comedi_subdevice *s,
break;
case TRIG_EXT:
/* Force to external trigger 0. */
-   if ((cmd-stop_arg  ~CR_FLAGS_MASK) != 0) {
+   if (cmd-stop_arg  ~CR_FLAGS_MASK) {
cmd-stop_arg = COMBINE(cmd-stop_arg, 0,
~CR_FLAGS_MASK);
err |= -EINVAL;
}
/* The only flag allowed is CR_EDGE, which is ignored. */
-   if ((cmd-stop_arg  CR_FLAGS_MASK  ~CR_EDGE) != 0) {
+   if (cmd-stop_arg  CR_FLAGS_MASK  ~CR_EDGE) {
cmd-stop_arg = COMBINE(cmd-stop_arg, 0,
CR_FLAGS_MASK  ~CR_EDGE);
}
@@ -1026,7 +1026,7 @@ static irqreturn_t pci224_interrupt(int irq, void *d)
devpriv-intr_running = 1;
devpriv-intr_cpuid = THISCPU;
spin_unlock_irqrestore(devpriv-ao_spinlock, flags);
-   if (valid_intstat != 0) {
+   if (valid_intstat) {
cmd = s-async-cmd;
if (valid_intstat  PCI224_INTR_EXT) {
devpriv-intsce = ~PCI224_INTR_EXT;
-- 
2.0.0

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


[PATCH 15/18] staging: comedi: amplc_pci224: put board indices in PCI driver_data

2014-07-31 Thread Ian Abbott
The `driver_data` member value from the matched entry of the PCI module
device table `amplc_pci224_pci_table[]` is passed through to our comedi
auto_attach handler, `pci224_auto_attach()`.  Use that to index
directly into our static board data array `pci224_boards[]` instead of
calling `pci224_find_pci_board()` to search for the entry matching the
PCI device ID.  That function can be removed.  The `devid` and `model`
members of `struct pci224_board` are no longer needed either and can be
removed.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 52 ++-
 1 file changed, 18 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index bcef9e6..977894d 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -351,8 +351,6 @@ enum pci224_model { pci224_model, pci234_model };
 
 struct pci224_board {
const char *name;
-   unsigned short devid;
-   enum pci224_model model;
unsigned int ao_chans;
unsigned int ao_bits;
const struct comedi_lrange *ao_range;
@@ -361,20 +359,16 @@ struct pci224_board {
 };
 
 static const struct pci224_board pci224_boards[] = {
-   {
+   [pci224_model] {
.name   = pci224,
-   .devid  = PCI_DEVICE_ID_AMPLICON_PCI224,
-   .model  = pci224_model,
.ao_chans   = 16,
.ao_bits= 12,
.ao_range   = range_pci224,
.ao_hwrange = hwrange_pci224[0],
.ao_range_check = range_check_pci224[0],
},
-   {
+   [pci234_model] {
.name   = pci234,
-   .devid  = PCI_DEVICE_ID_AMPLICON_PCI234,
-   .model  = pci234_model,
.ao_chans   = 4,
.ao_bits= 16,
.ao_range   = range_pci234,
@@ -1071,20 +1065,6 @@ static irqreturn_t pci224_interrupt(int irq, void *d)
 }
 
 /*
- * This function looks for a board matching the supplied PCI device.
- */
-static const struct pci224_board
-*pci224_find_pci_board(struct pci_dev *pci_dev)
-{
-   int i;
-
-   for (i = 0; i  ARRAY_SIZE(pci224_boards); i++)
-   if (pci_dev-device == pci224_boards[i].devid)
-   return pci224_boards[i];
-   return NULL;
-}
-
-/*
  * Common part of attach and auto_attach.
  */
 static int pci224_attach_common(struct comedi_device *dev,
@@ -1162,8 +1142,6 @@ static int pci224_attach_common(struct comedi_device *dev,
s-cancel = pci224_ao_cancel;
s-munge = pci224_ao_munge;
 
-   dev-board_name = thisboard-name;
-
if (irq) {
ret = request_irq(irq, pci224_interrupt, IRQF_SHARED,
  dev-board_name, dev);
@@ -1179,23 +1157,29 @@ static int pci224_attach_common(struct comedi_device 
*dev,
 }
 
 static int
-pci224_auto_attach(struct comedi_device *dev, unsigned long context_unused)
+pci224_auto_attach(struct comedi_device *dev, unsigned long context_model)
 {
struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
+   const struct pci224_board *thisboard = NULL;
struct pci224_private *devpriv;
 
-   dev_info(dev-class_dev, attach pci %s\n, pci_name(pci_dev));
+   if (context_model  ARRAY_SIZE(pci224_boards))
+   thisboard = pci224_boards[context_model];
+   if (!thisboard || !thisboard-name) {
+   dev_err(dev-class_dev,
+   amplc_pci224: BUG! cannot determine board type!\n);
+   return -EINVAL;
+   }
+   dev-board_ptr = thisboard;
+   dev-board_name = thisboard-name;
+
+   dev_info(dev-class_dev, amplc_pci224: attach pci %s - %s\n,
+pci_name(pci_dev), dev-board_name);
 
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (!devpriv)
return -ENOMEM;
 
-   dev-board_ptr = pci224_find_pci_board(pci_dev);
-   if (dev-board_ptr == NULL) {
-   dev_err(dev-class_dev,
-   BUG! cannot determine board type!\n);
-   return -EINVAL;
-   }
return pci224_attach_common(dev, pci_dev);
 }
 
@@ -1231,8 +1215,8 @@ static int amplc_pci224_pci_probe(struct pci_dev *dev,
 }
 
 static const struct pci_device_id amplc_pci224_pci_table[] = {
-   { PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI224) },
-   { PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI234) },
+   { PCI_VDEVICE(AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI224), pci224_model },
+   { PCI_VDEVICE(AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI234), pci234_model },
{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, amplc_pci224_pci_table);
-- 
2.0.0

___
devel mailing list

[PATCH 11/18] staging: comedi: amplc_pci224: no need for 'function'

2014-07-31 Thread Ian Abbott
Remove the address-of operator when the operand is a function.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 68fc407..b8b86ab 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1173,15 +1173,14 @@ static int pci224_attach_common(struct comedi_device 
*dev,
s-subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_CMD_WRITE;
s-n_chan = thisboard-ao_chans;
s-maxdata = (1  thisboard-ao_bits) - 1;
-   s-insn_write = pci224_ao_insn_write;
-   s-insn_read = pci224_ao_insn_read;
+   s-insn_write = pci224_ao_insn_write;
+   s-insn_read = pci224_ao_insn_read;
s-len_chanlist = s-n_chan;
-
dev-write_subdev = s;
-   s-do_cmd = pci224_ao_cmd;
-   s-do_cmdtest = pci224_ao_cmdtest;
-   s-cancel = pci224_ao_cancel;
-   s-munge = pci224_ao_munge;
+   s-do_cmd = pci224_ao_cmd;
+   s-do_cmdtest = pci224_ao_cmdtest;
+   s-cancel = pci224_ao_cancel;
+   s-munge = pci224_ao_munge;
 
/* Sort out channel range options. */
if (thisboard-model == pci234_model) {
-- 
2.0.0

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


[PATCH 07/18] staging: comedi: amplc_pci224: set a more descriptive MODULE_DESCRIPTION()

2014-07-31 Thread Ian Abbott
Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 8ce0f4f..f786237 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1362,5 +1362,5 @@ static struct pci_driver amplc_pci224_pci_driver = {
 module_comedi_pci_driver(amplc_pci224_driver, amplc_pci224_pci_driver);
 
 MODULE_AUTHOR(Comedi http://www.comedi.org;);
-MODULE_DESCRIPTION(Comedi low-level driver);
+MODULE_DESCRIPTION(Comedi driver for Amplicon PCI224 and PCI234 AO boards);
 MODULE_LICENSE(GPL);
-- 
2.0.0

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


[PATCH 18/18] staging: comedi: amplc_pci224: no need to comedi_set_hw_dev() here

2014-07-31 Thread Ian Abbott
The comedi core module calls `comedi_set_hw_dev()` to associate the
hardware `struct device` with the `struct comedi_device` before it calls
the comedi driver's auto_attach hook `pci224_auto_attach()`.  There is
no need for `pci224_auto_attach()` to call `comedi_set_hw_dev()` itself,
so remove the call.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 4b45319..6fed6b8 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1084,8 +1084,6 @@ pci224_auto_attach(struct comedi_device *dev, unsigned 
long context_model)
if (!devpriv)
return -ENOMEM;
 
-   comedi_set_hw_dev(dev, pci_dev-dev);
-
ret = comedi_pci_enable(dev);
if (ret)
return ret;
-- 
2.0.0

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


[PATCH 13/18] staging: comedi: amplc_pci224: remove legacy attach mechanism

2014-07-31 Thread Ian Abbott
Since the driver no longer supports options in its legacy attach
mechanism to describe the jumper settings (or any options beyond
restricting a PCI search to a particular bus and/or slot), there is no
need to retain this mechanism in the driver.  Remove the comedi driver
attach handler `pci224_attach()`, and the now unused
`pci224_find_pci_dev()`.  Also, remove the wildcard entry from the
board table `pci224_boards[]` as it is no longer needed.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 82 ++-
 1 file changed, 6 insertions(+), 76 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index fba0198..0bf5e68 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -22,9 +22,8 @@
  * Driver: amplc_pci224
  * Description: Amplicon PCI224, PCI234
  * Author: Ian Abbott abbo...@mev.co.uk
- * Devices: [Amplicon] PCI224 (amplc_pci224 or pci224),
- *   PCI234 (amplc_pci224 or pci234)
- * Updated: Wed, 30 Jul 2014 18:08:43 +
+ * Devices: [Amplicon] PCI224 (amplc_pci224), PCI234
+ * Updated: Thu, 31 Jul 2014 11:08:03 +
  * Status: works, but see caveats
  *
  * Supports:
@@ -46,12 +45,10 @@
  * scan_begin_src or stop_src may use TRIG_EXT.
  *
  * Configuration options:
- *   [0] - PCI bus of device (optional).
- *   [1] - PCI slot of device (optional).
- *   If bus/slot is not specified, the first available PCI device
- *   will be used.
+ *   none
  *
- * Passing a zero for an option is the same as leaving it unspecified.
+ * Manual configuration of PCI cards is not supported; they are configured
+ * automatically.
  *
  * Output range selection - PCI224:
  *
@@ -350,7 +347,7 @@ static const unsigned char range_check_pci234[4] = {
  * Board descriptions.
  */
 
-enum pci224_model { any_model, pci224_model, pci234_model };
+enum pci224_model { pci224_model, pci234_model };
 
 struct pci224_board {
const char *name;
@@ -384,11 +381,6 @@ static const struct pci224_board pci224_boards[] = {
.ao_hwrange = hwrange_pci234[0],
.ao_range_check = range_check_pci234[0],
},
-   {
-   .name   = amplc_pci224,
-   .devid  = PCI_DEVICE_ID_INVALID,
-   .model  = any_model,/* wildcard */
-   },
 };
 
 struct pci224_private {
@@ -1093,49 +1085,6 @@ static const struct pci224_board
 }
 
 /*
- * This function looks for a PCI device matching the requested board name,
- * bus and slot.
- */
-static struct pci_dev *pci224_find_pci_dev(struct comedi_device *dev,
-  struct comedi_devconfig *it)
-{
-   const struct pci224_board *thisboard = comedi_board(dev);
-   struct pci_dev *pci_dev = NULL;
-   int bus = it-options[0];
-   int slot = it-options[1];
-
-   for_each_pci_dev(pci_dev) {
-   if (bus || slot) {
-   if (bus != pci_dev-bus-number ||
-   slot != PCI_SLOT(pci_dev-devfn))
-   continue;
-   }
-   if (pci_dev-vendor != PCI_VENDOR_ID_AMPLICON)
-   continue;
-
-   if (thisboard-model == any_model) {
-   /* Match any supported model. */
-   const struct pci224_board *board_ptr;
-
-   board_ptr = pci224_find_pci_board(pci_dev);
-   if (board_ptr == NULL)
-   continue;
-   /* Change board_ptr to matched board. */
-   dev-board_ptr = board_ptr;
-   } else {
-   /* Match specific model name. */
-   if (thisboard-devid != pci_dev-device)
-   continue;
-   }
-   return pci_dev;
-   }
-   dev_err(dev-class_dev,
-   No supported board found! (req. bus %d, slot %d)\n,
-   bus, slot);
-   return NULL;
-}
-
-/*
  * Common part of attach and auto_attach.
  */
 static int pci224_attach_common(struct comedi_device *dev,
@@ -1229,24 +1178,6 @@ static int pci224_attach_common(struct comedi_device 
*dev,
return 0;
 }
 
-static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig 
*it)
-{
-   struct pci224_private *devpriv;
-   struct pci_dev *pci_dev;
-
-   dev_info(dev-class_dev, attach\n);
-
-   devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
-   if (!devpriv)
-   return -ENOMEM;
-
-   pci_dev = pci224_find_pci_dev(dev, it);
-   if (!pci_dev)
-   return -EIO;
-
-   return pci224_attach_common(dev, pci_dev);
-}
-
 static int
 pci224_auto_attach(struct comedi_device *dev, unsigned long context_unused)
 {
@@ -1295,7 +1226,6 @@ static void 

[PATCH 12/18] staging: comedi: amplc_pci224: remove options to select output ranges

2014-07-31 Thread Ian Abbott
When attaching a PCI224 or PCI234 manually via the `COMEDI_DEVCONFIG`
ioctl, there are several options the user can supply that describe the
state of the hardware jumpers (LK1 for PCI224, LK1 thru LK5 for PCI234).
These options control how the driver sets up the AO range tables for the
device.  Those options are useless when the board is attached
automatically via the PCI driver probe function
`amplc_pci225_pci_probe()`, `comedi_pci_auto_config()`, and the
comedi driver auto_attach handler `pci224_auto_attach()`.

Rip out the range table selection options and use a single, static range
table per board type, containing all the software- and
hardware-selectable ranges for that board.  The PCI234 used to have a
per-channel `range_table_list` rather than an all-channel `range_table`,
as the jumpers selected different ranges for all channels.  Now that the
channels are using a unified range table, use an all-channel
`range_table` instead.

When checking the channel list for an asynchronous command in
`pci224_ao_check_chanlist()` make sure the ranges specified in the list
have compatible jumper settings.  We don't know how the jumpers are
actually set, but we can at least avoid conflicting settings.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 243 +++---
 1 file changed, 106 insertions(+), 137 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index b8b86ab..fba0198 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -24,7 +24,7 @@
  * Author: Ian Abbott abbo...@mev.co.uk
  * Devices: [Amplicon] PCI224 (amplc_pci224 or pci224),
  *   PCI234 (amplc_pci224 or pci234)
- * Updated: Wed, 22 Oct 2008 12:25:08 +0100
+ * Updated: Wed, 30 Jul 2014 18:08:43 +
  * Status: works, but see caveats
  *
  * Supports:
@@ -45,42 +45,48 @@
  * There is only one external trigger source so only one of start_src,
  * scan_begin_src or stop_src may use TRIG_EXT.
  *
- * Configuration options - PCI224:
+ * Configuration options:
  *   [0] - PCI bus of device (optional).
  *   [1] - PCI slot of device (optional).
  *   If bus/slot is not specified, the first available PCI device
  *   will be used.
- *   [2] - Select available ranges according to jumper LK1.  All channels
- * are set to the same range:
- * 0=Jumper position 1-2 (factory default), 4 software-selectable
- *   internal voltage references, giving 4 bipolar and 4 unipolar
- *   ranges:
- * [-10V,+10V], [-5V,+5V], [-2.5V,+2.5V], [-1.25V,+1.25V],
- * [0,+10V], [0,+5V], [0,+2.5V], [0,1.25V].
- * 1=Jumper position 2-3, 1 external voltage reference, giving
- *   1 bipolar and 1 unipolar range:
- * [-Vext,+Vext], [0,+Vext].
- *
- * Configuration options - PCI234:
- *   [0] - PCI bus of device (optional).
- *   [1] - PCI slot of device (optional).
- *   If bus/slot is not specified, the first available PCI device
- *   will be used.
- *   [2] - Select internal or external voltage reference according to
- * jumper LK1.  This affects all channels:
- * 0=Jumper position 1-2 (factory default), Vref=5V internal.
- * 1=Jumper position 2-3, Vref=Vext external.
- *   [3] - Select channel 0 range according to jumper LK2:
- * 0=Jumper position 2-3 (factory default), range [-2*Vref,+2*Vref]
- *   (10V bipolar when options[2]=0).
- * 1=Jumper position 1-2, range [-Vref,+Vref]
- *   (5V bipolar when options[2]=0).
- *   [4] - Select channel 1 range according to jumper LK3: cf. options[3].
- *   [5] - Select channel 2 range according to jumper LK4: cf. options[3].
- *   [6] - Select channel 3 range according to jumper LK5: cf. options[3].
  *
  * Passing a zero for an option is the same as leaving it unspecified.
  *
+ * Output range selection - PCI224:
+ *
+ *   Output ranges on PCI224 are partly software-selectable and partly
+ *   hardware-selectable according to jumper LK1.  All channels are set
+ *   to the same range:
+ *
+ *   - LK1 position 1-2 (factory default) corresponds to the following
+ * comedi ranges:
+ *
+ *   0: [-10V,+10V]; 1: [-5V,+5V]; 2: [-2.5V,+2.5V], 3: [-1.25V,+1.25V],
+ *   4: [0,+10V],5: [0,+5V],   6: [0,+2.5V], 7: [0,+1.25V]
+ *
+ *   - LK1 position 2-3 corresponds to the following Comedi ranges, using
+ * an external voltage reference:
+ *
+ *   0: [-Vext,+Vext],
+ *   1: [0,+Vext]
+ *
+ * Output range selection - PCI234:
+ *
+ *   Output ranges on PCI234 are hardware-selectable according to jumper
+ *   LK1 which affects all channels, and jumpers LK2, LK3, LK4 and LK5
+ *   which affect channels 0, 1, 2 and 3 individually.  LK1 chooses between
+ *   an internal 5V reference and an external voltage reference (Vext).
+ *   LK2/3/4/5 choose (per channel) 

[PATCH 05/18] staging: comedi: amplc_pci224: fix spinlock_t definition without comment

2014-07-31 Thread Ian Abbott
Fix checkpatch issue: CHECK: spinlock_t definition without comment.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 8e5d94a..dfeb70c 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -365,7 +365,7 @@ struct pci224_private {
const unsigned short *hwrange;
unsigned long iobase1;
unsigned long state;
-   spinlock_t ao_spinlock;
+   spinlock_t ao_spinlock; /* spinlock for AO command handling */
unsigned int *ao_readback;
unsigned short *ao_scan_vals;
unsigned char *ao_scan_order;
-- 
2.0.0

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


[PATCH 16/18] staging: comedi: amplc_pci224: remove PCI_DEVICE_ID_... macros

2014-07-31 Thread Ian Abbott
The macros `PCI_DEVICE_ID_AMPLICON_PCI224` and
`PCI_DEVICE_ID_AMPLICON_PCI234` are only used in the PCI module device
table `amplc_pci224_pci_table[]`.  Just expand the macros where they are
used and remove them.  The macro `PCI_DEVICE_ID_INVALID` is no longer
used either, so remove it.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 977894d..4fceb7c 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -113,13 +113,6 @@
 #include 8253.h
 
 /*
- * PCI IDs.
- */
-#define PCI_DEVICE_ID_AMPLICON_PCI224 0x0007
-#define PCI_DEVICE_ID_AMPLICON_PCI234 0x0008
-#define PCI_DEVICE_ID_INVALID 0x
-
-/*
  * PCI224/234 i/o space 1 (PCIBAR2) registers.
  */
 #define PCI224_Z2_CT0  0x14/* 82C54 counter/timer 0 */
@@ -1215,8 +1208,8 @@ static int amplc_pci224_pci_probe(struct pci_dev *dev,
 }
 
 static const struct pci_device_id amplc_pci224_pci_table[] = {
-   { PCI_VDEVICE(AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI224), pci224_model },
-   { PCI_VDEVICE(AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI234), pci234_model },
+   { PCI_VDEVICE(AMPLICON, 0x0007), pci224_model },
+   { PCI_VDEVICE(AMPLICON, 0x0008), pci234_model },
{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, amplc_pci224_pci_table);
-- 
2.0.0

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


[PATCH 17/18] staging: comedi: amplc_pci224: absorb pci224_attach_common()

2014-07-31 Thread Ian Abbott
`pci224_attach_common()` is now only called from `pci225_auto_attach()`,
so absorb it into that function.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 56 +++
 1 file changed, 22 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 4fceb7c..4b45319 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1057,18 +1057,33 @@ static irqreturn_t pci224_interrupt(int irq, void *d)
return IRQ_RETVAL(retval);
 }
 
-/*
- * Common part of attach and auto_attach.
- */
-static int pci224_attach_common(struct comedi_device *dev,
-   struct pci_dev *pci_dev)
+static int
+pci224_auto_attach(struct comedi_device *dev, unsigned long context_model)
 {
-   const struct pci224_board *thisboard = comedi_board(dev);
-   struct pci224_private *devpriv = dev-private;
+   struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
+   const struct pci224_board *thisboard = NULL;
+   struct pci224_private *devpriv;
struct comedi_subdevice *s;
unsigned int irq;
int ret;
 
+   if (context_model  ARRAY_SIZE(pci224_boards))
+   thisboard = pci224_boards[context_model];
+   if (!thisboard || !thisboard-name) {
+   dev_err(dev-class_dev,
+   amplc_pci224: BUG! cannot determine board type!\n);
+   return -EINVAL;
+   }
+   dev-board_ptr = thisboard;
+   dev-board_name = thisboard-name;
+
+   dev_info(dev-class_dev, amplc_pci224: attach pci %s - %s\n,
+pci_name(pci_dev), dev-board_name);
+
+   devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
+   if (!devpriv)
+   return -ENOMEM;
+
comedi_set_hw_dev(dev, pci_dev-dev);
 
ret = comedi_pci_enable(dev);
@@ -1149,33 +1164,6 @@ static int pci224_attach_common(struct comedi_device 
*dev,
return 0;
 }
 
-static int
-pci224_auto_attach(struct comedi_device *dev, unsigned long context_model)
-{
-   struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
-   const struct pci224_board *thisboard = NULL;
-   struct pci224_private *devpriv;
-
-   if (context_model  ARRAY_SIZE(pci224_boards))
-   thisboard = pci224_boards[context_model];
-   if (!thisboard || !thisboard-name) {
-   dev_err(dev-class_dev,
-   amplc_pci224: BUG! cannot determine board type!\n);
-   return -EINVAL;
-   }
-   dev-board_ptr = thisboard;
-   dev-board_name = thisboard-name;
-
-   dev_info(dev-class_dev, amplc_pci224: attach pci %s - %s\n,
-pci_name(pci_dev), dev-board_name);
-
-   devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
-   if (!devpriv)
-   return -ENOMEM;
-
-   return pci224_attach_common(dev, pci_dev);
-}
-
 static void pci224_detach(struct comedi_device *dev)
 {
struct pci224_private *devpriv = dev-private;
-- 
2.0.0

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


[PATCH 06/18] staging: comedi: amplc_pci224: add whitespace to pci224_boards[]

2014-07-31 Thread Ian Abbott
Add a bit of whitespace to the initializer of `pci224_boards[]` for
aesthetic reasons.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 32 +--
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index dfeb70c..8ce0f4f 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -341,24 +341,24 @@ struct pci224_board {
 
 static const struct pci224_board pci224_boards[] = {
{
-.name = pci224,
-.devid = PCI_DEVICE_ID_AMPLICON_PCI224,
-.model = pci224_model,
-.ao_chans = 16,
-.ao_bits = 12,
-},
+   .name   = pci224,
+   .devid  = PCI_DEVICE_ID_AMPLICON_PCI224,
+   .model  = pci224_model,
+   .ao_chans   = 16,
+   .ao_bits= 12,
+   },
{
-.name = pci234,
-.devid = PCI_DEVICE_ID_AMPLICON_PCI234,
-.model = pci234_model,
-.ao_chans = 4,
-.ao_bits = 16,
-},
+   .name   = pci234,
+   .devid  = PCI_DEVICE_ID_AMPLICON_PCI234,
+   .model  = pci234_model,
+   .ao_chans   = 4,
+   .ao_bits= 16,
+   },
{
-.name = amplc_pci224,
-.devid = PCI_DEVICE_ID_INVALID,
-.model = any_model,/* wildcard */
-},
+   .name   = amplc_pci224,
+   .devid  = PCI_DEVICE_ID_INVALID,
+   .model  = any_model,/* wildcard */
+   },
 };
 
 struct pci224_private {
-- 
2.0.0

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


[PATCH 14/18] staging: comedi: amplc_pci224: no need to manipulate PCI ref count

2014-07-31 Thread Ian Abbott
This driver no longer supports a legacy attach mechanism that searches
for a suitable PCI device and increments it's reference count, but since
the common detach handler `pci224_detach()` still has a left-over
`pci_dev_put()`, a matching `pci_dev_get()` is needed in the
auto_attach handler `pci224_auto_attach()`.  There is no longer any
reason to get and put the PCI device, so those calls can be removed.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 0bf5e68..bcef9e6 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1196,20 +1196,12 @@ pci224_auto_attach(struct comedi_device *dev, unsigned 
long context_unused)
BUG! cannot determine board type!\n);
return -EINVAL;
}
-   /*
-* Need to 'get' the PCI device to match the 'put' in pci224_detach().
-* TODO: Remove the pci_dev_get() and matching pci_dev_put() once
-* support for manual attachment of PCI devices via pci224_attach()
-* has been removed.
-*/
-   pci_dev_get(pci_dev);
return pci224_attach_common(dev, pci_dev);
 }
 
 static void pci224_detach(struct comedi_device *dev)
 {
struct pci224_private *devpriv = dev-private;
-   struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 
if (dev-irq)
free_irq(dev-irq, dev);
@@ -1219,8 +1211,6 @@ static void pci224_detach(struct comedi_device *dev)
kfree(devpriv-ao_scan_order);
}
comedi_pci_disable(dev);
-   if (pcidev)
-   pci_dev_put(pcidev);
 }
 
 static struct comedi_driver amplc_pci224_driver = {
-- 
2.0.0

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


[PATCH] staging: comedi: ii_pci20kc: request and ioremap memory

2014-07-31 Thread Ian Abbott
The ii_pci20kc module is a comedi driver for Intelligent Instruments
PCI-20001C carrier board and modules.  Despite the name, this is
actually an ISA board and uses 1K of ISA memory space (below 1M) for the
main board plus up to three modules.  The address is set by hardware
jumpers.

When the board is attached to Comedi via the `COMEDI_DEVCONFIG` ioctl
and the driver's legacy attach handler, the base address is passed in.
The driver currently uses that address as-is, which is a bad idea.  It
doesn't even reserve the memory region.

Fix that by sanity checking the passed in address, reserving the memory
region and ioremapping it.

Replace the current detach handler `comedi_legacy_detach()` with a new
handler `ii20k_detach()` which unmaps the memory and releases the
region.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/ii_pci20kc.c | 32 ++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c 
b/drivers/staging/comedi/drivers/ii_pci20kc.c
index b1f44b3..687db43 100644
--- a/drivers/staging/comedi/drivers/ii_pci20kc.c
+++ b/drivers/staging/comedi/drivers/ii_pci20kc.c
@@ -33,6 +33,7 @@
 /*
  * Register I/O map
  */
+#define II20K_SIZE 0x400
 #define II20K_MOD_OFFSET   0x100
 #define II20K_ID_REG   0x00
 #define II20K_ID_MOD1_EMPTY(1  7)
@@ -439,12 +440,29 @@ static int ii20k_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
 {
struct comedi_subdevice *s;
+   unsigned int membase;
unsigned char id;
bool has_dio;
int ret;
 
-   /* FIXME: this doesn't seem right, should 'mmio' be ioremap'ed? */
-   dev-mmio = (void __iomem *)(unsigned long)it-options[0];
+   membase = it-options[0];
+   if (!membase || (membase  ~(0x10 - II20K_SIZE))) {
+   dev_warn(dev-class_dev,
+%s: invalid memory address specified\n,
+dev-board_name);
+   return -EINVAL;
+   }
+
+   if (!request_mem_region(membase, II20K_SIZE, dev-board_name)) {
+   dev_warn(dev-class_dev, %s: I/O mem conflict (%#x,%u)\n,
+dev-board_name, membase, II20K_SIZE);
+   return -EIO;
+   }
+   dev-iobase = membase;  /* actually, a memory address */
+
+   dev-mmio = ioremap(membase, II20K_SIZE);
+   if (!dev-mmio)
+   return -ENOMEM;
 
id = readb(dev-mmio + II20K_ID_REG);
switch (id  II20K_ID_MASK) {
@@ -509,11 +527,19 @@ static int ii20k_attach(struct comedi_device *dev,
return 0;
 }
 
+static void ii20k_detach(struct comedi_device *dev)
+{
+   if (dev-mmio)
+   iounmap(dev-mmio);
+   if (dev-iobase)/* actually, a memory address */
+   release_mem_region(dev-iobase, II20K_SIZE);
+}
+
 static struct comedi_driver ii20k_driver = {
.driver_name= ii_pci20kc,
.module = THIS_MODULE,
.attach = ii20k_attach,
-   .detach = comedi_legacy_detach,
+   .detach = ii20k_detach,
 };
 module_comedi_driver(ii20k_driver);
 
-- 
2.0.0

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


[patch] staging: lustre: bitwise vs logical typo

2014-07-31 Thread Dan Carpenter
Bitwise AND was intended here obviously.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
---
Static analysis.  I wasn't able to compile this.

Also lustre needs an entry in MAINTAINERS because otherwise
get_maintainer.pl still sends everything to Peng Tao only.

diff --git a/drivers/staging/lustre/lustre/obdecho/echo.c 
b/drivers/staging/lustre/lustre/obdecho/echo.c
index f3b7429..dae1599 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo.c
@@ -125,7 +125,7 @@ static int echo_create(const struct lu_env *env, struct 
obd_export *exp,
return -EINVAL;
}
 
-   if (!(oa-o_mode  S_IFMT)) {
+   if (!(oa-o_mode  S_IFMT)) {
CERROR(echo obd: no type!\n);
return -ENOENT;
}
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/12] staging: unisys: remove U16 type

2014-07-31 Thread Benjamin Romer
This patch switches all use of the U16 typedef to use the kernel's u16 type
instead.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 .../include/channels/controlframework.h| 18 
 .../include/channels/controlvmchannel.h| 24 +++---
 .../common-spar/include/channels/diagchannel.h |  8 
 .../common-spar/include/channels/iochannel.h   | 22 ++--
 .../unisys/common-spar/include/vmcallinterface.h   |  4 ++--
 drivers/staging/unisys/include/commontypes.h   |  1 -
 drivers/staging/unisys/include/uisqueue.h  |  2 +-
 .../unisys/visorchipset/visorchipset_main.c| 10 -
 8 files changed, 44 insertions(+), 45 deletions(-)

diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlframework.h 
b/drivers/staging/unisys/common-spar/include/channels/controlframework.h
index ca1c46e..4e361b2 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlframework.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlframework.h
@@ -37,19 +37,19 @@
 /* Define Ki scale page to be traditional 4KB page */
 #define ULTRA_MEMORY_PAGE_Ki (ULTRA_MEMORY_PAGE_WORD * ULTRA_MEMORY_COUNT_Ki)
 typedef struct _ULTRA_SEGMENT_STATE  {
-   U16 Enabled:1;  /* Bit 0: May enter other states */
-   U16 Active:1;   /* Bit 1: Assigned to active partition */
-   U16 Alive:1;/* Bit 2: Configure message sent to
+   u16 Enabled:1;  /* Bit 0: May enter other states */
+   u16 Active:1;   /* Bit 1: Assigned to active partition */
+   u16 Alive:1;/* Bit 2: Configure message sent to
 * service/server */
-   U16 Revoked:1;  /* Bit 3: similar to partition state
+   u16 Revoked:1;  /* Bit 3: similar to partition state
 * ShuttingDown */
-   U16 Allocated:1;/* Bit 4: memory (device/port number)
+   u16 Allocated:1;/* Bit 4: memory (device/port number)
 * has been selected by Command */
-   U16 Known:1;/* Bit 5: has been introduced to the
+   u16 Known:1;/* Bit 5: has been introduced to the
 * service/guest partition */
-   U16 Ready:1;/* Bit 6: service/Guest partition has
+   u16 Ready:1;/* Bit 6: service/Guest partition has
 * responded to introduction */
-   U16 Operating:1;/* Bit 7: resource is configured and
+   u16 Operating:1;/* Bit 7: resource is configured and
 * operating */
/* Note: don't use high bit unless we need to switch to ushort
 * which is non-compliant */
@@ -69,7 +69,7 @@ typedef union {
u8 Major;   /* will be 1 for the first release and
 * increment thereafter  */
u8 Minor;
-   U16 Maintenance;
+   u16 Maintenance;
U32 Revision;   /* Subversion revision */
} Part;
 } ULTRA_COMPONENT_VERSION;
diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index 061ff3d..051ef35 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -147,7 +147,7 @@ struct InterruptInfo {
 };
 
 struct PciId {
-   U16 Domain;
+   u16 Domain;
u8 Bus;
u8 Slot;
u8 Func;
@@ -155,10 +155,10 @@ struct PciId {
 };
 
 struct PciConfigHdr {
-   U16 VendorId;
-   U16 SubSysVendor;
-   U16 DeviceId;
-   U16 SubSysDevice;
+   u16 VendorId;
+   u16 SubSysVendor;
+   u16 DeviceId;
+   u16 SubSysDevice;
U32 ClassCode;
U32 Reserved;   /* Natural alignment purposes */
 };
@@ -181,10 +181,10 @@ struct virtDiskInfo  {
U32 externalPortNo; /* 0 for SAS RAID provided (external)
 * virtual disks, 1 for virtual disk
 * images, 2 for gold disk images */
-   U16 VirtualDiskIndex;   /* Index of disk descriptor in the
+   u16 VirtualDiskIndex;   /* Index of disk descriptor in the
 * VirtualDisk segment associated with
 * externalPortNo */
-   U16 Reserved1;
+   u16 Reserved1;
U32 Reserved2;
 };
 
@@ -519,18 +519,18 @@ typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL  {
 U64 PrototypeControlChannelOffset;
 GUEST_PHYSICAL_ADDRESS VirtualGuestPartitionHandle;
 
-U16 RestoreAction; /* Restore Action field to restore the guest
+u16 RestoreAction; /* Restore Action field to restore the guest
  

[PATCH 06/12] staging: unisys: remove S32 type

2014-07-31 Thread Benjamin Romer
Delete the S32 type from commontypes.h since it wasn't being used.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/include/commontypes.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 8bfa760..4e89cdf 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -30,7 +30,6 @@
 #include syslog.h
 #endif
 
-#define S32 int32_t
 #define S64 int64_t
 
 #ifdef __KERNEL__
-- 
1.9.1

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


[PATCH 00/12] staging: unisys: common types cleanup

2014-07-31 Thread Benjamin Romer
The include/commontypes.h file defines many types and functions locally when the
kernel's existing definitions should have been used instead. This patch series
converts UINTN and all of the U16 through U64 and S8 through S64 types to kernel
types, and gets rid of the MEMCMP, MEMSET, STRLEN, STRCPY, and MEMCMP_IO macros.
It also removes redunantly-defined macros meant for out-of-kernel use, that have
no purpose being in the kernel.

The U8 type was removed by a previous patch. This new set has been rebased and
all conflicts removed.

Benjamin Romer (12):
  staging: unisys: remove U16 type
  staging: unisys: remove U32 type
  staging: unisys: remove U64 type
  staging: unisys: remove S8 type
  staging: unisys: remove S16 type
  staging: unisys: remove S32 type
  staging: unisys: remove S64 type
  staging: unisys: remove non-kernel code from commontypes.h
  staging: unisys: remove unused defines from commontypes.h
  staging: unisys: remove UINTN type
  staging: unisys: remove MEMSET define
  staging: unisys: remove MEMCMP_IO

 drivers/staging/unisys/channels/channel.c  |   8 +-
 drivers/staging/unisys/channels/chanstub.c |   4 +-
 drivers/staging/unisys/channels/chanstub.h |   4 +-
 .../unisys/common-spar/include/channels/channel.h  | 104 +-
 .../include/channels/controlframework.h|  22 +-
 .../include/channels/controlvmchannel.h| 226 ++---
 .../common-spar/include/channels/diagchannel.h |  30 +--
 .../common-spar/include/channels/iochannel.h   |  94 -
 .../common-spar/include/channels/vbuschannel.h |  12 +-
 .../unisys/common-spar/include/vmcallinterface.h   |  18 +-
 drivers/staging/unisys/include/commontypes.h   |  84 +---
 drivers/staging/unisys/include/guestlinuxdebug.h   |  14 +-
 drivers/staging/unisys/include/uisqueue.h  |  84 
 drivers/staging/unisys/include/uisutils.h  |  86 
 drivers/staging/unisys/uislib/uislib.c |  62 +++---
 drivers/staging/unisys/uislib/uisqueue.c   |   4 +-
 drivers/staging/unisys/uislib/uisutils.c   |   4 +-
 drivers/staging/unisys/virthba/virthba.c   |  28 +--
 drivers/staging/unisys/virtpci/virtpci.h   |   4 +-
 drivers/staging/unisys/visorchannel/visorchannel.h |  14 +-
 .../unisys/visorchannel/visorchannel_funcs.c   |  30 +--
 drivers/staging/unisys/visorchipset/file.c |   4 +-
 drivers/staging/unisys/visorchipset/parser.c   |   6 +-
 drivers/staging/unisys/visorchipset/parser.h   |   4 +-
 drivers/staging/unisys/visorchipset/visorchipset.h |  66 +++---
 .../unisys/visorchipset/visorchipset_main.c|  50 ++---
 26 files changed, 492 insertions(+), 574 deletions(-)

-- 
1.9.1

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


[PATCH 05/12] staging: unisys: remove S16 type

2014-07-31 Thread Benjamin Romer
This patch switches all use of the S16 typedef to use the kernel's s16 type
instead.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/common-spar/include/channels/diagchannel.h | 2 +-
 drivers/staging/unisys/include/commontypes.h  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
index eb2f530..c01649a 100644
--- a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
@@ -114,7 +114,7 @@ typedef struct _DIAG_EFI_TIME  {
u8 Second;  /* 0 - 59 */
u8 Pad1;
u32 Nanosecond; /* 0 - 999, 999, 999 */
-   S16 TimeZone;   /* -1440 to 1440 or 2047 */
+   s16 TimeZone;   /* -1440 to 1440 or 2047 */
u8 Daylight;
u8 Pad2;
 } DIAG_EFI_TIME;
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 15429f8..8bfa760 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -30,7 +30,6 @@
 #include syslog.h
 #endif
 
-#define S16 int16_t
 #define S32 int32_t
 #define S64 int64_t
 
-- 
1.9.1

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


[PATCH 08/12] staging: unisys: remove non-kernel code from commontypes.h

2014-07-31 Thread Benjamin Romer
This patch deletes everything in common types that was in the else section
of a #ifdef __KERNEL__ block.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/include/commontypes.h | 62 
 1 file changed, 62 deletions(-)

diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index fee1b21..2aac0dd 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -20,17 +20,10 @@
  * similar abbreviated content */
 #define _SUPERVISOR_COMMONTYPES_H_
 
-#ifdef __KERNEL__
 #include linux/types.h
 #include linux/version.h
 #include linux/io.h
 #include linux/uuid.h
-#else
-#include stdint.h
-#include syslog.h
-#endif
-
-#ifdef __KERNEL__
 
 #ifdef CONFIG_X86_32
 #define UINTN u32
@@ -38,19 +31,6 @@
 #define UINTN u64
 #endif
 
-#else
-
-#include stdint.h
-#if __WORDSIZE == 32
-#define UINTN u32
-#elif __WORDSIZE == 64
-#define UINTN u64
-#else
-#error Unsupported __WORDSIZE
-#endif
-
-#endif
-
 typedef u64 GUEST_PHYSICAL_ADDRESS;
 
 #define MEMSET(ptr, val, len) memset(ptr, val, len)
@@ -62,7 +42,6 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
 #define INLINE inline
 #define OFFSETOF offsetof
 
-#ifdef __KERNEL__
 #define MEMORYBARRIER mb()
 #define MEMCPY(dest, src, len) memcpy(dest, src, len)
 #define MEMCPY_TOIO(dest, src, len) memcpy_toio(dest, src, len)
@@ -99,47 +78,6 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
  LineNumber, Str, args...) \
pr_info(Str, ## args)
 
-#else
-#define MEMCPY(dest, src, len) memcpy(dest, src, len)
-
-#define MEMORYBARRIER mb()
-
-#define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
- lin, logCtx)  \
-   do {\
-   syslog(LOG_USER | LOG_ERR,  \
-  Channel mismatch on channel=%s(%pUL) field=%s 
expected=%pUL actual=%pUL @%s:%d, \
-  chName, chType, field,  \
-  expected, actual, \
-  fil, lin);   \
-   } while (0)
-
-#define CHANNEL_U32_MISMATCH(chType, chName, field, expected, actual, fil, \
-lin, logCtx)   \
-   do {\
-   syslog(LOG_USER | LOG_ERR,  \
-  Channel mismatch on channel=%s(%pUL) field=%s 
expected=0x%-8.8lx actual=0x%-8.8lx @%s:%d, \
-  chName, chType, field,   \
-  (unsigned long)expected, (unsigned long)actual,  \
-  fil, lin);   \
-   } while (0)
-
-#define CHANNEL_U64_MISMATCH(chType, chName, field, expected, actual, fil, \
-lin, logCtx)   \
-   do {\
-   syslog(LOG_USER | LOG_ERR,  \
-  Channel mismatch on channel=%s(%pUL) field=%s 
expected=0x%-8.8Lx actual=0x%-8.8Lx @%s:%d, \
-  chName, chType, field,   \
-  (unsigned long long)expected,\
-  (unsigned long long)actual,  \
-  fil, lin);   \
-   } while (0)
-
-#define UltraLogEvent(logCtx, EventId, Severity, SubsystemMask, pFunctionName, 
\
- LineNumber, Str, args...) \
-   syslog(LOG_USER | LOG_INFO, Str, ## args)
-#endif
-
 #define VolatileBarrier() MEMORYBARRIER
 
 #endif
-- 
1.9.1

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


[PATCH 10/12] staging: unisys: remove UINTN type

2014-07-31 Thread Benjamin Romer
This patch removes UINTN from commontypes.h, using u64 in the one spot this
type was used.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/common-spar/include/channels/channel.h | 4 ++--
 drivers/staging/unisys/include/commontypes.h  | 6 --
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 99533cf..c1ba1de 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -295,8 +295,8 @@ typedef struct _SIGNAL_QUEUE_HEADER {
chan-QHDRFLD.Type = typ;   \
chan-QHDRFLD.Size = sizeof(chan-QDATAFLD);\
chan-QHDRFLD.SignalSize = sizeof(QDATATYPE);   \
-   chan-QHDRFLD.oSignalBase = (UINTN)(chan-QDATAFLD)-\
-   (UINTN)(chan-QHDRFLD);\
+   chan-QHDRFLD.oSignalBase = (u64)(chan-QDATAFLD)-  \
+   (u64)(chan-QHDRFLD);  \
chan-QHDRFLD.MaxSignalSlots =  \
sizeof(chan-QDATAFLD)/sizeof(QDATATYPE);   \
chan-QHDRFLD.MaxSignals = chan-QHDRFLD.MaxSignalSlots-1; \
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index b569c34..7fdf207 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -25,12 +25,6 @@
 #include linux/io.h
 #include linux/uuid.h
 
-#ifdef CONFIG_X86_32
-#define UINTN u32
-#else
-#define UINTN u64
-#endif
-
 typedef u64 GUEST_PHYSICAL_ADDRESS;
 
 #define MEMSET(ptr, val, len) memset(ptr, val, len)
-- 
1.9.1

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


[PATCH 11/12] staging: unisys: remove MEMSET define

2014-07-31 Thread Benjamin Romer
Remove the redundant MEMSET define in commontypes.h and fix everyplace that
uses it.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/common-spar/include/channels/channel.h   | 2 +-
 drivers/staging/unisys/common-spar/include/channels/iochannel.h | 6 +++---
 drivers/staging/unisys/include/commontypes.h| 1 -
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index c1ba1de..7c85e43 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -290,7 +290,7 @@ typedef struct _SIGNAL_QUEUE_HEADER {
 
 #define SignalInit(chan, QHDRFLD, QDATAFLD, QDATATYPE, ver, typ)   \
do {\
-   MEMSET(chan-QHDRFLD, 0, sizeof(chan-QHDRFLD));   \
+   memset(chan-QHDRFLD, 0, sizeof(chan-QHDRFLD));   \
chan-QHDRFLD.VersionId = ver;  \
chan-QHDRFLD.Type = typ;   \
chan-QHDRFLD.Size = sizeof(chan-QDATAFLD);\
diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h 
b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index 9f2e1e1..24e1185 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -376,7 +376,7 @@ struct uiscmdrsp_scsi {
 
 #define SET_NO_DISK_INQUIRY_RESULT(buf, len, lun, lun0notpresent, notpresent) \
do {\
-   MEMSET(buf, 0,  \
+   memset(buf, 0,  \
   MINNUM(len,  \
  (unsigned int) NO_DISK_INQUIRY_RESULT_LEN)); \
buf[2] = (u8) SCSI_SPC2_VER;\
@@ -802,7 +802,7 @@ static inline int 
ULTRA_VHBA_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
  struct vhba_config_max *max,
  unsigned char *clientStr,
  u32 clientStrLen, u64 bytes)  {
-   MEMSET(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL));
+   memset(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL));
x-ChannelHeader.VersionId = ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID;
x-ChannelHeader.Signature = ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE;
x-ChannelHeader.SrvState = CHANNELSRV_UNINITIALIZED;
@@ -838,7 +838,7 @@ static inline int 
ULTRA_VNIC_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
 unsigned char *clientStr,
 u32 clientStrLen,
 u64 bytes)  {
-   MEMSET(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL));
+   memset(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL));
x-ChannelHeader.VersionId = ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID;
x-ChannelHeader.Signature = ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE;
x-ChannelHeader.SrvState = CHANNELSRV_UNINITIALIZED;
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 7fdf207..3540976 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -27,7 +27,6 @@
 
 typedef u64 GUEST_PHYSICAL_ADDRESS;
 
-#define MEMSET(ptr, val, len) memset(ptr, val, len)
 #define MEMCMP_IO(m1, m2, len) memcmp((void __force *)m1, m2, len)
 
 #define INLINE inline
-- 
1.9.1

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


[PATCH 12/12] staging: unisys: remove MEMCMP_IO

2014-07-31 Thread Benjamin Romer
This patch removes MEMCMP_IO from commontypes.h and fixes the one use of the
macro so it calls uuid_cmp_le() instead. The old code was comparing UUIDs
directly.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/common-spar/include/channels/channel.h | 4 ++--
 drivers/staging/unisys/include/commontypes.h  | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 7c85e43..15a8d6b 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -318,8 +318,8 @@ ULTRA_check_channel_client(void __iomem *pChannel,
 {
if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0)
/* caller wants us to verify type GUID */
-   if (MEMCMP_IOCHANNEL_HEADER __iomem *) (pChannel))-Type),
-  expectedTypeGuid, sizeof(uuid_le)) != 0) {
+   if (uuid_le_cmpCHANNEL_HEADER __iomem *)(pChannel))-Type),
+  expectedTypeGuid) != 0) {
CHANNEL_GUID_MISMATCH(expectedTypeGuid, channelName,
  type, expectedTypeGuid,
  ((CHANNEL_HEADER __iomem *)
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 3540976..4311e9f 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -27,8 +27,6 @@
 
 typedef u64 GUEST_PHYSICAL_ADDRESS;
 
-#define MEMCMP_IO(m1, m2, len) memcmp((void __force *)m1, m2, len)
-
 #define INLINE inline
 #define OFFSETOF offsetof
 
-- 
1.9.1

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


[PATCH 07/12] staging: unisys: remove S64 type

2014-07-31 Thread Benjamin Romer
This patch switches all use of the S64 typedef to use the kernel's s64 type
instead.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/include/commontypes.h | 2 --
 drivers/staging/unisys/include/uisutils.h| 4 ++--
 drivers/staging/unisys/visorchipset/file.c   | 4 ++--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 4e89cdf..fee1b21 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -30,8 +30,6 @@
 #include syslog.h
 #endif
 
-#define S64 int64_t
-
 #ifdef __KERNEL__
 
 #ifdef CONFIG_X86_32
diff --git a/drivers/staging/unisys/include/uisutils.h 
b/drivers/staging/unisys/include/uisutils.h
index 26b6937..a1c193c 100644
--- a/drivers/staging/unisys/include/uisutils.h
+++ b/drivers/staging/unisys/include/uisutils.h
@@ -262,7 +262,7 @@ Issue_VMCALL_IO_VISORSERIAL_ADDR(u64 *DiagChannelAddress)
return result;
 }
 
-static inline S64 Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET(void)
+static inline s64 Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET(void)
 {
u64 result = VMCALL_SUCCESS;
u64 physaddr = 0;
@@ -272,7 +272,7 @@ static inline S64 
Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET(void)
return result;
 }
 
-static inline S64 Issue_VMCALL_MEASUREMENT_DO_NOTHING(void)
+static inline s64 Issue_VMCALL_MEASUREMENT_DO_NOTHING(void)
 {
u64 result = VMCALL_SUCCESS;
u64 physaddr = 0;
diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index fccc4f0..bf2e546 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -190,8 +190,8 @@ visorchipset_ioctl(struct inode *inode, struct file *file,
 #endif
 {
int rc = SUCCESS;
-   S64 adjustment;
-   S64 vrtc_offset;
+   s64 adjustment;
+   s64 vrtc_offset;
DBGINF(entered visorchipset_ioctl, cmd=%d, cmd);
switch (cmd) {
case VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET:
-- 
1.9.1

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


[PATCH 04/12] staging: unisys: remove S8 type

2014-07-31 Thread Benjamin Romer
Delete the S8 type from commontypes.h since it wasn't being used.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/include/commontypes.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 2369099..15429f8 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -30,7 +30,6 @@
 #include syslog.h
 #endif
 
-#define S8  int8_t
 #define S16 int16_t
 #define S32 int32_t
 #define S64 int64_t
-- 
1.9.1

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


[PATCH 09/12] staging: unisys: remove unused defines from commontypes.h

2014-07-31 Thread Benjamin Romer
Delete #defines that aren't used anywhere.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/include/commontypes.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 2aac0dd..b569c34 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -34,10 +34,7 @@
 typedef u64 GUEST_PHYSICAL_ADDRESS;
 
 #define MEMSET(ptr, val, len) memset(ptr, val, len)
-#define MEMCMP(m1, m2, len) memcmp(m1, m2, len)
 #define MEMCMP_IO(m1, m2, len) memcmp((void __force *)m1, m2, len)
-#define STRLEN(s) ((UINTN)strlen((const char *)s))
-#define STRCPY(d, s) (strcpy((char *)d, (const char *)s))
 
 #define INLINE inline
 #define OFFSETOF offsetof
-- 
1.9.1

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


[PATCH 02/12] staging: unisys: remove U32 type

2014-07-31 Thread Benjamin Romer
This patch switches all use of the U32 typedef to use the kernel's u32 type
instead.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/channels/channel.c  |   8 +-
 drivers/staging/unisys/channels/chanstub.c |   4 +-
 drivers/staging/unisys/channels/chanstub.h |   4 +-
 .../unisys/common-spar/include/channels/channel.h  |  52 +++
 .../include/channels/controlframework.h|   2 +-
 .../include/channels/controlvmchannel.h| 158 ++---
 .../common-spar/include/channels/diagchannel.h |  20 +--
 .../common-spar/include/channels/iochannel.h   |  58 
 .../common-spar/include/channels/vbuschannel.h |  12 +-
 .../unisys/common-spar/include/vmcallinterface.h   |   6 +-
 drivers/staging/unisys/include/commontypes.h   |   7 +-
 drivers/staging/unisys/include/uisqueue.h  |  52 +++
 drivers/staging/unisys/include/uisutils.h  |  48 +++
 drivers/staging/unisys/uislib/uislib.c |  56 
 drivers/staging/unisys/uislib/uisutils.c   |   4 +-
 drivers/staging/unisys/virthba/virthba.c   |   6 +-
 drivers/staging/unisys/virtpci/virtpci.h   |   4 +-
 drivers/staging/unisys/visorchannel/visorchannel.h |  10 +-
 .../unisys/visorchannel/visorchannel_funcs.c   |  30 ++--
 drivers/staging/unisys/visorchipset/parser.c   |   6 +-
 drivers/staging/unisys/visorchipset/parser.h   |   4 +-
 drivers/staging/unisys/visorchipset/visorchipset.h |  50 +++
 .../unisys/visorchipset/visorchipset_main.c|  30 ++--
 23 files changed, 315 insertions(+), 316 deletions(-)

diff --git a/drivers/staging/unisys/channels/channel.c 
b/drivers/staging/unisys/channels/channel.c
index 7223a14..b9bf8e8 100644
--- a/drivers/staging/unisys/channels/channel.c
+++ b/drivers/staging/unisys/channels/channel.c
@@ -44,7 +44,7 @@
  * 1 if the insertion succeeds, 0 if the queue was full.
  */
 unsigned char
-visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, U32 Queue, void *pSignal)
+visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal)
 {
void __iomem *psignal;
unsigned int head, tail, nof;
@@ -102,7 +102,7 @@ EXPORT_SYMBOL_GPL(visor_signal_insert);
  * 1 if the removal succeeds, 0 if the queue was empty.
  */
 unsigned char
-visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, U32 Queue, void *pSignal)
+visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal)
 {
void __iomem *psource;
unsigned int head, tail;
@@ -157,7 +157,7 @@ EXPORT_SYMBOL_GPL(visor_signal_remove);
  * # of signals copied.
  */
 unsigned int
-SignalRemoveAll(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
+SignalRemoveAll(pCHANNEL_HEADER pChannel, u32 Queue, void *pSignal)
 {
void *psource;
unsigned int head, tail, signalCount = 0;
@@ -208,7 +208,7 @@ SignalRemoveAll(pCHANNEL_HEADER pChannel, U32 Queue, void 
*pSignal)
  * 1 if the signal queue is empty, 0 otherwise.
  */
 unsigned char
-visor_signalqueue_empty(CHANNEL_HEADER __iomem *pChannel, U32 Queue)
+visor_signalqueue_empty(CHANNEL_HEADER __iomem *pChannel, u32 Queue)
 {
SIGNAL_QUEUE_HEADER __iomem *pqhdr =
(SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel +
diff --git a/drivers/staging/unisys/channels/chanstub.c 
b/drivers/staging/unisys/channels/chanstub.c
index 1e7d6a7..7f36d9a 100644
--- a/drivers/staging/unisys/channels/chanstub.c
+++ b/drivers/staging/unisys/channels/chanstub.c
@@ -42,7 +42,7 @@ channel_mod_exit(void)
 }
 
 unsigned char
-SignalInsert_withLock(CHANNEL_HEADER __iomem *pChannel, U32 Queue,
+SignalInsert_withLock(CHANNEL_HEADER __iomem *pChannel, u32 Queue,
  void *pSignal, spinlock_t *lock)
 {
unsigned char result;
@@ -54,7 +54,7 @@ SignalInsert_withLock(CHANNEL_HEADER __iomem *pChannel, U32 
Queue,
 }
 
 unsigned char
-SignalRemove_withLock(CHANNEL_HEADER __iomem *pChannel, U32 Queue,
+SignalRemove_withLock(CHANNEL_HEADER __iomem *pChannel, u32 Queue,
  void *pSignal, spinlock_t *lock)
 {
unsigned char result;
diff --git a/drivers/staging/unisys/channels/chanstub.h 
b/drivers/staging/unisys/channels/chanstub.h
index bdee5d5..d08e2c6 100644
--- a/drivers/staging/unisys/channels/chanstub.h
+++ b/drivers/staging/unisys/channels/chanstub.h
@@ -15,9 +15,9 @@
 
 #ifndef __CHANSTUB_H__
 #define __CHANSTUB_H__
-unsigned char SignalInsert_withLock(CHANNEL_HEADER __iomem *pChannel, U32 
Queue,
+unsigned char SignalInsert_withLock(CHANNEL_HEADER __iomem *pChannel, u32 
Queue,
 void *pSignal, spinlock_t *lock);
-unsigned char SignalRemove_withLock(CHANNEL_HEADER __iomem *pChannel, U32 
Queue,
+unsigned char SignalRemove_withLock(CHANNEL_HEADER __iomem *pChannel, u32 
Queue,
 void *pSignal, spinlock_t *lock);
 
 #endif
diff --git 

RE: [PATCH] staging: comedi: ii_pci20kc: request and ioremap memory

2014-07-31 Thread Hartley Sweeten
On Thursday, July 31, 2014 7:57 AM, Ian Abbott wrote:
 The ii_pci20kc module is a comedi driver for Intelligent Instruments
 PCI-20001C carrier board and modules.  Despite the name, this is
 actually an ISA board and uses 1K of ISA memory space (below 1M) for the
 main board plus up to three modules.  The address is set by hardware
 jumpers.

 When the board is attached to Comedi via the `COMEDI_DEVCONFIG` ioctl
 and the driver's legacy attach handler, the base address is passed in.
 The driver currently uses that address as-is, which is a bad idea.  It
 doesn't even reserve the memory region.

 Fix that by sanity checking the passed in address, reserving the memory
 region and ioremapping it.

 Replace the current detach handler `comedi_legacy_detach()` with a new
 handler `ii20k_detach()` which unmaps the memory and releases the
 region.

 Signed-off-by: Ian Abbott abbo...@mev.co.uk
 ---
  drivers/staging/comedi/drivers/ii_pci20kc.c | 32 
 ++---
  1 file changed, 29 insertions(+), 3 deletions(-)

Thanks for fixing this!

Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com

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


RE: [patch] staging: comedi: ni_tio: remove some dead code

2014-07-31 Thread Hartley Sweeten
On Thursday, July 31, 2014 2:29 AM, Dan Carpenter wrote:
 These conditions can never be true because i is always one more than
 NI_660X_MAX_RTSI_CHAN after the loop.

 Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com

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


[PATCH] staging: wlan-ng: fixing coding style problems

2014-07-31 Thread Modestas Stankus
WARNING: Unnecessary space before function pointer arguments
+   int (*func) (struct mibrec *mib,

WARNING: Missing a blank line after declarations
+   hfa384x_WPAData_t wpa;
+   if (isget) {

Signed-off-by: Modestas Stankus stankus.modes...@gmail.com
---
 drivers/staging/wlan-ng/prism2mib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/prism2mib.c 
b/drivers/staging/wlan-ng/prism2mib.c
index bdd3b4c..f471708 100644
--- a/drivers/staging/wlan-ng/prism2mib.c
+++ b/drivers/staging/wlan-ng/prism2mib.c
@@ -85,7 +85,7 @@ struct mibrec {
u16 parm1;
u16 parm2;
u16 parm3;
-   int (*func) (struct mibrec *mib,
+   int (*func)(struct mibrec *mib,
 int isget,
 wlandevice_t *wlandev,
 hfa384x_t *hw,
@@ -722,6 +722,7 @@ static int prism2mib_priv(struct mibrec *mib,
switch (mib-did) {
case DIDmib_lnx_lnxConfigTable_lnxRSNAIE:{
hfa384x_WPAData_t wpa;
+
if (isget) {
hfa384x_drvr_getconfig(hw,
   HFA384x_RID_CNFWPADATA,
-- 
2.0.3

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


[PATCH] staging: wlan-ng: coding style problem fix

2014-07-31 Thread Modestas Stankus
WARNING: break is not useful after a goto or return
201: FILE: drivers/staging/wlan-ng/p80211conv.c:201:
+   return 1;
+   break;

Signed-off-by: Modestas Stankus stankus.modes...@gmail.com
---
 drivers/staging/wlan-ng/p80211conv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index 913676e..3b5468c 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -198,7 +198,6 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
netdev_err(wlandev-netdev,
   Error: Converting eth to wlan in unknown mode.\n);
return 1;
-   break;
}
 
p80211_wep-data = NULL;
-- 
2.0.3

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


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-31 Thread Chris Metcalf

On 7/17/2014 5:05 PM, Arnd Bergmann wrote:

On Thursday 17 July 2014 16:41:14 Chris Metcalf wrote:

On 7/17/2014 7:28 AM, Chen Gang wrote:

According to current source code, tile still has chance to choose
NO_IOMEM, for me, welcome the tile's maintainer's ideas or suggestions.

I'm not really sure.  It's true that on tile, if you don't enable PCI
support there's no other I/O memory (or I/O port) space you can use.
We pretty much always enable PCI support in our kernel, though.  I'm
kind of surprised that other architectures don't also have the model
that IOMEM requires PCI, but perhaps most architectures just don't
encode that in the Kconfig file?

Only s390 as far as I know. Most architectures have integrated
peripherals that use MMIO without PCI.


Yes, and tilegx has these too (quite a few of them).  The memory-mapped
devices are accessed by specifying a shim x,y coordinate in the high bits
of the physical address, in conjunction with an MMIO type in the TLB entry.
Various tilegx drivers set up these kinds of mappings in the page table.

The issue with ioremap() is that it takes a generic resource_size_t
physical address, and we don't have any general-purpose layer that maps
particular PAs to shim coordinates, other than for TRIO (our PCI peripheral).
Right now we just check the PCI root complexes that we have configured in
the kernel, and if the pseudo physical address requested is in a range that
we're associating with one of the root complexes, we will use the appropriate
mapping against the appropriate TRIO shim to set up its x,y coordinate in
the page table.

So it makes some kind of sense to condition HAS_IOMEM on PCI, even though
naively it seems like it shouldn't be strictly related.

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com

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


RE: [PATCH 00/18] staging: comedi: amplc_pci224: remove legacy stuff

2014-07-31 Thread Hartley Sweeten
On Thursday, July 31, 2014 6:48 AM, Ian Abbott wrote:
 The amplc_pci224 driver retains a legacy attach mechanism via the
 `COMEDI_DEVCONFIG` ioctl and the comedi driver attach hook, but
 usually attaches PCI devices automatically via the comedi driver's
 auto_attach hook.  The legacy mechanism is only retained so that
 options can be passed via the ioctl to indicate how some hardware
 jumpers are set on the boards, which is used to set up the range tables.
 That's no use if the PCI device is attached automatically as the range
 tables will be set up according to the factory default jumper positions.

 Change the range tables to include all possible ranges, regardless of
 jumper positions.  Then there is no need to have options to control
 setting up the range tables and the legacy attach mechanism can be
 removed.

 Also, tidy the code up a bit.

Looks good.

Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com

Side note:

Now that the manual attach has been removed, you could also remove
the board information from the comedi_driver declaration.

Regards,
Hartley

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


RE: [PATCH 00/18] staging: comedi: amplc_pci224: remove legacy stuff

2014-07-31 Thread Hartley Sweeten
On Thursday, July 31, 2014 1:28 PM, Hartley Sweeten wrote:
 On Thursday, July 31, 2014 6:48 AM, Ian Abbott wrote:
 The amplc_pci224 driver retains a legacy attach mechanism via the
 `COMEDI_DEVCONFIG` ioctl and the comedi driver attach hook, but
 usually attaches PCI devices automatically via the comedi driver's
 auto_attach hook.  The legacy mechanism is only retained so that
 options can be passed via the ioctl to indicate how some hardware
 jumpers are set on the boards, which is used to set up the range tables.
 That's no use if the PCI device is attached automatically as the range
 tables will be set up according to the factory default jumper positions.

 Change the range tables to include all possible ranges, regardless of
 jumper positions.  Then there is no need to have options to control
 setting up the range tables and the legacy attach mechanism can be
 removed.

 Also, tidy the code up a bit.

 Looks good.

 Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com

 Side note:

 Now that the manual attach has been removed, you could also remove
 the board information from the comedi_driver declaration.

Oops.. Just did a sparse build and get this:

drivers/staging/comedi/drivers/amplc_pci224.c:355:24: warning: obsolete array 
initializer, use C99 syntax
drivers/staging/comedi/drivers/amplc_pci224.c:363:24: warning: obsolete array 
initializer, use C99 syntax

The following patch fixes it, or you fold it into patch 15.

Regards,
Hartley

---

From: H Hartley Sweeten hswee...@visionengravers.com
Date: Wed, 30 Jul 2014 10:50:11 -0700
Subject: [PATCH] staging: comedi: amplc_pci224: fix obsolete array initializer

Fix the sparse warnings:
warning: obsolete array initializer, use C99 syntax

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index 21f06bb..2170e5e 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -352,7 +352,7 @@ struct pci224_board {
 };
 
 static const struct pci224_board pci224_boards[] = {
-   [pci224_model] {
+   [pci224_model] = {
.name   = pci224,
.ao_chans   = 16,
.ao_bits= 12,
@@ -360,7 +360,7 @@ static const struct pci224_board pci224_boards[] = {
.ao_hwrange = hwrange_pci224[0],
.ao_range_check = range_check_pci224[0],
},
-   [pci234_model] {
+   [pci234_model] = {
.name   = pci234,
.ao_chans   = 4,
.ao_bits= 16,
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: rlt8192u: mark some functions as static

2014-07-31 Thread Antoine Schweitzer-Chaput
Some functions defined in r8192U_core.c and only used locally are marked as 
static.
This fixes some warnings issues by sparse.

Signed-off-by: Antoine Schweitzer-Chaput anto...@schweitzer-chaput.fr
---
 drivers/staging/rtl8192u/r8192U_core.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 7640386..4536a87 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
int i;
for (i = 0; i  63; i++)
@@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate)
return N_DBPS;
 }
 
-unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue)
+static unsigned int txqueue2outpipe(struct r8192_priv *priv,
+   unsigned int tx_queue)
 {
if (tx_queue = 9) {
RT_TRACE(COMP_ERR, %s():Unknown queue ID!!!\n, __func__);
@@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
-u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats  *Status, bool 
bIsRxAggrSubframe)
+static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats *Status,
+   bool bIsRxAggrSubframe)
 {
 #ifdef USB_RX_AGGREGATION_SUPPORT
if (bIsRxAggrSubframe)
-- 
1.9.1

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


[PATCH 2/2] staging: rlt8192u: conditional compilation in r8192U_core.c

2014-07-31 Thread Antoine Schweitzer-Chaput
function dump_eprom is only used when DEBUG_EPROM is set.
function txqueue2outpipe is only used when USE_ONE_PIPE is unset.
function GetRxPacketShiftBytes819xUsb is only used when 
USB_RX_AGGREGATION_SUPPORT is set.
Compile these functions only when they will actually be used.

Signed-off-by: Antoine Schweitzer-Chaput anto...@schweitzer-chaput.fr
---
 drivers/staging/rtl8192u/r8192U_core.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 4536a87..b6718c0 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -667,12 +667,14 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
+#ifdef DEBUG_EPROM
 static void dump_eprom(struct net_device *dev)
 {
int i;
for (i = 0; i  63; i++)
RT_TRACE(COMP_EPROM, EEPROM addr %x : %x, i, eprom_read(dev, 
i));
 }
+#endif
 
 void rtl8192_update_msr(struct net_device *dev)
 {
@@ -1553,6 +1555,7 @@ u16 N_DBPSOfRate(u16 DataRate)
return N_DBPS;
 }
 
+#ifndef USE_ONE_PIPE
 static unsigned int txqueue2outpipe(struct r8192_priv *priv,
unsigned int tx_queue)
 {
@@ -1562,6 +1565,7 @@ static unsigned int txqueue2outpipe(struct r8192_priv 
*priv,
}
return priv-txqueue_to_outpipemap[tx_queue];
 }
+#endif
 
 short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb)
 {
@@ -4874,18 +4878,18 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 }
 
+#ifdef USB_RX_AGGREGATION_SUPPORT
 static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats *Status,
bool bIsRxAggrSubframe)
 {
-#ifdef USB_RX_AGGREGATION_SUPPORT
if (bIsRxAggrSubframe)
return (sizeof(rx_desc_819x_usb) + Status-RxDrvInfoSize
+ Status-RxBufShift + 8);
else
-#endif
return (sizeof(rx_desc_819x_usb) + Status-RxDrvInfoSize
+ Status-RxBufShift);
 }
+#endif
 
 static void rtl8192_rx_nomal(struct sk_buff *skb)
 {
-- 
1.9.1

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


Re: [PATCH 1/1] staging: rtl8192u: mark some functions as static.

2014-07-31 Thread Antoine Schweitzer-Chaput
On Wed, Jul 30, 2014 at 05:06:41PM -0700, Greg Kroah-Hartman wrote:
 On Mon, Jul 28, 2014 at 05:52:46PM +0200, Antoine Schweitzer-Chaput wrote:
  Some functions defined in r8192U_core.c and only used locally are marked as 
  static.
  This fixes some warnings issued by sparse.
  
  Signed-off-by: Antoine Schweitzer-Chaput anto...@schweitzer-chaput.fr
 
 And it creates new warnings with gcc, which isn't acceptable :(

It does, but this warning's root cause was already present: these
functions are only called under specific compilation options but always
compiled.
This patch basically unhides this issue.

Since these are two different things I was reluctant to tackle both in
the same patch.

 Please fix these properly, I can't take patches that add warnings to the
 build.

I'll resend now, with an additional patch making sure these functions
are compiled only when they are used.

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


Re: [PATCH] Staging: android: sync.c: fix missing blank line after declaration

2014-07-31 Thread Greg KH
On Thu, Jul 31, 2014 at 08:47:07AM -0300, Murilo Opsfelder Araujo wrote:
 On 07/30/2014 09:17 PM, Greg KH wrote:
 Also doesn't apply, are you sure you are using the staging-next branch
 of staging.git on git.kernel.org?
 
 I was using linux-next, not staging-next.  sync.c has no checkpatch.pl
 warnings in staging-next.
 
 Sorry for the false alarm, guys.

Ah, this is the fun thing where that code is being changed in two
different trees.  This sometimes happens, sorry about that.  Wait for
3.17-rc1 to be out before touching this code again, as that will have
everything merged properly in one tree.

Sorry for the confusion.

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


[PATCH 1/8] staging: iio: accel: adis16203_core.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank line after declarations.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/adis16203_core.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/iio/accel/adis16203_core.c 
b/drivers/staging/iio/accel/adis16203_core.c
index f472137..fbbe93f 100644
--- a/drivers/staging/iio/accel/adis16203_core.c
+++ b/drivers/staging/iio/accel/adis16203_core.c
@@ -37,6 +37,7 @@ static int adis16203_write_raw(struct iio_dev *indio_dev,
struct adis *st = iio_priv(indio_dev);
/* currently only one writable parameter which keeps this simple */
u8 addr = adis16203_addresses[chan-scan_index];
+
return adis_write_reg_16(st, addr, val  0x3FFF);
 }
 
@@ -50,6 +51,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
int bits;
u8 addr;
s16 val16;
+
switch (mask) {
case IIO_CHAN_INFO_RAW:
return adis_single_conversion(indio_dev, chan,
-- 
1.7.10.4

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


[PATCH 4/8] staging: iio: accel: adis16209_core.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank line after declaration.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/adis16209_core.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/accel/adis16209_core.c 
b/drivers/staging/iio/accel/adis16209_core.c
index 374dc6e..b2c7aed 100644
--- a/drivers/staging/iio/accel/adis16209_core.c
+++ b/drivers/staging/iio/accel/adis16209_core.c
@@ -44,6 +44,7 @@ static int adis16209_write_raw(struct iio_dev *indio_dev,
int bits;
s16 val16;
u8 addr;
+
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
switch (chan-type) {
-- 
1.7.10.4

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


[PATCH 0/8] staging: iio: accel: multiple coding style fixes

2014-07-31 Thread Murilo Opsfelder Araujo
The following patches fix (almost) all warnings reported by
checkpatch.pl.

Murilo Opsfelder Araujo (8):
  staging: iio: accel: adis16203_core.c: fix coding style
  staging: iio: accel: adis16201_core.c: fix coding style
  staging: iio: accel: adis16204_core.c: fix coding style
  staging: iio: accel: adis16209_core.c: fix coding style
  staging: iio: accel: adis16240_core.c: fix coding style
  staging: iio: accel: lis3l02dq_core.c: fix coding style
  staging: iio: accel: lis3l02dq_ring.c: fix coding style
  staging: iio: accel: sca3000_core.c: fix coding style

 drivers/staging/iio/accel/adis16201_core.c |5 +++--
 drivers/staging/iio/accel/adis16203_core.c |2 ++
 drivers/staging/iio/accel/adis16204_core.c |1 +
 drivers/staging/iio/accel/adis16209_core.c |1 +
 drivers/staging/iio/accel/adis16240_core.c |1 +
 drivers/staging/iio/accel/lis3l02dq_core.c |4 
 drivers/staging/iio/accel/lis3l02dq_ring.c |1 +
 drivers/staging/iio/accel/sca3000_core.c   |4 +++-
 8 files changed, 16 insertions(+), 3 deletions(-)

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


[PATCH 3/8] staging: iio: accel: adis16204_core.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank line after declaration.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/adis16204_core.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/accel/adis16204_core.c 
b/drivers/staging/iio/accel/adis16204_core.c
index 19eaebc..4c8acbc 100644
--- a/drivers/staging/iio/accel/adis16204_core.c
+++ b/drivers/staging/iio/accel/adis16204_core.c
@@ -119,6 +119,7 @@ static int adis16204_write_raw(struct iio_dev *indio_dev,
int bits;
s16 val16;
u8 addr;
+
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
switch (chan-type) {
-- 
1.7.10.4

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


[PATCH 2/8] staging: iio: accel: adis16201_core.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank line after declaration and fixes lines
starting by space.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/adis16201_core.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16201_core.c 
b/drivers/staging/iio/accel/adis16201_core.c
index 50ba1fa..7eae5fd 100644
--- a/drivers/staging/iio/accel/adis16201_core.c
+++ b/drivers/staging/iio/accel/adis16201_core.c
@@ -111,6 +111,7 @@ static int adis16201_write_raw(struct iio_dev *indio_dev,
int bits;
s16 val16;
u8 addr;
+
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
switch (chan-type) {
@@ -131,8 +132,8 @@ static int adis16201_write_raw(struct iio_dev *indio_dev,
 }
 
 static const struct iio_chan_spec adis16201_channels[] = {
-  ADIS_SUPPLY_CHAN(ADIS16201_SUPPLY_OUT, ADIS16201_SCAN_SUPPLY, 0, 12),
-  ADIS_TEMP_CHAN(ADIS16201_TEMP_OUT, ADIS16201_SCAN_TEMP, 0, 12),
+   ADIS_SUPPLY_CHAN(ADIS16201_SUPPLY_OUT, ADIS16201_SCAN_SUPPLY, 0, 12),
+   ADIS_TEMP_CHAN(ADIS16201_TEMP_OUT, ADIS16201_SCAN_TEMP, 0, 12),
ADIS_ACCEL_CHAN(X, ADIS16201_XACCL_OUT, ADIS16201_SCAN_ACC_X,
BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14),
ADIS_ACCEL_CHAN(Y, ADIS16201_YACCL_OUT, ADIS16201_SCAN_ACC_Y,
-- 
1.7.10.4

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


[PATCH 8/8] staging: iio: accel: sca3000_core.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank line after declaration and keep line in
80-chars limit.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/sca3000_core.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/accel/sca3000_core.c 
b/drivers/staging/iio/accel/sca3000_core.c
index ed30e32..1ff299f 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -506,7 +506,8 @@ static int sca3000_read_raw(struct iio_dev *indio_dev,
mutex_unlock(st-lock);
return ret;
}
-   *val = ((st-rx[0]  0x3F)  3) | ((st-rx[1]  0xE0) 
 5);
+   *val = ((st-rx[0]  0x3F)  3)
+   | ((st-rx[1]  0xE0)  5);
}
mutex_unlock(st-lock);
return IIO_VAL_INT;
@@ -713,6 +714,7 @@ static int sca3000_read_thresh(struct iio_dev *indio_dev,
int ret, i;
struct sca3000_state *st = iio_priv(indio_dev);
int num = chan-channel2;
+
mutex_lock(st-lock);
ret = sca3000_read_ctrl_reg(st, sca3000_addresses[num][1]);
mutex_unlock(st-lock);
-- 
1.7.10.4

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


[PATCH 6/8] staging: iio: accel: lis3l02dq_core.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank line after declarations.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/lis3l02dq_core.c |4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c 
b/drivers/staging/iio/accel/lis3l02dq_core.c
index 898653c..f5e145c 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -212,6 +212,7 @@ static int lis3l02dq_write_thresh(struct iio_dev *indio_dev,
  int val, int val2)
 {
u16 value = val;
+
return lis3l02dq_spi_write_reg_s16(indio_dev,
   LIS3L02DQ_REG_THS_L_ADDR,
   value);
@@ -226,6 +227,7 @@ static int lis3l02dq_write_raw(struct iio_dev *indio_dev,
int ret = -EINVAL, reg;
u8 uval;
s8 sval;
+
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
if (val  255 || val  -256)
@@ -302,6 +304,7 @@ static ssize_t lis3l02dq_read_frequency(struct device *dev,
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
int ret, len = 0;
s8 t;
+
ret = lis3l02dq_spi_read_reg_8(indio_dev,
   LIS3L02DQ_REG_CTRL_1_ADDR,
   (u8 *)t);
@@ -565,6 +568,7 @@ static int lis3l02dq_read_event_config(struct iio_dev 
*indio_dev,
u8 val;
int ret;
u8 mask = (1  (chan-channel2*2 + (dir == IIO_EV_DIR_RISING)));
+
ret = lis3l02dq_spi_read_reg_8(indio_dev,
   LIS3L02DQ_REG_WAKE_UP_CFG_ADDR,
   val);
-- 
1.7.10.4

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


[PATCH 7/8] staging: iio: accel: lis3l02dq_ring.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank lines after declarations.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/lis3l02dq_ring.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c 
b/drivers/staging/iio/accel/lis3l02dq_ring.c
index bf33fde..1d934ee 100644
--- a/drivers/staging/iio/accel/lis3l02dq_ring.c
+++ b/drivers/staging/iio/accel/lis3l02dq_ring.c
@@ -19,6 +19,7 @@ static inline u16 combine_8_to_16(u8 lower, u8 upper)
 {
u16 _lower = lower;
u16 _upper = upper;
+
return _lower | (_upper  8);
 }
 
-- 
1.7.10.4

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


[PATCH 5/8] staging: iio: accel: adis16240_core.c: fix coding style

2014-07-31 Thread Murilo Opsfelder Araujo
This patch adds missing blank line after declaration.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/iio/accel/adis16240_core.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/accel/adis16240_core.c 
b/drivers/staging/iio/accel/adis16240_core.c
index 74ace2a..205d6d0 100644
--- a/drivers/staging/iio/accel/adis16240_core.c
+++ b/drivers/staging/iio/accel/adis16240_core.c
@@ -163,6 +163,7 @@ static int adis16240_write_raw(struct iio_dev *indio_dev,
int bits = 10;
s16 val16;
u8 addr;
+
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
val16 = val  ((1  bits) - 1);
-- 
1.7.10.4

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


Re: [PATCH 0/8] staging: iio: accel: multiple coding style fixes

2014-07-31 Thread Joe Perches
On Thu, 2014-07-31 at 19:34 -0300, Murilo Opsfelder Araujo wrote:
 The following patches fix (almost) all warnings reported by
 checkpatch.pl.
 
 Murilo Opsfelder Araujo (8):
   staging: iio: accel: adis16203_core.c: fix coding style
   staging: iio: accel: adis16201_core.c: fix coding style
   staging: iio: accel: adis16204_core.c: fix coding style
   staging: iio: accel: adis16209_core.c: fix coding style
   staging: iio: accel: adis16240_core.c: fix coding style
   staging: iio: accel: lis3l02dq_core.c: fix coding style
   staging: iio: accel: lis3l02dq_ring.c: fix coding style
   staging: iio: accel: sca3000_core.c: fix coding style

Hi.

Next time it might be better to use patch subjects like

staging: subsystem Add blank lines between declarations and code

because fix coding style really isn't very descriptive.

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


Re: [PATCH V2] staging: dgap: introduce dgap_cleanup_nodes()

2014-07-31 Thread DaeSeok Youn
Hi, Mark

2014-07-31 21:44 GMT+09:00 Mark Hounschell ma...@compro.net:
 On 07/31/2014 12:02 AM, Daeseok Youn wrote:

 When a configration file is parsed with dgap_parsefile(),
 makes nodes for saving configrations for board.

 Making a node will allocate node memory and strings for saving
 configrations with kstrdup().

 So these are freed when dgap is unloaded or failed to initialize.

 Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
 ---
 V2: Do not need to free for NULLNODE.

 I have been too busy to solve this issue, sorry for late.

 Mark, Can you test this patch? I try to make simple module which is
 testing dgap_parsefile() and dgap_cleanup_nodes().


 I'll be happy to, but I can't do it until Monday. I'm not where the hardware
 is until then.
That's OK. :-)

Thanks.
Daeseok Youn.

 Regards
 Mark

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


[PATCH 0/2] staging: comedi: addi_apci_1564: provide interface to read diagnostic status

2014-07-31 Thread Chase Southwood
This patchset creates a simple subdevice to allow for reading of the
board's diagnostic status, and then removes any code which is related to
diagnostic interrupts, as the driver will not support these at this time.

Chase Southwood (2):
  staging: comedi: addi_apci_1564: add subdevice to check diagnostic
status
  staging: comedi: addi_apci_1564: remove diagnostic interrupt support
code

 .../comedi/drivers/addi-data/hwdrv_apci1564.c  | 14 
 drivers/staging/comedi/drivers/addi_apci_1564.c| 41 --
 2 files changed, 22 insertions(+), 33 deletions(-)

-- 
2.0.3

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


[PATCH 1/2] staging: comedi: addi_apci_1564: add subdevice to check diagnostic status

2014-07-31 Thread Chase Southwood
This board provides VCC/CC diagnostic information, and it also supports
diagnostic interrupts.  However, as per Ian, these interrupts aren't very
useful and it is enough to simply provide an interface for accessing the
diagnostic status on-demand.  This patch adds a 2-channel digital input
subdevice with an insn_bits handler to access this information.

Signed-off-by: Chase Southwood chase.southw...@gmail.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: H Hartley Sweeten hswee...@visionengravers.com
---
 drivers/staging/comedi/drivers/addi_apci_1564.c | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c 
b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 190b026..819255b 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -157,6 +157,18 @@ static int apci1564_do_insn_bits(struct comedi_device *dev,
return insn-n;
 }
 
+static int apci1564_diag_insn_bits(struct comedi_device *dev,
+  struct comedi_subdevice *s,
+  struct comedi_insn *insn,
+  unsigned int *data)
+{
+   struct apci1564_private *devpriv = dev-private;
+
+   data[1] = inl(devpriv-amcc_iobase + APCI1564_DO_INT_STATUS_REG)  3;
+
+   return insn-n;
+}
+
 /*
  * Change-Of-State (COS) interrupt configuration
  *
@@ -373,7 +385,7 @@ static int apci1564_auto_attach(struct comedi_device *dev,
dev-irq = pcidev-irq;
}
 
-   ret = comedi_alloc_subdevices(dev, 5);
+   ret = comedi_alloc_subdevices(dev, 6);
if (ret)
return ret;
 
@@ -434,6 +446,15 @@ static int apci1564_auto_attach(struct comedi_device *dev,
if (ret)
return ret;
 
+   /* Initialize the diagnostic status subdevice */
+   s = dev-subdevices[5];
+   s-type = COMEDI_SUBD_DI;
+   s-subdev_flags = SDF_READABLE;
+   s-n_chan = 2;
+   s-maxdata = 1;
+   s-range_table = range_digital;
+   s-insn_bits = apci1564_diag_insn_bits;
+
return 0;
 }
 
-- 
2.0.3

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


[PATCH 2/2] staging: comedi: addi_apci_1564: remove diagnostic interrupt support code

2014-07-31 Thread Chase Southwood
As per Ian, at this point in time it is not worth implementing an async
command interface for diagnostic interrupts for this board.  As this is
the case, this patch removes the code which supports such interrupts as it
is now unused.

This includes removing apci1564_do_read(), which was the insn_read
operation for the digital output subdevice, since all it was doing was
reading the current diagnostic interrupt type and returning it in 'data'.
This doesn't follow the comedi API and this operation can be emulated by
the comedi core anyway since the insn_bits operation follows the comedi
API.  So it is safe to simply remove this function.

Signed-off-by: Chase Southwood chase.southw...@gmail.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: H Hartley Sweeten hswee...@visionengravers.com
---
 .../staging/comedi/drivers/addi-data/hwdrv_apci1564.c  | 14 --
 drivers/staging/comedi/drivers/addi_apci_1564.c| 18 --
 2 files changed, 32 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c 
b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
index a1730e9..8a613ae 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
@@ -340,17 +340,3 @@ static int apci1564_timer_read(struct comedi_device *dev,
}
return insn-n;
 }
-
-/*
- * Reads the interrupt status register
- */
-static int apci1564_do_read(struct comedi_device *dev,
-   struct comedi_subdevice *s,
-   struct comedi_insn *insn,
-   unsigned int *data)
-{
-   struct apci1564_private *devpriv = dev-private;
-
-   *data = devpriv-do_int_type;
-   return insn-n;
-}
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c 
b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 819255b..543cb07 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -13,7 +13,6 @@ struct apci1564_private {
unsigned int mode1; /* riding-edge/high level channels */
unsigned int mode2; /* falling-edge/low level channels */
unsigned int ctrl;  /* interrupt mode OR (edge) . AND 
(level) */
-   unsigned int do_int_type;
unsigned char timer_select_mode;
unsigned char mode_select_register;
struct task_struct *tsk_current;
@@ -25,8 +24,6 @@ static int apci1564_reset(struct comedi_device *dev)
 {
struct apci1564_private *devpriv = dev-private;
 
-   devpriv-do_int_type = 0;
-
/* Disable the input interrupts and reset status register */
outl(0x0, devpriv-amcc_iobase + APCI1564_DI_IRQ_REG);
inl(devpriv-amcc_iobase + APCI1564_DI_INT_STATUS_REG);
@@ -83,20 +80,6 @@ static irqreturn_t apci1564_interrupt(int irq, void *d)
outl(status, devpriv-amcc_iobase + APCI1564_DI_IRQ_REG);
}
 
-   status = inl(devpriv-amcc_iobase + APCI1564_DO_IRQ_REG);
-   if (status  0x01) {
-   /* Check for Digital Output interrupt Type */
-   /* 1: VCC interrupt*/
-   /* 2: CC interrupt */
-   devpriv-do_int_type = inl(devpriv-amcc_iobase +
- APCI1564_DO_INT_STATUS_REG)  0x3;
-   /* Disable the  Interrupt */
-   outl(0x0, devpriv-amcc_iobase + APCI1564_DO_INT_CTRL_REG);
-
-   /* Sends signal to user space */
-   send_sig(SIGIO, devpriv-tsk_current, 0);
-   }
-
status = inl(devpriv-amcc_iobase + APCI1564_TIMER_IRQ_REG);
if (status  0x01) {
/*  Disable Timer Interrupt */
@@ -407,7 +390,6 @@ static int apci1564_auto_attach(struct comedi_device *dev,
s-range_table = range_digital;
s-insn_config = apci1564_do_config;
s-insn_bits = apci1564_do_insn_bits;
-   s-insn_read = apci1564_do_read;
 
/* Change-Of-State (COS) interrupt subdevice */
s = dev-subdevices[2];
-- 
2.0.3

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


Re: [PATCH 1/1] Drivers: net-next: hyperv: Increase the size of the sendbuf region

2014-07-31 Thread David Miller
From: K. Y. Srinivasan k...@microsoft.com
Date: Wed, 30 Jul 2014 18:35:49 -0700

 For forwarding scenarios, it will be useful to allocate larger
 sendbuf. Make the necessary adjustments to permit this.
 
 Signed-off-by: K. Y. Srinivasan k...@microsoft.com

This needs more information.

You're increasing the size by 16 times, 1MB -- 16MB, thus less
cache locality.

You're also now using vmalloc() memory, thus more TLB misses and
thrashing.

This must have a negative impact on performance, and you have to
test for that and quantify it when making a change as serious as
this one.

You also haven't gone into detail as to why forwarding scenerios
require more buffer space, than say thousands of local sockets
sending bulk TCP data.

I'm not applying this, it needs a lot more work.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel