Dan Carpenter | 31 Oct 11:41 2014
Picon

[patch 2/2] staging: r8188eu: cleanups in rtw_android_set_block()

1) We can tighten up the code a little by returning directly and it
   makes the code more future proof and easier to read.
2) "free" is a better name than "exit".
3) sizeof(priv_cmd) is shorter and more clear than sizeof(struct
   android_wifi_priv_cmd).

Signed-off-by: Dan Carpenter <dan.carpenter <at> oracle.com>

diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
index b403178..99ce077 100644
--- a/drivers/staging/rtl8188eu/os_dep/rtw_android.c
+++ b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
 <at>  <at>  -148,20 +148,15  <at>  <at>  static int rtw_android_set_block(struct net_device *net, char *command,
 int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
 {
 	int ret = 0;
-	char *command = NULL;
+	char *command;
 	int cmd_num;
 	int bytes_written = 0;
 	struct android_wifi_priv_cmd priv_cmd;

-	if (!ifr->ifr_data) {
-		ret = -EINVAL;
-		goto exit;
-	}
-	if (copy_from_user(&priv_cmd, ifr->ifr_data,
-			   sizeof(struct android_wifi_priv_cmd))) {
-		ret = -EFAULT;
-		goto exit;
(Continue reading)

Dan Carpenter | 31 Oct 11:40 2014
Picon

[patch 1/2] staging: r8188eu: get a string from the user correctly

The original code had two bugs:
1) It didn't check if the string was zero length so it could oops when
   it tried to dereference the ZERO_SIZE_PTR.
2) It didn't enforce that the string was NUL terminated.

It was also messy as pants.

Signed-off-by: Dan Carpenter <dan.carpenter <at> oracle.com>
---
I assume that hopefully the users were passing NUL terminated strings
and this patch to put a NUL terminator at the end doesn't change
anything.  This is a static checker fix.

diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
index d9d55d1..b403178 100644
--- a/drivers/staging/rtl8188eu/os_dep/rtw_android.c
+++ b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
 <at>  <at>  -162,22 +162,12  <at>  <at>  int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
 		ret = -EFAULT;
 		goto exit;
 	}
-	command = kmalloc(priv_cmd.total_len, GFP_KERNEL);
-	if (!command) {
-		DBG_88E("%s: failed to allocate memory\n", __func__);
-		ret = -ENOMEM;
-		goto exit;
-	}
-	if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) {
-		DBG_88E("%s: failed to access memory\n", __func__);
-		ret = -EFAULT;
(Continue reading)

Tristan Lelong | 31 Oct 07:43 2014

[PATCH] Staging: android: ion: fix typos in comments

Fix some coding style warnings detected by checkpatch.pl in ion.

Signed-off-by: Tristan Lelong <tristan <at> lelong.xyz>
---
 drivers/staging/android/ion/ion.c      | 2 +-
 drivers/staging/android/ion/ion.h      | 2 +-
 drivers/staging/android/ion/ion_priv.h | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 290d4d2..8724ef8 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
 <at>  <at>  -250,7 +250,7  <at>  <at>  static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
 	   our systems the only dma_address space is physical addresses.
 	   Additionally, we can't afford the overhead of invalidating every
 	   allocation via dma_map_sg. The implicit contract here is that
-	   memory comming from the heaps is ready for dma, ie if it has a
+	   memory coming from the heaps is ready for dma, ie if it has a
 	   cached mapping that mapping has been invalidated */
 	for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i)
 		sg_dma_address(sg) = sg_phys(sg);
diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h
index d305bb7..443db84 100644
--- a/drivers/staging/android/ion/ion.h
+++ b/drivers/staging/android/ion/ion.h
 <at>  <at>  -76,7 +76,7  <at>  <at>  struct ion_platform_data {
  *		size
  *
  * Calls memblock reserve to set aside memory for heaps that are
(Continue reading)

Google UK Ltd | 31 Oct 00:50 2014
Picon

Award Announcement.

Dear Google User.

You have been selected as a winner for using Google services,attached  
to this email is Our Official Notification Letter for your perusal.

Sincerely.
Mr. Matt Brittin
CEO of Google Ltd UK.
_______________________________________________
devel mailing list
devel <at> linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Bryan Thompson | 30 Oct 21:18 2014
Picon

[PATCH 0/9] Cleanup in virtpci.c

This series of patches cleans up some simple checkpatch.pl findings in virtpci.c

Bryan Thompson (9):
  staging: unisys: virtpci: Add a blank line after the definition of
    driver_private
  staging: unisys: virtpci: Remove extraneous blank lines
  staging: unisys: virtpci: Remove space between cast and variable
  staging: unisys: virtpci: Allocate memory using the size of the
    variable
  staging: unisys: virtpci: Place logical continuation at the end of a
    line
  staging: unisys: virtpci: Add braces to if/else statements
  staging: unisys: virtpci: Use a single blank line to separate code
    blocks
  staging: unisys: virtpci: Fix alignment issues
  staging: unisys: virtpci: Adjust lines to contain a maximum of 80
    characters

 drivers/staging/unisys/virtpci/virtpci.c |   81 +++++++++++++++---------------
 1 file changed, 41 insertions(+), 40 deletions(-)

--

-- 
1.7.9.5
Haiyang Zhang | 30 Oct 22:07 2014
Picon

[PATCH net-next] hyperv: Add IPv6 into the hash computation for vRSS

This will allow the workload spreading via vRSS for IPv6.

Signed-off-by: Haiyang Zhang <haiyangz <at> microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys <at> microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c   |    4 +++-
 drivers/net/hyperv/rndis_filter.c |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 78ec33f..3295e4e 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
 <at>  <at>  -193,7 +193,9  <at>  <at>  static bool netvsc_set_hash(u32 *hash, struct sk_buff *skb)
 	struct flow_keys flow;
 	int data_len;

-	if (!skb_flow_dissect(skb, &flow) || flow.n_proto != htons(ETH_P_IP))
+	if (!skb_flow_dissect(skb, &flow) ||
+	    !(flow.n_proto == htons(ETH_P_IP) ||
+	      flow.n_proto == htons(ETH_P_IPV6)))
 		return false;

 	if (flow.ip_proto == IPPROTO_TCP)
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 2b86f0b..ccce6f2 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
 <at>  <at>  -728,7 +728,8  <at>  <at>  int rndis_filter_set_rss_param(struct rndis_device *rdev, int num_queue)
 	rssp->hdr.size = sizeof(struct ndis_recv_scale_param);
(Continue reading)

H Hartley Sweeten | 30 Oct 19:37 2014

[PATCH 0/3] staging: comedi: make core track comedi_async 'cur_chan'

Move the tracking of the comedi_async 'cur_chan' into the core.

H Hartley Sweeten (3):
  staging: comedi: ni_mio_common: remove unused variable in ni_ao_fifo_load()
  staging: comedi: drivers: move comedi_async 'cur_chan' tracking into the core
  staging: comedi: amplc_pci230: remove private data 'ai_scan_pos'

 drivers/staging/comedi/drivers.c                          |  7 +++++++
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c |  2 --
 drivers/staging/comedi/drivers/adl_pci9118.c              |  8 ++------
 drivers/staging/comedi/drivers/adv_pci1710.c              | 13 ++-----------
 drivers/staging/comedi/drivers/amplc_pci230.c             | 15 ++++-----------
 drivers/staging/comedi/drivers/ni_mio_common.c            | 11 -----------
 drivers/staging/comedi/drivers/pcl812.c                   | 13 ++++---------
 drivers/staging/comedi/drivers/pcl816.c                   |  6 +-----
 drivers/staging/comedi/drivers/pcl818.c                   |  6 +-----
 drivers/staging/comedi/drivers/rtd520.c                   |  3 ---
 10 files changed, 21 insertions(+), 63 deletions(-)

--

-- 
2.0.3
H Hartley Sweeten | 30 Oct 19:32 2014

[PATCH 0/2] staging: comedi: rtd520: fix analog input munging

Bipolar analog input samples need to be munged from two's-complement format
to the unsigned offset format that comedi expects. Currently this driver
uses a bitmap in the private data to determine if the sample being acquired
is bipolar.

The comedi_async 'cur_chan' is used to test the bit in the bitmap in the
ai_read_n() function. The 'cur_chan' is never incremented so all the bit
tests are using the first channel in the chanlist. Patch 1 fixes this.

Patch 2 removes the bitmap and uses the comedi_is_bipolar() helper to
determine if the sample needs to be munged.

H Hartley Sweeten (2):
  staging: comedi: rtd520: fix ai_read_n() async->cur_chan use
  staging: comedi: rtd520: remove private data 'chan_is_bipolar' member

 drivers/staging/comedi/drivers/rtd520.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

--

-- 
2.0.3
H Hartley Sweeten | 30 Oct 19:21 2014

[PATCH] staging: comedi: drivers do not need to reset the async->cur_chan

The comedi core calls comedi_buf_reset() before starting an async command
(*do_cmd) and after returning a subdevice to an idle state (*cancel).

The drivers do not need to reset the async->cur_chan in those functions.

Signed-off-by: H Hartley Sweeten <hsweeten <at> visionengravers.com>
Cc: Ian Abbott <abbotti <at> mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh <at> linuxfoundation.org>
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 2 --
 drivers/staging/comedi/drivers/adl_pci9118.c              | 2 --
 drivers/staging/comedi/drivers/adv_pci1710.c              | 2 --
 drivers/staging/comedi/drivers/ni_atmio16d.c              | 1 -
 drivers/staging/comedi/drivers/pcl812.c                   | 1 -
 drivers/staging/comedi/drivers/pcl816.c                   | 1 -
 drivers/staging/comedi/drivers/usbdux.c                   | 6 ------
 drivers/staging/comedi/drivers/usbduxfast.c               | 2 --
 drivers/staging/comedi/drivers/usbduxsigma.c              | 5 -----
 9 files changed, 22 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
index 975ee5f..6b65ce6 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
 <at>  <at>  -629,7 +629,6  <at>  <at>  static int apci3120_cancel(struct comedi_device *dev,
 	inb(dev->iobase + APCI3120_RESET_FIFO);
 	inw(dev->iobase + APCI3120_RD_STATUS);
 	devpriv->ui_AiActualScan = 0;
-	s->async->cur_chan = 0;
 	devpriv->ui_DmaActualBuffer = 0;
(Continue reading)

H Hartley Sweeten | 30 Oct 19:19 2014

[PATCH 0/3] staging: comedi: drivers: tidy up the subdev_flags

For consistency in the comedi drivers:
  1) Replace all SDF_WRITEABLE uses with SDF_WRITABLE
  2) Remove the analog reference flags from the non-analog subdevices
  3) Remove the unnecessary SDF_READABLE flag from the digital output subdevices

H Hartley Sweeten (3):
  staging: comedi: drivers: replace SDF_WRITEABLE with SDF_WRITABLE
  staging: comedi: drivers: remove inappropriate SDF_* flags from subdevices
  staging: comedi: drivers: digital output subdevices do not need SDF_READABLE

 drivers/staging/comedi/drivers/addi_apci_1500.c  | 7 +++----
 drivers/staging/comedi/drivers/addi_apci_1516.c  | 2 +-
 drivers/staging/comedi/drivers/addi_apci_1564.c  | 4 ++--
 drivers/staging/comedi/drivers/addi_apci_16xx.c  | 2 +-
 drivers/staging/comedi/drivers/addi_apci_2032.c  | 2 +-
 drivers/staging/comedi/drivers/addi_apci_2200.c  | 2 +-
 drivers/staging/comedi/drivers/addi_apci_3120.c  | 6 +++---
 drivers/staging/comedi/drivers/addi_apci_3501.c  | 6 +++---
 drivers/staging/comedi/drivers/addi_apci_3xxx.c  | 6 +++---
 drivers/staging/comedi/drivers/addi_watchdog.c   | 2 +-
 drivers/staging/comedi/drivers/adl_pci9111.c     | 2 +-
 drivers/staging/comedi/drivers/adv_pci1710.c     | 4 ++--
 drivers/staging/comedi/drivers/adv_pci1723.c     | 2 +-
 drivers/staging/comedi/drivers/adv_pci_dio.c     | 8 ++++----
 drivers/staging/comedi/drivers/amplc_pc263.c     | 2 +-
 drivers/staging/comedi/drivers/amplc_pci263.c    | 2 +-
 drivers/staging/comedi/drivers/c6xdigio.c        | 2 +-
 drivers/staging/comedi/drivers/cb_pcidas64.c     | 2 +-
 drivers/staging/comedi/drivers/comedi_test.c     | 2 +-
 drivers/staging/comedi/drivers/das08.c           | 2 +-
(Continue reading)

H Hartley Sweeten | 30 Oct 19:10 2014

[PATCH] staging: comedi: comedi_buf: make comedi_buf_write_samples() add samples that fit

This function currently fails if the number of samples to add would
overflow the async buffer. Modify it to add the samples that fit so
at least some of the sample data is returned to the user.

Signed-off-by: H Hartley Sweeten <hsweeten <at> visionengravers.com>
Cc: Ian Abbott <abbotti <at> mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh <at> linuxfoundation.org>
---
 drivers/staging/comedi/comedi_buf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 6dd87cb..b43424d 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
 <at>  <at>  -484,12 +484,16  <at>  <at>  unsigned int comedi_buf_write_samples(struct comedi_subdevice *s,
 	unsigned int max_samples;
 	unsigned int nbytes;

-	/* make sure there is enought room in the buffer for all the samples */
+	/*
+	 * Make sure there is enough room in the buffer for all the samples.
+	 * If not, clamp the nsamples to the number that will fit, flag the
+	 * buffer overrun and add the samples that fit.
+	 */
 	max_samples = comedi_buf_write_n_available(s) / bytes_per_sample(s);
 	if (nsamples > max_samples) {
 		dev_warn(s->device->class_dev, "buffer overrun\n");
 		s->async->events |= COMEDI_CB_OVERFLOW;
-		return 0;
(Continue reading)


Gmane