Re: [PATCH 0/9] use c99 initializers in structures

2014-08-23 Thread Josh Triplett
On Sat, Aug 23, 2014 at 01:20:22PM +0200, Julia Lawall wrote:
 These patches add labels in the initializations of structure fields (c99
 initializers).  The complete semantic patch thta makes this change is shown
 below.  This rule ignores cases where the initialization is just 0 or NULL,
 where some of the fields already use labels, and where there are nested
 structures.

I responded to patches 6 and 8 with comments; for the rest (1-5, 7, 9):
Reviewed-by: Josh Triplett j...@joshtriplett.org
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-28 Thread Josh Triplett
On Sat, Jun 28, 2014 at 11:07:48AM -0700, Christopher Li wrote:
 On Wed, Jun 11, 2014 at 2:45 PM,  j...@joshtriplett.org wrote:
  On Thu, Jun 12, 2014 at 12:24:25AM +0300, Dan Carpenter wrote:
  Let's forward this to the Sparse mailing list.
 
  We're seeing a Sparse false positive testing
 
 No, this is a valid complain. See my point follows.
 
  drivers/staging/comedi/drivers/ni_pcimio.c.
 
CHECK   drivers/staging/comedi/drivers/ni_pcimio.c
  drivers/staging/comedi/drivers/ni_stc.h:720:26: warning: shift too big 
  (4294967295) for type int
  drivers/staging/comedi/drivers/ni_stc.h:720:26: warning: shift too big 
  (4294967295) for type int
  drivers/staging/comedi/drivers/ni_stc.h:720:26: warning: shift too big 
  (4294967295) for type int
  drivers/staging/comedi/drivers/ni_stc.h:720:26: warning: shift too big 
  (4294967295) for type int
 
  I have created some test code to demonstrate the problem (attached).
 
  The check_shift_count() warning is only supposed to be printed for
  number literals but because of the way inline functions are expanded it
  still complains even though channel is a variable.
 
  Thanks for the test case; this definitely makes no sense.  I don't think
  Sparse will suddenly develop enough range analysis or reachability
  analysis to handle this case; I think the right answer is to avoid
  giving such warnings for shifts with a non-constant RHS.
 
 Sparse can handle inline function expand and some constant
 propagate. In this case, sparse seems doing the right thing.
 Sparse actually sees the channel value being  4294967295 (-1).
 
  static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
 
 This is the bug. See this channel is *unsigned*. When -1 pass into
 channel, it become a really large number 4294967295.
 The code does request C compiler to perform left shift 4294967295 bits.
 Which did not make sense.
 
  {
if (channel  4)
return 1  channel;
return 0;
  }
 
  static inline void filter(int channel)
  {
if (channel  0)
return;
ni_stc_dma_channel_select_bitfield(channel);
 
 See this channel is *signed*, with -1 convert to 4294967295.
 This is a bug in the kernel source not sparse.

Except that filter has an int channel (signed), so it can
successfully test channel  0 and return early; it'll never call
ni_stc_dma_channel_select_bitfield(channel) with a negative number.

I do agree that this code should sort out the signedness of its types,
but in this case I don't think the bad shift can actually happen, making
this a false positive.

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


Re: [PATCH] staging: rtl8188eu: os_dep: usb_intf.c: Fix to remove null pointer checks that could never happen

2014-05-22 Thread Josh Triplett
On Thu, May 22, 2014 at 09:58:02PM +0200, Rickard Strandqvist wrote:
 Removal of null pointer checks that could never happen
 
 Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/rtl8188eu/os_dep/usb_intf.c |  110 
 +--
  1 file changed, 52 insertions(+), 58 deletions(-)
 
 diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
 b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
 index 2e49cd5..3454e1b 100644
 --- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
 +++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
 @@ -396,49 +396,47 @@ int rtw_hw_suspend(struct adapter *padapter)
   goto error_exit;
   }
  
 - if (padapter) { /* system suspend */
 - LeaveAllPowerSaveMode(padapter);
 + /* system suspend */
 + LeaveAllPowerSaveMode(padapter);
  
 - DBG_88E(== rtw_hw_suspend\n);
 - _enter_pwrlock(pwrpriv-lock);
 - pwrpriv-bips_processing = true;
 - /* s1. */
 - if (pnetdev) {
 - netif_carrier_off(pnetdev);
 - rtw_netif_stop_queue(pnetdev);
 - }
 + DBG_88E(== rtw_hw_suspend\n);
 + _enter_pwrlock(pwrpriv-lock);
 + pwrpriv-bips_processing = true;
 + /* s1. */
 + if (pnetdev) {
 + netif_carrier_off(pnetdev);
 + rtw_netif_stop_queue(pnetdev);
 + }
  
 - /* s2. */
 - rtw_disassoc_cmd(padapter, 500, false);
 + /* s2. */
 + rtw_disassoc_cmd(padapter, 500, false);
  
 - /* s2-2.  indicate disconnect to os */
 - {
 - struct  mlme_priv *pmlmepriv = padapter-mlmepriv;
 + /* s2-2.  indicate disconnect to os */
 + {
 + struct  mlme_priv *pmlmepriv = padapter-mlmepriv;
  
 - if (check_fwstate(pmlmepriv, _FW_LINKED)) {
 - _clr_fwstate_(pmlmepriv, _FW_LINKED);
 + if (check_fwstate(pmlmepriv, _FW_LINKED)) {
 + _clr_fwstate_(pmlmepriv, _FW_LINKED);
  
 - rtw_led_control(padapter, LED_CTL_NO_LINK);
 + rtw_led_control(padapter, LED_CTL_NO_LINK);
  
 - rtw_os_indicate_disconnect(padapter);
 + rtw_os_indicate_disconnect(padapter);
  
 - /* donnot enqueue cmd */
 - rtw_lps_ctrl_wk_cmd(padapter, 
 LPS_CTRL_DISCONNECT, 0);
 - }
 + /* donnot enqueue cmd */
 + rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
   }
 - /* s2-3. */
 - rtw_free_assoc_resources(padapter, 1);
 + }
 + /* s2-3. */
 + rtw_free_assoc_resources(padapter, 1);
  
 - /* s2-4. */
 - rtw_free_network_queue(padapter, true);
 - rtw_ips_dev_unload(padapter);
 - pwrpriv-rf_pwrstate = rf_off;
 - pwrpriv-bips_processing = false;
 + /* s2-4. */
 + rtw_free_network_queue(padapter, true);
 + rtw_ips_dev_unload(padapter);
 + pwrpriv-rf_pwrstate = rf_off;
 + pwrpriv-bips_processing = false;
 +
 + _exit_pwrlock(pwrpriv-lock);
  
 - _exit_pwrlock(pwrpriv-lock);
 - } else {
 - goto error_exit;
 - }
   return 0;
  
  error_exit:
 @@ -452,35 +450,32 @@ int rtw_hw_resume(struct adapter *padapter)
   struct net_device *pnetdev = padapter-pnetdev;
  
  
 - if (padapter) { /* system resume */
 - DBG_88E(== rtw_hw_resume\n);
 - _enter_pwrlock(pwrpriv-lock);
 - pwrpriv-bips_processing = true;
 - rtw_reset_drv_sw(padapter);
 + /* system resume */
 + DBG_88E(== rtw_hw_resume\n);
 + _enter_pwrlock(pwrpriv-lock);
 + pwrpriv-bips_processing = true;
 + rtw_reset_drv_sw(padapter);
  
 - if (pm_netdev_open(pnetdev, false) != 0) {
 - _exit_pwrlock(pwrpriv-lock);
 - goto error_exit;
 - }
 + if (pm_netdev_open(pnetdev, false) != 0) {
 + _exit_pwrlock(pwrpriv-lock);
 + goto error_exit;
 + }
  
 - netif_device_attach(pnetdev);
 - netif_carrier_on(pnetdev);
 + netif_device_attach(pnetdev);
 + netif_carrier_on(pnetdev);
  
 - if (!netif_queue_stopped(pnetdev))
 - netif_start_queue(pnetdev);
 - else
 - netif_wake_queue(pnetdev);
 + if (!netif_queue_stopped(pnetdev))
 + netif_start_queue(pnetdev);
 + else
 + netif_wake_queue(pnetdev);
  
 - pwrpriv-bkeepfwalive = false;
 - pwrpriv-brfoffbyhw = false;
 + pwrpriv-bkeepfwalive = false;
 + pwrpriv-brfoffbyhw = false;
  
 - pwrpriv-rf_pwrstate = rf_on

Re: [PATCH] staging: wlan-ng: fix bad symbol declaration

2014-04-11 Thread Josh Triplett
On Fri, Apr 11, 2014 at 03:00:49PM +0200, Neil Armstrong wrote:
 With sparse, the following error appears :
   CHECK   drivers/staging/wlan-ng/p80211netdev.c
 drivers/staging/wlan-ng/cfg80211.c:710:6: warning: symbol 
 'prism2_connect_result' was not declared. Should it be static?
 drivers/staging/wlan-ng/cfg80211.c:719:6: warning: symbol 
 'prism2_disconnected' was not declared. Should it be static?
 drivers/staging/wlan-ng/cfg80211.c:725:6: warning: symbol 'prism2_roamed' was 
 not declared. Should it be static?
 
 Move functions declaration to coherent internal header file.
 
 Signed-off-by: Neil 'Superna' Armstrong superna9...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/wlan-ng/prism2mgmt.h |5 +
  drivers/staging/wlan-ng/prism2sta.c  |4 
  2 files changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/staging/wlan-ng/prism2mgmt.h 
 b/drivers/staging/wlan-ng/prism2mgmt.h
 index 190d390..b62fdcb 100644
 --- a/drivers/staging/wlan-ng/prism2mgmt.h
 +++ b/drivers/staging/wlan-ng/prism2mgmt.h
 @@ -109,4 +109,9 @@ void prism2sta_processing_defer(struct work_struct *data);
  void prism2sta_commsqual_defer(struct work_struct *data);
  void prism2sta_commsqual_timer(unsigned long data);
  
 +/* Interface callback functions, passing data back up to the cfg80211 layer 
 */
 +void prism2_connect_result(wlandevice_t *wlandev, u8 failed);
 +void prism2_disconnected(wlandevice_t *wlandev);
 +void prism2_roamed(wlandevice_t *wlandev);
 +
  #endif
 diff --git a/drivers/staging/wlan-ng/prism2sta.c 
 b/drivers/staging/wlan-ng/prism2sta.c
 index f9ccf23..3fd4538 100644
 --- a/drivers/staging/wlan-ng/prism2sta.c
 +++ b/drivers/staging/wlan-ng/prism2sta.c
 @@ -120,10 +120,6 @@ MODULE_PARM_DESC(prism2_reset_settletime, reset settle 
 time in ms);
  
  MODULE_LICENSE(Dual MPL/GPL);
  
 -void prism2_connect_result(wlandevice_t *wlandev, u8 failed);
 -void prism2_disconnected(wlandevice_t *wlandev);
 -void prism2_roamed(wlandevice_t *wlandev);
 -
  static int prism2sta_open(wlandevice_t *wlandev);
  static int prism2sta_close(wlandevice_t *wlandev);
  static void prism2sta_reset(wlandevice_t *wlandev);
 -- 
 1.7.10.4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8187se: fix pointer and return statement's syntax

2014-04-09 Thread Josh Triplett
On Wed, Apr 09, 2014 at 09:25:55AM +0200, Martin Kepplinger wrote:
 Use the common kernel coding style.
 
 Signed-off-by: Martin Kepplinger mart...@posteo.de

Reviewed-by: Josh Triplett j...@joshtriplett.org
 
  drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c 
 b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
 index 0dc5ae4..e6257b3 100644
 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
 +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
 @@ -180,7 +180,7 @@ static inline int ieee80211_put_snap(u8 *data, u16 
 h_proto)
  int ieee80211_encrypt_fragment(struct ieee80211_device *ieee,
  struct sk_buff *frag, int hdr_len)
  {
 - struct ieee80211_crypt_data* crypt = ieee-crypt[ieee-tx_keyidx];
 + struct ieee80211_crypt_data *crypt = ieee-crypt[ieee-tx_keyidx];
   int res;
  
   /*
 @@ -285,7 +285,7 @@ static int ieee80211_classify(struct sk_buff *skb,
  
   if (!network-QoS_Enable) {
   skb-priority = 0;
 - return(wme_UP);
 + return wme_UP;
   }
  
   if (eh-ether_type == __constant_htons(ETHERTYPE_IP)) {
 @@ -304,7 +304,7 @@ static int ieee80211_classify(struct sk_buff *skb,
   }
  
   skb-priority = wme_UP;
 - return(wme_UP);
 + return wme_UP;
  }
  
  /* SKBs are added to the ieee-tx_queue. */
 -- 
 1.7.10.4
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: davinci_vpfe: fix error check

2014-02-15 Thread Josh Triplett
On Sat, Feb 15, 2014 at 11:17:11AM +0100, Levente Kurusa wrote:
 The check would check the pointer, which is never less than 0.
 According to the error message, the correct check would be
 to check the return value of ipipe_mode. Check that instead.
 
 Reported-by: David Binderman dcb...@hotmail.com
 Signed-off-by: Levente Kurusa le...@linux.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c 
 b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
 index 2d36b60..b2daf5e 100644
 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
 +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
 @@ -267,7 +267,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
   }
  
   ipipe_mode = get_ipipe_mode(ipipe);
 - if (ipipe  0) {
 + if (ipipe_mode  0) {
   pr_err(Failed to get ipipe mode);
   return -EINVAL;
   }
 -- 
 1.8.3.1
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: staging: Mark functions as static and remove unused function in bpctl_mod.c

2014-01-25 Thread Josh Triplett
On Fri, Jan 24, 2014 at 04:14:00AM +0530, Rashika Kheria wrote:
 Mark functions as static in bpctl_mod.c because they are not used
 outside this file. Remove unused function from bpctl_mod.c.
 
[...]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/7] Eliminate uses of __DATE__ and __TIME__

2013-12-23 Thread Josh Triplett
Using the __DATE__ and __TIME macros makes the kernel build non-deterministic.
The kernel already optionally records this information at build time, so random
kernel code shouldn't duplicate that.  Eliminate all uses of __DATE__ and
__TIME__, and then turn on a new GCC warning if available to make sure no new
uses get added.

Josh Triplett (7):
  mtd: denali: Drop print of build date/time
  net: wireless: brcm80211: Drop debug version with build date/time
  staging: rtl8188eu: Drop print of build date/time
  staging: rts5139: Drop print of build time
  staging: wlags49_h2: Drop debug macro recording build date/time
  x86: math-emu: Drop already-disabled print of build date
  Makefile: Build with -Werror=date-time if the compiler supports it

 Makefile | 3 +++
 arch/x86/math-emu/errors.c   | 5 -
 drivers/mtd/nand/denali_pci.c| 1 -
 drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | 7 ---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c  | 1 -
 drivers/staging/rts5139/rts51x_scsi.c| 1 -
 drivers/staging/wlags49_h2/wl_version.h  | 4 
 7 files changed, 3 insertions(+), 19 deletions(-)

-- 
1.8.5.2

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


[PATCH 4/7] staging: rts5139: Drop print of build time

2013-12-23 Thread Josh Triplett
The kernel already has this information, and individual drivers
shouldn't duplicate that.  This also eliminates the use of __TIME__,
which makes the build non-deterministic.  (And, without __DATE__,
__TIME__ provided little useful information to begin with.)

Signed-off-by: Josh Triplett j...@joshtriplett.org
---
 drivers/staging/rts5139/rts51x_scsi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rts5139/rts51x_scsi.c 
b/drivers/staging/rts5139/rts51x_scsi.c
index a474eed..3a99025 100644
--- a/drivers/staging/rts5139/rts51x_scsi.c
+++ b/drivers/staging/rts5139/rts51x_scsi.c
@@ -1985,7 +1985,6 @@ static int show_info(struct seq_file *m, struct Scsi_Host 
*host)
SPRINTF(   Vendor: Realtek Corp.\n);
SPRINTF(  Product: RTS51xx USB Card Reader\n);
SPRINTF(  Version: %s\n, DRIVER_VERSION);
-   SPRINTF(Build: %s\n, __TIME__);
return 0;
 }
 
-- 
1.8.5.2

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


[PATCH 5/7] staging: wlags49_h2: Drop debug macro recording build date/time

2013-12-23 Thread Josh Triplett
The kernel already has this information, and individual drivers
shouldn't duplicate that.  This also eliminates the use of __DATE__ and
__TIME__, which make the build non-deterministic.

Signed-off-by: Josh Triplett j...@joshtriplett.org
---
 drivers/staging/wlags49_h2/wl_version.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_version.h 
b/drivers/staging/wlags49_h2/wl_version.h
index 037b526..019ebb2 100644
--- a/drivers/staging/wlags49_h2/wl_version.h
+++ b/drivers/staging/wlags49_h2/wl_version.h
@@ -129,11 +129,7 @@ err: define bus type;
 #endif  /* HERMES25 */
 #endif  /* BUS_XXX */
 
-#ifdef DBG
-#define MODULE_DATE __DATE__   __TIME__
-#else
 #define MODULE_DATE 07/18/2004 13:30:00
-#endif // DBG
 
 //#define STR2(m) #m
 //#define STR1(m) STR2(m)
-- 
1.8.5.2

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


Re: [PATCH] drivers: dwc2: Mark function as static in core.c

2013-12-21 Thread Josh Triplett
On Sat, Dec 21, 2013 at 03:50:29PM +0530, Rashika Kheria wrote:
 Mark function dwc2_set_param_uframe_sched() as static in core.c because
 it is not used outside this file.
 
 This eliminates the following warning in core.c:
 drivers/staging/dwc2/core.c:2739:5: warning: no previous prototype for 
 ‘dwc2_set_param_uframe_sched’ [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/dwc2/core.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c
 index 6d001b5..c029cb6 100644
 --- a/drivers/staging/dwc2/core.c
 +++ b/drivers/staging/dwc2/core.c
 @@ -2736,7 +2736,7 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
   return 0;
  }
  
 -int dwc2_set_param_uframe_sched(struct dwc2_hsotg *hsotg, int val)
 +static int dwc2_set_param_uframe_sched(struct dwc2_hsotg *hsotg, int val)
  {
   int retval = 0;
  
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] drivers: dgap: Include appropriate header file in dgap_parse.c

2013-12-21 Thread Josh Triplett
On Sat, Dec 21, 2013 at 03:55:50PM +0530, Rashika Kheria wrote:
 Include appropriate header file in dgap/dgap_parse.h in dgap_parse.c
 because functions dgap_parsefile(), dgap_config_get_useintr(),
 dgap_config_get_altpin(), dgap_find_config(),
 dgap_config_get_number_of_ports(), dgap_create_config_string() and
 dgap_get_config_letters() have their prototype declarations in the
 header file.
 
 This eliminates the following warnings in dgap_parse.c:
 drivers/staging/dgap/dgap_parse.c:125:5: warning: no previous prototype for 
 ‘dgap_parsefile’ [-Wmissing-prototypes]
 drivers/staging/dgap/dgap_parse.c:1101:6: warning: no previous prototype for 
 ‘dgap_config_get_useintr’ [-Wmissing-prototypes]
 drivers/staging/dgap/dgap_parse.c:1128:6: warning: no previous prototype for 
 ‘dgap_config_get_altpin’ [-Wmissing-prototypes]
 drivers/staging/dgap/dgap_parse.c:1157:15: warning: no previous prototype for 
 ‘dgap_find_config’ [-Wmissing-prototypes]
 drivers/staging/dgap/dgap_parse.c:1223:6: warning: no previous prototype for 
 ‘dgap_config_get_number_of_ports’ [-Wmissing-prototypes]
 drivers/staging/dgap/dgap_parse.c:1252:7: warning: no previous prototype for 
 ‘dgap_create_config_string’ [-Wmissing-prototypes]
 drivers/staging/dgap/dgap_parse.c:1311:7: warning: no previous prototype for 
 ‘dgap_get_config_letters’ [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/dgap/dgap_parse.c |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/staging/dgap/dgap_parse.c 
 b/drivers/staging/dgap/dgap_parse.c
 index ff9d194..36fd93d 100644
 --- a/drivers/staging/dgap/dgap_parse.c
 +++ b/drivers/staging/dgap/dgap_parse.c
 @@ -42,6 +42,7 @@
  #include dgap_types.h
  #include dgap_fep5.h
  #include dgap_driver.h
 +#include dgap_parse.h
  #include dgap_conf.h
  
  
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: sbe-2t3e3: Mark functions as static in ctrl.c

2013-12-21 Thread Josh Triplett
On Sat, Dec 21, 2013 at 03:47:13PM +0530, Rashika Kheria wrote:
 Mark functions t3e3_set_loopback(), t3e3_reg_read(), t3e3_reg_write(),
 t3e3_port_get(), t3e3_port_set(), t3e3_port_get_stats() and
 t3e3_port_del_stats() as static in ctrl.c because they are not used
 outside this file.
 
 This eliminates the following warnings in ctrl.c:
 drivers/staging/sbe-2t3e3/ctrl.c:34:6: warning: no previous prototype for 
 ‘t3e3_set_loopback’ [-Wmissing-prototypes]
 drivers/staging/sbe-2t3e3/ctrl.c:98:6: warning: no previous prototype for 
 ‘t3e3_reg_read’ [-Wmissing-prototypes]
 drivers/staging/sbe-2t3e3/ctrl.c:135:6: warning: no previous prototype for 
 ‘t3e3_reg_write’ [-Wmissing-prototypes]
 drivers/staging/sbe-2t3e3/ctrl.c:167:6: warning: no previous prototype for 
 ‘t3e3_port_get’ [-Wmissing-prototypes]
 drivers/staging/sbe-2t3e3/ctrl.c:172:6: warning: no previous prototype for 
 ‘t3e3_port_set’ [-Wmissing-prototypes]
 drivers/staging/sbe-2t3e3/ctrl.c:219:6: warning: no previous prototype for 
 ‘t3e3_port_get_stats’ [-Wmissing-prototypes]
 drivers/staging/sbe-2t3e3/ctrl.c:285:6: warning: no previous prototype for 
 ‘t3e3_port_del_stats’ [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/sbe-2t3e3/ctrl.c |   14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)
 
 diff --git a/drivers/staging/sbe-2t3e3/ctrl.c 
 b/drivers/staging/sbe-2t3e3/ctrl.c
 index a5825d7..d280bcf 100644
 --- a/drivers/staging/sbe-2t3e3/ctrl.c
 +++ b/drivers/staging/sbe-2t3e3/ctrl.c
 @@ -31,7 +31,7 @@ void t3e3_set_frame_type(struct channel *sc, u32 mode)
   sc-p.frame_type = mode;
  }
  
 -void t3e3_set_loopback(struct channel *sc, u32 mode)
 +static void t3e3_set_loopback(struct channel *sc, u32 mode)
  {
   u32 tx, rx;
  
 @@ -95,7 +95,7 @@ void t3e3_set_loopback(struct channel *sc, u32 mode)
  }
  
  
 -void t3e3_reg_read(struct channel *sc, u32 *reg, u32 *val)
 +static void t3e3_reg_read(struct channel *sc, u32 *reg, u32 *val)
  {
   u32 i;
  
 @@ -132,7 +132,7 @@ void t3e3_reg_read(struct channel *sc, u32 *reg, u32 *val)
   }
  }
  
 -void t3e3_reg_write(struct channel *sc, u32 *reg)
 +static void t3e3_reg_write(struct channel *sc, u32 *reg)
  {
   u32 i;
  
 @@ -164,12 +164,12 @@ void t3e3_reg_write(struct channel *sc, u32 *reg)
   }
  }
  
 -void t3e3_port_get(struct channel *sc, t3e3_param_t *param)
 +static void t3e3_port_get(struct channel *sc, t3e3_param_t *param)
  {
   memcpy(param, (sc-p), sizeof(t3e3_param_t));
  }
  
 -void t3e3_port_set(struct channel *sc, t3e3_param_t *param)
 +static void t3e3_port_set(struct channel *sc, t3e3_param_t *param)
  {
   if (param-frame_mode != 0xff)
   cpld_set_frame_mode(sc, param-frame_mode);
 @@ -216,7 +216,7 @@ void t3e3_port_set(struct channel *sc, t3e3_param_t 
 *param)
   cpld_set_scrambler(sc, param-scrambler);
  }
  
 -void t3e3_port_get_stats(struct channel *sc,
 +static void t3e3_port_get_stats(struct channel *sc,
t3e3_stats_t *stats)
  {
   u32 result;
 @@ -282,7 +282,7 @@ void t3e3_port_get_stats(struct channel *sc,
   memcpy(stats, (sc-s), sizeof(t3e3_stats_t));
  }
  
 -void t3e3_port_del_stats(struct channel *sc)
 +static void t3e3_port_del_stats(struct channel *sc)
  {
   memset((sc-s), 0, sizeof(t3e3_stats_t));
  }
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] drivers: dgap: Include appropriate header file in dgap_trace.c

2013-12-21 Thread Josh Triplett
On Sat, Dec 21, 2013 at 03:58:25PM +0530, Rashika Kheria wrote:
 Include appropriate header file dgap/dgap_trace.h in dgap_trace.c
 because function dgap_tracer_free() have its prototype declaration in
 the header file.
 
 This eliminates the following warning in dgap_trace.c:
 drivers/staging/dgap/dgap_trace.c:181:6: warning: no previous prototype for 
 ‘dgap_tracer_free’ [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/dgap/dgap_trace.c |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/staging/dgap/dgap_trace.c 
 b/drivers/staging/dgap/dgap_trace.c
 index 0f9a956..6c8b510 100644
 --- a/drivers/staging/dgap/dgap_trace.c
 +++ b/drivers/staging/dgap/dgap_trace.c
 @@ -37,6 +37,7 @@
  #include linux/vmalloc.h
  
  #include dgap_driver.h
 +#include dgap_trace.h
  
  #define TRC_TO_CONSOLE 1
  
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: dgnc: Include appropriate header file in dgnc_trace.c

2013-12-21 Thread Josh Triplett
On Sat, Dec 21, 2013 at 03:52:38PM +0530, Rashika Kheria wrote:
 Include appropriate header file dgnc/dgnc_trace.h in dgnc_trace.c
 because function dgnc_tracer_free() has its prototype declaration in the
 header file.
 
 This eliminates the following warning in dgnc_trace.c:
 drivers/staging/dgnc/dgnc_trace.c:180:6: warning: no previous prototype for 
 ‘dgnc_tracer_free’ [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/dgnc/dgnc_trace.c |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/staging/dgnc/dgnc_trace.c 
 b/drivers/staging/dgnc/dgnc_trace.c
 index a98b7d4..e2164e4 100644
 --- a/drivers/staging/dgnc/dgnc_trace.c
 +++ b/drivers/staging/dgnc/dgnc_trace.c
 @@ -35,6 +35,7 @@
  #include linux/vmalloc.h
  
  #include dgnc_driver.h
 +#include dgnc_trace.h
  
  #define TRC_TO_CONSOLE 1
  
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] drivers: bcm: Remove unused function in nvm.c

2013-12-21 Thread Josh Triplett
On Sat, Dec 21, 2013 at 04:03:22PM +0530, Rashika Kheria wrote:
 Remove unused function PropagateCalParamsFromEEPROMToMemory() in nvm.c.
 
 This eliminates the following warning in nvm.c:
 drivers/staging/bcm/nvm.c:1369:5: warning: no previous prototype for 
 ‘PropagateCalParamsFromEEPROMToMemory’ [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/bcm/nvm.c |   61 
 -
  1 file changed, 61 deletions(-)
 
 diff --git a/drivers/staging/bcm/nvm.c b/drivers/staging/bcm/nvm.c
 index 9e5f955..6f40f17 100644
 --- a/drivers/staging/bcm/nvm.c
 +++ b/drivers/staging/bcm/nvm.c
 @@ -1355,67 +1355,6 @@ BeceemFlashBulkWriteStatus_EXIT:
  }
  
  /*
 - * Procedure:PropagateCalParamsFromEEPROMToMemory
 - *
 - * Description: Dumps the calibration section of EEPROM to DDR.
 - *
 - * Arguments:
 - *   Adapter- ptr to Adapter object instance
 - * Returns:
 - *   OSAL_STATUS_CODE
 - *
 - */
 -
 -int PropagateCalParamsFromEEPROMToMemory(struct bcm_mini_adapter *Adapter)
 -{
 - PCHAR pBuff = kmalloc(BUFFER_4K, GFP_KERNEL);
 - unsigned int uiEepromSize = 0;
 - unsigned int uiIndex = 0;
 - unsigned int uiBytesToCopy = 0;
 - unsigned int uiCalStartAddr = EEPROM_CALPARAM_START;
 - unsigned int uiMemoryLoc = EEPROM_CAL_DATA_INTERNAL_LOC;
 - unsigned int value;
 - int Status = 0;
 -
 - if (!pBuff)
 - return -ENOMEM;
 -
 - if (0 != BeceemEEPROMBulkRead(Adapter, uiEepromSize, 
 EEPROM_SIZE_OFFSET, 4)) {
 - kfree(pBuff);
 - return -1;
 - }
 -
 - uiEepromSize = 16;
 - if (uiEepromSize  1024 * 1024) {
 - kfree(pBuff);
 - return -1;
 - }
 -
 - uiBytesToCopy = MIN(BUFFER_4K, uiEepromSize);
 -
 - while (uiBytesToCopy) {
 - if (0 != BeceemEEPROMBulkRead(Adapter, (PUINT)pBuff, 
 uiCalStartAddr, uiBytesToCopy)) {
 - Status = -1;
 - break;
 - }
 - wrm(Adapter, uiMemoryLoc, (PCHAR)(((PULONG)pBuff) + uiIndex), 
 uiBytesToCopy);
 - uiMemoryLoc += uiBytesToCopy;
 - uiEepromSize -= uiBytesToCopy;
 - uiCalStartAddr += uiBytesToCopy;
 - uiIndex += uiBytesToCopy / 4;
 - uiBytesToCopy = MIN(BUFFER_4K, uiEepromSize);
 -
 - }
 - value = 0xbeadbead;
 - wrmalt(Adapter, EEPROM_CAL_DATA_INTERNAL_LOC - 4, value, 
 sizeof(value));
 - value = 0xbeadbead;
 - wrmalt(Adapter, EEPROM_CAL_DATA_INTERNAL_LOC - 8, value, 
 sizeof(value));
 - kfree(pBuff);
 -
 - return Status;
 -}
 -
 -/*
   * Procedure:PropagateCalParamsFromFlashToMemory
   *
   * Description: Dumps the calibration section of EEPROM to DDR.
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] drivers: bcm: Mark functions as static in Qos.c

2013-12-21 Thread Josh Triplett
On Sat, Dec 21, 2013 at 04:01:16PM +0530, Rashika Kheria wrote:
 Mark functions MatchSrcIpAddress(), MatchDestIpAddress() and MatchTos()
 as static in Qos.c because they are not used outside this file.
 
 This eliminates the following warnings in Qos.c:
 drivers/staging/bcm/Qos.c:27:6: warning: no previous prototype for 
 ‘MatchSrcIpAddress’ [-Wmissing-prototypes]
 drivers/staging/bcm/Qos.c:61:6: warning: no previous prototype for 
 ‘MatchDestIpAddress’ [-Wmissing-prototypes]
 drivers/staging/bcm/Qos.c:94:6: warning: no previous prototype for ‘MatchTos’ 
 [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/staging/bcm/Qos.c |6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c
 index 1609a2b..0727599 100644
 --- a/drivers/staging/bcm/Qos.c
 +++ b/drivers/staging/bcm/Qos.c
 @@ -24,7 +24,7 @@ static VOID PruneQueue(struct bcm_mini_adapter *Adapter, 
 INT iIndex);
  *
  * Returns - TRUE(If address matches) else FAIL .
  */
 -bool MatchSrcIpAddress(struct bcm_classifier_rule *pstClassifierRule, ULONG 
 ulSrcIP)
 +static bool MatchSrcIpAddress(struct bcm_classifier_rule *pstClassifierRule, 
 ULONG ulSrcIP)
  {
   UCHAR ucLoopIndex = 0;
  
 @@ -58,7 +58,7 @@ bool MatchSrcIpAddress(struct bcm_classifier_rule 
 *pstClassifierRule, ULONG ulSr
  *
  * Returns - TRUE(If address matches) else FAIL .
  */
 -bool MatchDestIpAddress(struct bcm_classifier_rule *pstClassifierRule, ULONG 
 ulDestIP)
 +static bool MatchDestIpAddress(struct bcm_classifier_rule 
 *pstClassifierRule, ULONG ulDestIP)
  {
   UCHAR ucLoopIndex = 0;
   struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
 @@ -91,7 +91,7 @@ bool MatchDestIpAddress(struct bcm_classifier_rule 
 *pstClassifierRule, ULONG ulD
  *
  * Returns - TRUE(If address matches) else FAIL.
  **/
 -bool MatchTos(struct bcm_classifier_rule *pstClassifierRule, UCHAR 
 ucTypeOfService)
 +static bool MatchTos(struct bcm_classifier_rule *pstClassifierRule, UCHAR 
 ucTypeOfService)
  {
  
   struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: hv: Mark the function hv_synic_free_cpu() as static in hv.c

2013-12-14 Thread Josh Triplett
On Sat, Dec 14, 2013 at 07:00:06PM +0530, Rashika Kheria wrote:
 This patch marks the function hv_synic_free_cpu() as static in hv.c
 because it is not used outside this file.
 
 Thus, it also eliminates the following warning in hv.c:
 drivers/hv/hv.c:304:6: warning: no previous prototype for ‘hv_synic_free_cpu’ 
 [-Wmissing-prototypes]
 
 Signed-off-by: Rashika Kheria rashika.khe...@gmail.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

  drivers/hv/hv.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
 index f0c5e07..bcb4950 100644
 --- a/drivers/hv/hv.c
 +++ b/drivers/hv/hv.c
 @@ -301,7 +301,7 @@ err:
   return -ENOMEM;
  }
  
 -void hv_synic_free_cpu(int cpu)
 +static void hv_synic_free_cpu(int cpu)
  {
   kfree(hv_context.event_dpc[cpu]);
   if (hv_context.synic_event_page[cpu])
 -- 
 1.7.9.5
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch] Staging: sb105x: info leak in mp_get_count()

2013-11-04 Thread Josh Triplett
On Mon, Nov 04, 2013 at 10:01:00AM +0300, Dan Carpenter wrote:
 I've dropped most of the people from the CC list.
 
 On Sun, Nov 03, 2013 at 08:31:50PM -0800, Josh Triplett wrote:
  On Mon, Nov 04, 2013 at 02:11:50AM +0300, Dan Carpenter wrote:
   On Sun, Nov 03, 2013 at 10:28:02AM -0800, Josh Triplett wrote:
On Tue, Oct 29, 2013 at 11:01:43PM +0300, Dan Carpenter wrote:
 The icount.reserved[] array isn't initialized so it leaks stack
 information to userspace.
 
 Reported-by: Nico Golde n...@ngolde.de
 Reported-by: Fabian Yamaguchi f...@goesec.de
 Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

Also, you don't quite have the patch format right here; you should have
a --- line after the commit mesage, followed by a diffstat.  Did you use
git format-patch to generate this patch?
   
   I normally don't include the diffstat.  Which tools care about that?
  
  Human wetware. :)
  
  It isn't required by any tools.  The --- is, though, to produce
  something applicable by git.
 
 That's really weird.  I've been using the same scripts for years and no
 one has complained before.  The patch applies fine with `git am` for me.
 I'm using git version 1.7.10.4.

I stand corrected.  I was under the impression that the --- was required
to mark the end of the commit message, but sure enough, git am seems to
accept it.  Reading the git am manpage, it says that a line starting
with diff - will also indicate the end of the commit message and start
of the patch.

It still isn't the conventional format produced by git format-patch,
which I'd recommend matching for ease of human consumption, but
nonetheless it apparently works.

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


Re: [patch] Staging: sb105x: info leak in mp_get_count()

2013-11-03 Thread Josh Triplett
On Tue, Oct 29, 2013 at 11:01:43PM +0300, Dan Carpenter wrote:
 The icount.reserved[] array isn't initialized so it leaks stack
 information to userspace.
 
 Reported-by: Nico Golde n...@ngolde.de
 Reported-by: Fabian Yamaguchi f...@goesec.de
 Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

Reviewed-by: Josh Triplett j...@joshtriplett.org

Also, you don't quite have the patch format right here; you should have
a --- line after the commit mesage, followed by a diffstat.  Did you use
git format-patch to generate this patch?

 diff --git a/drivers/staging/sb105x/sb_pci_mp.c 
 b/drivers/staging/sb105x/sb_pci_mp.c
 index bc53b4e..bde28b9 100644
 --- a/drivers/staging/sb105x/sb_pci_mp.c
 +++ b/drivers/staging/sb105x/sb_pci_mp.c
 @@ -1063,7 +1063,7 @@ static int mp_wait_modem_status(struct sb_uart_state 
 *state, unsigned long arg)
  
  static int mp_get_count(struct sb_uart_state *state, struct 
 serial_icounter_struct *icnt)
  {
 - struct serial_icounter_struct icount;
 + struct serial_icounter_struct icount = {};
   struct sb_uart_icount cnow;
   struct sb_uart_port *port = state-port;
  
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch] Staging: sb105x: info leak in mp_get_count()

2013-11-03 Thread Josh Triplett
On Mon, Nov 04, 2013 at 02:11:50AM +0300, Dan Carpenter wrote:
 On Sun, Nov 03, 2013 at 10:28:02AM -0800, Josh Triplett wrote:
  On Tue, Oct 29, 2013 at 11:01:43PM +0300, Dan Carpenter wrote:
   The icount.reserved[] array isn't initialized so it leaks stack
   information to userspace.
   
   Reported-by: Nico Golde n...@ngolde.de
   Reported-by: Fabian Yamaguchi f...@goesec.de
   Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
  
  Reviewed-by: Josh Triplett j...@joshtriplett.org
  
  Also, you don't quite have the patch format right here; you should have
  a --- line after the commit mesage, followed by a diffstat.  Did you use
  git format-patch to generate this patch?
 
 I normally don't include the diffstat.  Which tools care about that?

Human wetware. :)

It isn't required by any tools.  The --- is, though, to produce
something applicable by git.

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


Re: [OPW kernel] Re: [PATCH v2] Staging: zram: Fix variable dereferenced before check

2013-10-20 Thread Josh Triplett
On Sat, Oct 19, 2013 at 01:59:05PM -0700, Greg KH wrote:
 On Sat, Oct 19, 2013 at 10:01:42PM +0530, Rashika Kheria wrote:
  This patch fixes the following Smatch warning in zram_drv.c-
  ~/git/kernels/linux/drivers/staging/zram/zram_drv.c:663
  reset_store() warn: variable dereferenced before check 'bdev' (see line 652)
  ~/git/kernels/linux/drivers/staging/zram/zram_drv.c:899
  destroy_device() warn: variable dereferenced before check 'zram-disk' (see 
  line 896)
  
  Signed-off-by: Rashika Kheria rashika.khe...@gmail.com
 
 zram is messy, tricky, and I hate it.  Seriously, I which I had never
 taken it into the staging tree...
 
 Anyway, I want the existing zram developers/maintainers to review this
 patch before I can accept it, as I don't trust anything that is ever
 done in that code, especially as I don't test it :)
 
 Minchan, Jiang, Nitin, what do you think of the patch below?  Can I get
 your ack on it so that I can apply it?

I think you actually want to review v3 of this patch, not v2.

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