MOBILITY-823, Plugin lookup path for geoservice doesn't comply with Qt standard

--- src/global/qmobilitypluginsearch.h
+++ src/global/qmobilitypluginsearch.h
@@ -144,6 +144,23 @@
             }
         }
     }
+
+    /* Add application path + plugintype */
+    QDir appldir(QCoreApplication::applicationDirPath());
+    if(appldir.cd(plugintype)){
+        if (!processed.contains(appldir.absolutePath())){
+            processed.insert(appldir.absolutePath());
+            QStringList files = appldir.entryList(QDir::Files);
+#if !defined QT_NO_DEBUG
+            if (showDebug)
+                qDebug() << "Looking for " << plugintype << " plugins in" << appldir.path() << files;
+#endif
+            for (int j=0; j < files.count(); j++) {
+                plugins <<  appldir.absoluteFilePath(files.at(j));
+            }
+        }
+    }
+
 #if defined(Q_OS_SYMBIAN)
     rfs.Close();
 #endif


Staging: brcm80211: remove some unused macros

These are all defined by the core kernel, use those versions
instead of just creating noops.

Cc: Brett Rudley <26249f5ce9ab482eb9c1d6a038c3361972320fe7@broadcom.com>
Cc: Henry Ptasinski <a2bfa192d69f2dcfd5f53307558e46c4ad79ca40@broadcom.com>
Cc: Nohee Ko <88f98a1a73938d47f85be4df60d6fe3da6c45ccc@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/brcm80211/include/linuxver.h
+++ drivers/staging/brcm80211/include/linuxver.h
@@ -39,24 +39,6 @@
 #include <linux/sched.h>
 #include <linux/ieee80211.h>

-#ifndef __exit
-#define __exit
-#endif
-#ifndef __devexit
-#define __devexit
-#endif
-#ifndef __devinit
-#define __devinit	__init
-#endif
-#ifndef __devinitdata
-#define __devinitdata
-#endif
-#ifndef __devexit_p
-#define __devexit_p(x)	x
-#endif
-
-#define netif_down(dev)
-
 /* suspend args */
 #define DRV_SUSPEND_STATE_TYPE pm_message_t


staging: brcm80211: unifdef -UWLC_LOW_ONLY

Part of BMAC removal.

Signed-off-by: Brett Rudley <26249f5ce9ab482eb9c1d6a038c3361972320fe7@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/brcm80211/sys/wlc_mac80211.h
+++ drivers/staging/brcm80211/sys/wlc_mac80211.h
@@ -496,15 +496,6 @@
 #endif
 	bool ucode_loaded;	/* true after ucode downloaded */

-#ifdef WLC_LOW_ONLY
-	struct wl_timer *wdtimer;	/* timer for watchdog routine */
-	struct ether_addr orig_etheraddr;	/* original hw ethernet address */
-	u16 rpc_dngl_agg;	/* rpc agg control for dongle */
-	u32 mem_required_def;	/* memory required to replenish RX DMA ring */
-	u32 mem_required_lower;	/* memory required with lower RX bound */
-	u32 mem_required_least;	/* minimum memory requirement to handle RX */
-
-#endif				/* WLC_LOW_ONLY */

 	u8 hw_stf_ss_opmode;	/* STF single stream operation mode */
 	u8 antsel_type;	/* Type of boardlevel mimo antenna switch-logic


flickr: Use SSL

flickr: Use SSL

Fixes: https://bugzilla.gnome.org/730810

--- src/goabackend/goaflickrprovider.c
+++ src/goabackend/goaflickrprovider.c
@@ -104,19 +104,19 @@
 static const gchar *
 get_request_uri (GoaOAuthProvider *provider)
 {
-  return "http://m.flickr.com/services/oauth/request_token";
+  return "https://m.flickr.com/services/oauth/request_token";
 }

 static const gchar *
 get_authorization_uri (GoaOAuthProvider *provider)
 {
-  return "http://m.flickr.com/services/oauth/authorize";
+  return "https://m.flickr.com/services/oauth/authorize";
 }

 static const gchar *
 get_token_uri (GoaOAuthProvider *provider)
 {
-  return "http://m.flickr.com/services/oauth/access_token";
+  return "https://m.flickr.com/services/oauth/access_token";
 }

 static const gchar *
@@ -165,7 +165,7 @@
                                       goa_oauth_provider_get_consumer_secret (provider),
                                       access_token,
                                       access_token_secret,
-                                      "http://api.flickr.com/services/rest",
+                                      "https://api.flickr.com/services/rest",
                                       FALSE);
   call = rest_proxy_new_call (proxy);
   rest_proxy_call_add_param (call, "method", "flickr.test.login");


staging: comedi: adl_pci7432: remove the private data

The private data is no longer needed by this driver. Remove the
struct, devpriv macro, and the allocation.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/adl_pci7432.c
+++ drivers/staging/comedi/drivers/adl_pci7432.c
@@ -41,12 +41,6 @@
 #define PCI7432_DO	    0x00

 #define PCI_DEVICE_ID_PCI7432 0x7432
-
-struct adl_pci7432_private {
-	int data;
-};
-
-#define devpriv ((struct adl_pci7432_private *)dev->private)

 static int adl_pci7432_do_insn_bits(struct comedi_device *dev,
 				    struct comedi_subdevice *s,
@@ -117,9 +111,6 @@

 	dev->board_name = "pci7432";

-	if (alloc_private(dev, sizeof(struct adl_pci7432_private)) < 0)
-		return -ENOMEM;
-
 	ret = comedi_alloc_subdevices(dev, 2);
 	if (ret)
 		return ret;


staging: comedi: adl_pci9111: change pci9111_fifo_reset into a function

This macro relies on a local variable having a specific name.
It's used multiple places so change it into a function.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/adl_pci9111.c
+++ drivers/staging/comedi/drivers/adl_pci9111.c
@@ -129,20 +129,6 @@
 #define PCI9111_FIFO_FULL_MASK				0x40
 #define PCI9111_AD_BUSY_MASK				0x80

-/*
- * Define inlined function
- */
-
-#define pci9111_fifo_reset() do { \
-	outb(PCI9111_FFEN_SET_FIFO_ENABLE, \
-		dev->iobase + PCI9111_INT_CTRL_REG); \
-	outb(PCI9111_FFEN_SET_FIFO_DISABLE, \
-		dev->iobase + PCI9111_INT_CTRL_REG); \
-	outb(PCI9111_FFEN_SET_FIFO_ENABLE, \
-		dev->iobase + PCI9111_INT_CTRL_REG); \
-	} while (0)
-
-
 static const struct comedi_lrange pci9111_hr_ai_range = {
 	5,
 	{
@@ -335,6 +321,16 @@
 	outb(flags, dev->iobase + PCI9111_INT_CTRL_REG);
 }

+static void pci9111_fifo_reset(struct comedi_device *dev)
+{
+	unsigned long int_ctrl_reg = dev->iobase + PCI9111_INT_CTRL_REG;
+
+	/* To reset the FIFO, set FFEN sequence as 0 -> 1 -> 0 */
+	outb(PCI9111_FFEN_SET_FIFO_ENABLE, int_ctrl_reg);
+	outb(PCI9111_FFEN_SET_FIFO_DISABLE, int_ctrl_reg);
+	outb(PCI9111_FFEN_SET_FIFO_ENABLE, int_ctrl_reg);
+}
+
 /*  ------------------------------------------------------------------ */
 /*  HARDWARE TRIGGERED ANALOG INPUT SECTION */
 /*  ------------------------------------------------------------------ */
@@ -355,7 +351,7 @@

 	pci9111_autoscan_set(dev, false);

-	pci9111_fifo_reset();
+	pci9111_fifo_reset(dev);

 	return 0;
 }
@@ -616,7 +612,7 @@

 		pci9111_trigger_source_set(dev, software);
 		pci9111_timer_set(dev);
-		pci9111_fifo_reset();
+		pci9111_fifo_reset(dev);
 		pci9111_interrupt_source_set(dev, irq_on_fifo_half_full,
 					     irq_on_timer_tick);
 		pci9111_trigger_source_set(dev, timer_pacer);
@@ -635,7 +631,7 @@
 	case TRIG_EXT:

 		pci9111_trigger_source_set(dev, external);
-		pci9111_fifo_reset();
+		pci9111_fifo_reset(dev);
 		pci9111_interrupt_source_set(dev, irq_on_fifo_half_full,
 					     irq_on_timer_tick);
 		plx9050_interrupt_control(dev_private->lcr_io_base, true, true,
@@ -843,7 +839,7 @@
 			dev->iobase + PCI9111_AI_RANGE_REG);
 	}

-	pci9111_fifo_reset();
+	pci9111_fifo_reset(dev);

 	for (i = 0; i < insn->n; i++) {
 		/* Generate a software trigger */
@@ -860,7 +856,7 @@

 		comedi_error(dev, "A/D read timeout");
 		data[i] = 0;
-		pci9111_fifo_reset();
+		pci9111_fifo_reset(dev);
 		return -ETIME;

 conversion_done:


staging: comedi: adl_pci9118: store the pci_dev in the comedi_device

Use the hw_dev pointer in the comedi_device struct to hold the
pci_dev instead of carrying it in the private data.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/adl_pci9118.c
+++ drivers/staging/comedi/drivers/adl_pci9118.c
@@ -250,7 +250,6 @@
 struct pci9118_private {
 	unsigned long iobase_a;	/* base+size for AMCC chip */
 	unsigned int master;	/* master capable */
-	struct pci_dev *pcidev;	/* ptr to actual pcidev */
 	unsigned int usemux;	/* we want to use external multiplexor! */
 #ifdef PCI9118_PARANOIDCHECK
 	unsigned short chanlist[PCI9118_CHANLEN + 1];	/*
@@ -2151,6 +2150,7 @@
 static int pci9118_attach(struct comedi_device *dev,
 			  struct comedi_devconfig *it)
 {
+	struct pci_dev *pcidev;
 	struct comedi_subdevice *s;
 	int ret, pages, i;
 	unsigned short master;
@@ -2170,16 +2170,17 @@
 		return -ENOMEM;
 	}

-	devpriv->pcidev = pci9118_find_pci(dev, it);
-	if (!devpriv->pcidev)
+	pcidev = pci9118_find_pci(dev, it);
+	if (!pcidev)
 		return -EIO;
+	comedi_set_hw_dev(dev, &pcidev->dev);

 	if (master)
-		pci_set_master(devpriv->pcidev);
-
-	irq = devpriv->pcidev->irq;
-	devpriv->iobase_a = pci_resource_start(devpriv->pcidev, 0);
-	dev->iobase = pci_resource_start(devpriv->pcidev, 2);
+		pci_set_master(pcidev);
+
+	irq = pcidev->irq;
+	devpriv->iobase_a = pci_resource_start(pcidev, 0);
+	dev->iobase = pci_resource_start(pcidev, 2);

 	dev->board_name = this_board->name;

@@ -2264,8 +2265,8 @@

 	printk(".\n");

-	pci_read_config_word(devpriv->pcidev, PCI_COMMAND, &u16w);
-	pci_write_config_word(devpriv->pcidev, PCI_COMMAND, u16w | 64);
+	pci_read_config_word(pcidev, PCI_COMMAND, &u16w);
+	pci_write_config_word(pcidev, PCI_COMMAND, u16w | 64);
 				/* Enable parity check for parity error */

 	ret = comedi_alloc_subdevices(dev, 4);
@@ -2343,23 +2344,25 @@

 static void pci9118_detach(struct comedi_device *dev)
 {
+	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
+
 	if (dev->private) {
 		if (devpriv->valid)
 			pci9118_reset(dev);
 		if (dev->irq)
 			free_irq(dev->irq, dev);
-		if (devpriv->pcidev) {
-			if (dev->iobase)
-				comedi_pci_disable(devpriv->pcidev);
-
-			pci_dev_put(devpriv->pcidev);
-		}
 		if (devpriv->dmabuf_virt[0])
 			free_pages((unsigned long)devpriv->dmabuf_virt[0],
 				   devpriv->dmabuf_pages[0]);
 		if (devpriv->dmabuf_virt[1])
 			free_pages((unsigned long)devpriv->dmabuf_virt[1],
 				   devpriv->dmabuf_pages[1]);
+	}
+	if (pcidev) {
+		if (dev->iobase)
+			comedi_pci_disable(pcidev);
+
+		pci_dev_put(pcidev);
 	}
 }


staging: comedi: adv_pci1724: rewrite "Devices:" line

Rewrite the "Devices:" line in the comedi "driver" comment to conform to
the usual comedi format for this line.  The line should be a
comma-separated list where the first item is in the following format:

  [Manufacturer] BOARD-NAME (comedi-board-name)

The "[Manufacturer]" and/or "(comedi-board-name)" parts may be omitted
from following items, in which case the parts from the preceding item
are used.  The "Devices:" line may be continued continued over several
lines by using one or more spaces at the start of each continuation line
(not counting the space after the "*" in the block comment).

Signed-off-by: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Reviewed-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/adv_pci1724.c
+++ drivers/staging/comedi/drivers/adv_pci1724.c
@@ -22,7 +22,7 @@
 /*
  * Driver: adv_pci1724
  * Description: Advantech PCI-1724U
- * Devices: (Advantech) PCI-1724U [adv_pci1724]
+ * Devices: [Advantech] PCI-1724U (adv_pci1724)
  * Author: Frank Mori Hess <fmh6jj@gmail.com>
  * Updated: 2013-02-09
  * Status: works


staging: comedi: remove thisboard macro in the aio_iiro_16 driver

The 'thisboard' macro depends on having a local variable with
a magic name. The CodingStyle document suggests not doing this
to avoid confusion. Remove the macro and use the comedi_board()
inline helper to get the dev->board_ptr information.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Cc: Mori Hess <298b610a35dd7dda4ea5d33c28e8a7d9dff2b9bf@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/aio_iiro_16.c
+++ drivers/staging/comedi/drivers/aio_iiro_16.c
@@ -57,8 +57,6 @@
 	 .do_ = 16},
 };

-#define	thisboard	((const struct aio_iiro_16_board *) dev->board_ptr)
-
 struct aio_iiro_16_private {
 	int data;
 	struct pci_dev *pci_dev;
@@ -106,12 +104,13 @@
 static int aio_iiro_16_attach(struct comedi_device *dev,
 			      struct comedi_devconfig *it)
 {
+	const struct aio_iiro_16_board *board = comedi_board(dev);
 	int iobase;
 	struct comedi_subdevice *s;

 	printk(KERN_INFO "comedi%d: aio_iiro_16: ", dev->minor);

-	dev->board_name = thisboard->name;
+	dev->board_name = board->name;

 	iobase = it->options[0];


staging: comedi: cb_das16_cs: remove incomplete async command support

This driver has a (*do_cmdtest) function for analog input async command
support but the (*do_cmd) function just returns -EINVAL.

Remove the incomplete async command support.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/cb_das16_cs.c
+++ drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -95,12 +95,6 @@
 	}
 };

-static irqreturn_t das16cs_interrupt(int irq, void *d)
-{
-	/* struct comedi_device *dev = d; */
-	return IRQ_HANDLED;
-}
-
 static int das16cs_ai_eoc(struct comedi_device *dev,
 			  struct comedi_subdevice *s,
 			  struct comedi_insn *insn,
@@ -161,117 +155,6 @@
 	return i;
 }

-static int das16cs_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
-{
-	return -EINVAL;
-}
-
-static int das16cs_ai_cmdtest(struct comedi_device *dev,
-			      struct comedi_subdevice *s,
-			      struct comedi_cmd *cmd)
-{
-	int err = 0;
-	int tmp;
-
-	/* Step 1 : check if triggers are trivially valid */
-
-	err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW);
-	err |= cfc_check_trigger_src(&cmd->scan_begin_src,
-					TRIG_TIMER | TRIG_EXT);
-	err |= cfc_check_trigger_src(&cmd->convert_src,
-					TRIG_TIMER | TRIG_EXT);
-	err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
-	err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT | TRIG_NONE);
-
-	if (err)
-		return 1;
-
-	/* Step 2a : make sure trigger sources are unique */
-
-	err |= cfc_check_trigger_is_unique(cmd->scan_begin_src);
-	err |= cfc_check_trigger_is_unique(cmd->convert_src);
-	err |= cfc_check_trigger_is_unique(cmd->stop_src);
-
-	/* Step 2b : and mutually compatible */
-
-	if (err)
-		return 2;
-
-	/* Step 3: check if arguments are trivially valid */
-
-	err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
-
-#define MAX_SPEED	10000	/* in nanoseconds */
-#define MIN_SPEED	1000000000	/* in nanoseconds */
-
-	if (cmd->scan_begin_src == TRIG_TIMER) {
-		err |= cfc_check_trigger_arg_min(&cmd->scan_begin_arg,
-						 MAX_SPEED);
-		err |= cfc_check_trigger_arg_max(&cmd->scan_begin_arg,
-						 MIN_SPEED);
-	} else {
-		/* external trigger */
-		/* should be level/edge, hi/lo specification here */
-		/* should specify multiple external triggers */
-		err |= cfc_check_trigger_arg_max(&cmd->scan_begin_arg, 9);
-	}
-	if (cmd->convert_src == TRIG_TIMER) {
-		err |= cfc_check_trigger_arg_min(&cmd->convert_arg,
-						 MAX_SPEED);
-		err |= cfc_check_trigger_arg_max(&cmd->convert_arg,
-						 MIN_SPEED);
-	} else {
-		/* external trigger */
-		/* see above */
-		err |= cfc_check_trigger_arg_max(&cmd->convert_arg, 9);
-	}
-
-	err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len);
-
-	if (cmd->stop_src == TRIG_COUNT)
-		err |= cfc_check_trigger_arg_max(&cmd->stop_arg, 0x00ffffff);
-	else	/* TRIG_NONE */
-		err |= cfc_check_trigger_arg_is(&cmd->stop_arg, 0);
-
-	if (err)
-		return 3;
-
-	/* step 4: fix up any arguments */
-
-	if (cmd->scan_begin_src == TRIG_TIMER) {
-		unsigned int div1 = 0, div2 = 0;
-
-		tmp = cmd->scan_begin_arg;
-		i8253_cascade_ns_to_timer(I8254_OSC_BASE_10MHZ,
-					  &div1, &div2,
-					  &cmd->scan_begin_arg, cmd->flags);
-		if (tmp != cmd->scan_begin_arg)
-			err++;
-	}
-	if (cmd->convert_src == TRIG_TIMER) {
-		unsigned int div1 = 0, div2 = 0;
-
-		tmp = cmd->convert_arg;
-		i8253_cascade_ns_to_timer(I8254_OSC_BASE_10MHZ,
-					  &div1, &div2,
-					  &cmd->scan_begin_arg, cmd->flags);
-		if (tmp != cmd->convert_arg)
-			err++;
-		if (cmd->scan_begin_src == TRIG_TIMER &&
-		    cmd->scan_begin_arg <
-		    cmd->convert_arg * cmd->scan_end_arg) {
-			cmd->scan_begin_arg =
-			    cmd->convert_arg * cmd->scan_end_arg;
-			err++;
-		}
-	}
-
-	if (err)
-		return 4;
-
-	return 0;
-}
-
 static int das16cs_ao_winsn(struct comedi_device *dev,
 			    struct comedi_subdevice *s,
 			    struct comedi_insn *insn, unsigned int *data)
@@ -409,10 +292,6 @@
 	dev->iobase = link->resource[0]->start;

 	link->priv = dev;
-	ret = pcmcia_request_irq(link, das16cs_interrupt);
-	if (ret)
-		return ret;
-	dev->irq = link->irq;

 	devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
 	if (!devpriv)
@@ -423,7 +302,6 @@
 		return ret;

 	s = &dev->subdevices[0];
-	dev->read_subdev = s;
 	/* analog input subdevice */
 	s->type		= COMEDI_SUBD_AI;
 	s->subdev_flags	= SDF_READABLE | SDF_GROUND | SDF_DIFF | SDF_CMD_READ;
@@ -432,8 +310,6 @@
 	s->range_table	= &das16cs_ai_range;
 	s->len_chanlist	= 16;
 	s->insn_read	= das16cs_ai_rinsn;
-	s->do_cmd	= das16cs_ai_cmd;
-	s->do_cmdtest	= das16cs_ai_cmdtest;

 	s = &dev->subdevices[1];
 	/* analog output subdevice */


staging: comedi: cb_pcidas64: store the pci_dev in the comedi_device

Use the hw_dev pointer in the comedi_device struct to hold the
pci_dev instead of carrying it in the private data.

Save the pci bar in dev->iobase so the detach is consistent with
the other comedi pci drivers.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/cb_pcidas64.c
+++ drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -1047,8 +1047,6 @@

 /* this structure is for data unique to this hardware driver. */
 struct pcidas64_private {
-
-	struct pci_dev *hw_dev;	/*  pointer to board's pci_dev struct */
 	/*  base addresses (physical) */
 	resource_size_t plx9080_phys_iobase;
 	resource_size_t main_phys_iobase;
@@ -1553,12 +1551,13 @@

 static int alloc_and_init_dma_members(struct comedi_device *dev)
 {
+	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 	int i;

 	/*  alocate pci dma buffers */
 	for (i = 0; i < ai_dma_ring_count(board(dev)); i++) {
 		priv(dev)->ai_buffer[i] =
-		    pci_alloc_consistent(priv(dev)->hw_dev, DMA_BUFFER_SIZE,
+		    pci_alloc_consistent(pcidev, DMA_BUFFER_SIZE,
 					 &priv(dev)->ai_buffer_bus_addr[i]);
 		if (priv(dev)->ai_buffer[i] == NULL)
 			return -ENOMEM;
@@ -1567,7 +1566,7 @@
 	for (i = 0; i < AO_DMA_RING_COUNT; i++) {
 		if (ao_cmd_is_supported(board(dev))) {
 			priv(dev)->ao_buffer[i] =
-			    pci_alloc_consistent(priv(dev)->hw_dev,
+			    pci_alloc_consistent(pcidev,
 						 DMA_BUFFER_SIZE,
 						 &priv(dev)->
 						 ao_buffer_bus_addr[i]);
@@ -1578,7 +1577,7 @@
 	}
 	/*  allocate dma descriptors */
 	priv(dev)->ai_dma_desc =
-	    pci_alloc_consistent(priv(dev)->hw_dev,
+	    pci_alloc_consistent(pcidev,
 				 sizeof(struct plx_dma_desc) *
 				 ai_dma_ring_count(board(dev)),
 				 &priv(dev)->ai_dma_desc_bus_addr);
@@ -1589,7 +1588,7 @@
 		    priv(dev)->ai_dma_desc_bus_addr);
 	if (ao_cmd_is_supported(board(dev))) {
 		priv(dev)->ao_dma_desc =
-		    pci_alloc_consistent(priv(dev)->hw_dev,
+		    pci_alloc_consistent(pcidev,
 					 sizeof(struct plx_dma_desc) *
 					 AO_DMA_RING_COUNT,
 					 &priv(dev)->ao_dma_desc_bus_addr);
@@ -1699,7 +1698,7 @@
 	pcidev = cb_pcidas64_find_pci_dev(dev, it);
 	if (!pcidev)
 		return -EIO;
-	priv(dev)->hw_dev = pcidev;
+	comedi_set_hw_dev(dev, &pcidev->dev);

 	if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
 		dev_warn(dev->class_dev,
@@ -1711,10 +1710,11 @@
 	/* Initialize dev->board_name */
 	dev->board_name = board(dev)->name;

+	dev->iobase = pci_resource_start(pcidev, MAIN_BADDRINDEX);
+
 	priv(dev)->plx9080_phys_iobase =
 	    pci_resource_start(pcidev, PLX9080_BADDRINDEX);
-	priv(dev)->main_phys_iobase =
-	    pci_resource_start(pcidev, MAIN_BADDRINDEX);
+	priv(dev)->main_phys_iobase = dev->iobase;
 	priv(dev)->dio_counter_phys_iobase =
 	    pci_resource_start(pcidev, DIO_COUNTER_BADDRINDEX);

@@ -1791,12 +1791,13 @@

 static void detach(struct comedi_device *dev)
 {
+	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 	unsigned int i;

 	if (dev->irq)
 		free_irq(dev->irq, dev);
 	if (priv(dev)) {
-		if (priv(dev)->hw_dev) {
+		if (pcidev) {
 			if (priv(dev)->plx9080_iobase) {
 				disable_plx_interrupts(dev);
 				iounmap(priv(dev)->plx9080_iobase);
@@ -1808,7 +1809,7 @@
 			/*  free pci dma buffers */
 			for (i = 0; i < ai_dma_ring_count(board(dev)); i++) {
 				if (priv(dev)->ai_buffer[i])
-					pci_free_consistent(priv(dev)->hw_dev,
+					pci_free_consistent(pcidev,
 							    DMA_BUFFER_SIZE,
 							    priv(dev)->
 							    ai_buffer[i],
@@ -1818,7 +1819,7 @@
 			}
 			for (i = 0; i < AO_DMA_RING_COUNT; i++) {
 				if (priv(dev)->ao_buffer[i])
-					pci_free_consistent(priv(dev)->hw_dev,
+					pci_free_consistent(pcidev,
 							    DMA_BUFFER_SIZE,
 							    priv(dev)->
 							    ao_buffer[i],
@@ -1828,7 +1829,7 @@
 			}
 			/*  free dma descriptors */
 			if (priv(dev)->ai_dma_desc)
-				pci_free_consistent(priv(dev)->hw_dev,
+				pci_free_consistent(pcidev,
 						    sizeof(struct plx_dma_desc)
 						    *
 						    ai_dma_ring_count(board
@@ -1837,20 +1838,22 @@
 						    priv(dev)->
 						    ai_dma_desc_bus_addr);
 			if (priv(dev)->ao_dma_desc)
-				pci_free_consistent(priv(dev)->hw_dev,
+				pci_free_consistent(pcidev,
 						    sizeof(struct plx_dma_desc)
 						    * AO_DMA_RING_COUNT,
 						    priv(dev)->ao_dma_desc,
 						    priv(dev)->
 						    ao_dma_desc_bus_addr);
-			if (priv(dev)->main_phys_iobase)
-				comedi_pci_disable(priv(dev)->hw_dev);
-
-			pci_dev_put(priv(dev)->hw_dev);
 		}
 	}
 	if (dev->subdevices)
 		subdev_8255_cleanup(dev, dev->subdevices + 4);
+	if (pcidev) {
+		if (dev->iobase)
+			comedi_pci_disable(pcidev);
+
+		pci_dev_put(pcidev);
+	}
 }

 static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,


update dawn dependency (#148)

update dawn dependency (#148)

This fixes the path in GTClang since we moved a piece of code to a different module

--- src/gtclang/Frontend/Diagnostics.h
+++ src/gtclang/Frontend/Diagnostics.h
@@ -17,7 +17,7 @@
 #ifndef GTCLANG_FRONTEND_DIAGNOSTICS
 #define GTCLANG_FRONTEND_DIAGNOSTICS

-#include "dawn/Compiler/DiagnosticsMessage.h"
+#include "dawn/Support/DiagnosticsMessage.h"
 #include "dawn/Support/NonCopyable.h"
 #include "clang/Basic/Diagnostic.h"


staging: comedi: ni_at_a2150: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/ni_at_a2150.c
+++ drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -488,13 +488,25 @@
 	return 0;
 }

+static int a2150_ai_eoc(struct comedi_device *dev,
+			struct comedi_subdevice *s,
+			struct comedi_insn *insn,
+			unsigned long context)
+{
+	unsigned int status;
+
+	status = inw(dev->iobase + STATUS_REG);
+	if (status & FNE_BIT)
+		return 0;
+	return -EBUSY;
+}
+
 static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
 			  struct comedi_insn *insn, unsigned int *data)
 {
 	struct a2150_private *devpriv = dev->private;
-	unsigned int i, n;
-	static const int timeout = 100000;
-	static const int filter_delay = 36;
+	unsigned int n;
+	int ret;

 	/*  clear fifo and reset triggering circuitry */
 	outw(0, dev->iobase + FIFO_RESET_REG);
@@ -524,30 +536,24 @@
 	 * there is a 35.6 sample delay for data to get through the
 	 * antialias filter
 	 */
-	for (n = 0; n < filter_delay; n++) {
-		for (i = 0; i < timeout; i++) {
-			if (inw(dev->iobase + STATUS_REG) & FNE_BIT)
-				break;
-			udelay(1);
-		}
-		if (i == timeout) {
+	for (n = 0; n < 36; n++) {
+		ret = comedi_timeout(dev, s, insn, a2150_ai_eoc, 0);
+		if (ret) {
 			comedi_error(dev, "timeout");
-			return -ETIME;
-		}
+			return ret;
+		}
+
 		inw(dev->iobase + FIFO_DATA_REG);
 	}

 	/*  read data */
 	for (n = 0; n < insn->n; n++) {
-		for (i = 0; i < timeout; i++) {
-			if (inw(dev->iobase + STATUS_REG) & FNE_BIT)
-				break;
-			udelay(1);
-		}
-		if (i == timeout) {
+		ret = comedi_timeout(dev, s, insn, a2150_ai_eoc, 0);
+		if (ret) {
 			comedi_error(dev, "timeout");
-			return -ETIME;
-		}
+			return ret;
+		}
+
 		data[n] = inw(dev->iobase + FIFO_DATA_REG);
 		data[n] ^= 0x8000;
 	}


staging: comedi: ni_at_a2150: use comedi_bytes_per_sample()

For aesthetics, use the helper function to get the byte size of each sample
instead of using sizeof() the first buffer element.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Reviewed-by: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/ni_at_a2150.c
+++ drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -551,14 +551,14 @@
 	/*  set size of transfer to fill in 1/3 second */
 #define ONE_THIRD_SECOND 333333333
 	devpriv->dma_transfer_size =
-	    sizeof(devpriv->dma_buffer[0]) * cmd->chanlist_len *
+	    comedi_bytes_per_sample(s) * cmd->chanlist_len *
 	    ONE_THIRD_SECOND / cmd->scan_begin_arg;
 	if (devpriv->dma_transfer_size > A2150_DMA_BUFFER_SIZE)
 		devpriv->dma_transfer_size = A2150_DMA_BUFFER_SIZE;
-	if (devpriv->dma_transfer_size < sizeof(devpriv->dma_buffer[0]))
-		devpriv->dma_transfer_size = sizeof(devpriv->dma_buffer[0]);
+	if (devpriv->dma_transfer_size < comedi_bytes_per_sample(s))
+		devpriv->dma_transfer_size = comedi_bytes_per_sample(s);
 	devpriv->dma_transfer_size -=
-	    devpriv->dma_transfer_size % sizeof(devpriv->dma_buffer[0]);
+	    devpriv->dma_transfer_size % comedi_bytes_per_sample(s);
 	set_dma_count(devpriv->dma, devpriv->dma_transfer_size);
 	enable_dma(devpriv->dma);
 	release_dma_lock(lock_flags);


Staging: rtl8187se: Fix printk() should include KERN_ facility level

This patch fixes the following checkpatch.pl issues in
ieee80211/dot11d.c-
WARNING: printk() should include KERN_ facility level

Signed-off-by: Rashika Kheria <62a2cbd3422b0d621dafb7ceeff40187aeaed4ed@gmail.com>
Reviewed-by: Josh Triplett <c028c213ed5efcf30c3f4fc7361dbde0c893c5b7@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/rtl8187se/ieee80211/dot11d.c
+++ drivers/staging/rtl8187se/ieee80211/dot11d.c
@@ -21,7 +21,7 @@
 	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
 	RESET_CIE_WATCHDOG(ieee);

-	printk("Dot11d_Init()\n");
+	netdev_info(ieee->dev, "Dot11d_Init()\n");
 }

 /*
@@ -74,7 +74,7 @@
 	PCHNL_TXPOWER_TRIPLE pTriple;

 	if ((CoutryIeLen - 3)%3 != 0) {
-		printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
+		netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
 		Dot11d_Reset(dev);
 		return;
 	}
@@ -90,7 +90,8 @@
 			 * It is not in a monotonically increasing order,
 			 * so stop processing.
 			 */
-			printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
+			netdev_info(dev->dev,
+				    "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
 			Dot11d_Reset(dev);
 			return;
 		}
@@ -99,7 +100,8 @@
 			 * It is not a valid set of channel id,
 			 * so stop processing
 			 */
-			printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
+			netdev_info(dev->dev,
+				    "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
 			Dot11d_Reset(dev);
 			return;
 		}
@@ -113,11 +115,11 @@
 		pTriple = (PCHNL_TXPOWER_TRIPLE)((u8 *)pTriple + 3);
 	}
 #if 1
-	printk("Channel List:");
+	netdev_info(dev->dev, "Channel List:");
 	for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
 		if (pDot11dInfo->channel_map[i] > 0)
-			printk(" %d", i);
-	printk("\n");
+			netdev_info(dev->dev, " %d", i);
+	netdev_info(dev->dev, "\n");
 #endif

 	UPDATE_CIE_SRC(dev, pTaddr);
@@ -137,7 +139,7 @@
 	u8 MaxTxPwrInDbm = 255;

 	if (MAX_CHANNEL_NUMBER < Channel) {
-		printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
+		netdev_info(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
 		return MaxTxPwrInDbm;
 	}
 	if (pDot11dInfo->channel_map[Channel]) {
@@ -179,7 +181,7 @@
 	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);

 	if (MAX_CHANNEL_NUMBER < channel) {
-		printk("IsLegalChannel(): Invalid Channel\n");
+		netdev_info(dev->dev, "IsLegalChannel(): Invalid Channel\n");
 		return 0;
 	}
 	if (pDot11dInfo->channel_map[channel] > 0)
@@ -204,7 +206,7 @@
 	}

 	if (MAX_CHANNEL_NUMBER < channel) {
-		printk("IsLegalChannel(): Invalid Channel\n");
+		netdev_info(dev->dev, "IsLegalChannel(): Invalid Channel\n");
 		return default_chn;
 	}


Fixes for fetching BODY[n], patch by Rick Jones

--- src/imap/imap-fetch-body-section.c
+++ src/imap/imap-fetch-body-section.c
@@ -462,8 +462,10 @@
 		}

 		if (part != NULL &&
-		    (part->flags & MESSAGE_PART_FLAG_MESSAGE_RFC822)) {
-			/* skip the message/rfc822 part */
+		    (part->flags & MESSAGE_PART_FLAG_MESSAGE_RFC822) &&
+		    (*path >= '0' && *path <= '9' || strncmp(path, "HEADER", 6) == 0)) {
+			/* if remainder of path is a number or "HEADER",
+				skip the message/rfc822 part */
 			part = part->children;
 		}
 	}


Define iterator type for templates so that it is able to compile in GCC

--- GFort/Core/IObserver.h
+++ GFort/Core/IObserver.h
@@ -99,7 +99,8 @@
 template <typename T>
 inline void ISubject<T>::Notify()
 {
-    std::list<IObserver<T>* >::iterator it;
+    typedef typename std::list<IObserver<T>* >::iterator iterator_type;
+    iterator_type it;
     for (it = observer_list_.begin(); it != observer_list_.end(); ++it)
     {
         (*it)->Update(static_cast<T*>(this));


Adding SetTupleColumnValueForLowKey()

Adding SetTupleColumnValueForLowKey()

--- src/include/index/scan_optimizer.h
+++ src/include/index/scan_optimizer.h
@@ -260,6 +260,19 @@
   }

   /*
+   * SetTupleColumnValueForLowKey() - Similar to SetTupleColumnValue() but only
+   *                                  sets low key
+   *
+   * This function is designed to work for range query
+   */
+  void SetTupleColumnValueForLowKey(
+    Index *index_p,
+    const std::vector<oid_t> &column_id_list,
+    const std::vector<type::Value> &new_value_list) {
+
+  }
+
+  /*
    * BindValueToIndexKey() - Bind the value to a column of a given tuple
    *
    * This function binds the given value to the given column of a given key,


anv/blit2d: Inline meta_emit_blit2d

anv/blit2d: Inline meta_emit_blit2d

Reviewed-by: Nanley Chery <d78cd5d33e98a5581566f188959f731bd0b1c0fd@intel.com>

--- src/intel/vulkan/anv_meta_blit2d.c
+++ src/intel/vulkan/anv_meta_blit2d.c
@@ -129,190 +129,6 @@
                        }, cmd_buffer, img_o, usage);
 }

-static void
-meta_emit_blit2d(struct anv_cmd_buffer *cmd_buffer,
-                 struct anv_image_view *src_iview,
-                 uint32_t src_pitch,
-                 VkOffset3D src_offset,
-                 struct anv_image_view *dest_iview,
-                 VkOffset3D dest_offset,
-                 VkExtent3D extent)
-{
-   struct anv_device *device = cmd_buffer->device;
-
-   struct blit_vb_data {
-      float pos[2];
-      float tex_coord[3];
-   } *vb_data;
-
-   unsigned vb_size = sizeof(struct anv_vue_header) + 3 * sizeof(*vb_data);
-
-   struct anv_state vb_state =
-      anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, vb_size, 16);
-   memset(vb_state.map, 0, sizeof(struct anv_vue_header));
-   vb_data = vb_state.map + sizeof(struct anv_vue_header);
-
-   vb_data[0] = (struct blit_vb_data) {
-      .pos = {
-         dest_offset.x + extent.width,
-         dest_offset.y + extent.height,
-      },
-      .tex_coord = {
-         src_offset.x + extent.width,
-         src_offset.y + extent.height,
-         src_pitch,
-      },
-   };
-
-   vb_data[1] = (struct blit_vb_data) {
-      .pos = {
-         dest_offset.x,
-         dest_offset.y + extent.height,
-      },
-      .tex_coord = {
-         src_offset.x,
-         src_offset.y + extent.height,
-         src_pitch,
-      },
-   };
-
-   vb_data[2] = (struct blit_vb_data) {
-      .pos = {
-         dest_offset.x,
-         dest_offset.y,
-      },
-      .tex_coord = {
-         src_offset.x,
-         src_offset.y,
-         src_pitch,
-      },
-   };
-
-   anv_state_clflush(vb_state);
-
-   struct anv_buffer vertex_buffer = {
-      .device = device,
-      .size = vb_size,
-      .bo = &device->dynamic_state_block_pool.bo,
-      .offset = vb_state.offset,
-   };
-
-   anv_CmdBindVertexBuffers(anv_cmd_buffer_to_handle(cmd_buffer), 0, 2,
-      (VkBuffer[]) {
-         anv_buffer_to_handle(&vertex_buffer),
-         anv_buffer_to_handle(&vertex_buffer)
-      },
-      (VkDeviceSize[]) {
-         0,
-         sizeof(struct anv_vue_header),
-      });
-
-   VkDescriptorPool desc_pool;
-   anv_CreateDescriptorPool(anv_device_to_handle(device),
-      &(const VkDescriptorPoolCreateInfo) {
-         .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
-         .pNext = NULL,
-         .flags = 0,
-         .maxSets = 1,
-         .poolSizeCount = 1,
-         .pPoolSizes = (VkDescriptorPoolSize[]) {
-            {
-               .type = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
-               .descriptorCount = 1
-            },
-         }
-      }, &cmd_buffer->pool->alloc, &desc_pool);
-
-   VkDescriptorSet set;
-   anv_AllocateDescriptorSets(anv_device_to_handle(device),
-      &(VkDescriptorSetAllocateInfo) {
-         .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
-         .descriptorPool = desc_pool,
-         .descriptorSetCount = 1,
-         .pSetLayouts = &device->meta_state.blit2d.ds_layout
-      }, &set);
-
-   anv_UpdateDescriptorSets(anv_device_to_handle(device),
-      1, /* writeCount */
-      (VkWriteDescriptorSet[]) {
-         {
-            .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-            .dstSet = set,
-            .dstBinding = 0,
-            .dstArrayElement = 0,
-            .descriptorCount = 1,
-            .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
-            .pImageInfo = (VkDescriptorImageInfo[]) {
-               {
-                  .sampler = NULL,
-                  .imageView = anv_image_view_to_handle(src_iview),
-                  .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-               },
-            }
-         }
-      }, 0, NULL);
-
-   VkFramebuffer fb;
-   anv_CreateFramebuffer(anv_device_to_handle(device),
-      &(VkFramebufferCreateInfo) {
-         .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
-         .attachmentCount = 1,
-         .pAttachments = (VkImageView[]) {
-            anv_image_view_to_handle(dest_iview),
-         },
-         .width = dest_iview->extent.width,
-         .height = dest_iview->extent.height,
-         .layers = 1
-      }, &cmd_buffer->pool->alloc, &fb);
-
-   ANV_CALL(CmdBeginRenderPass)(anv_cmd_buffer_to_handle(cmd_buffer),
-      &(VkRenderPassBeginInfo) {
-         .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-         .renderPass = device->meta_state.blit2d.render_pass,
-         .framebuffer = fb,
-         .renderArea = {
-            .offset = { dest_offset.x, dest_offset.y },
-            .extent = { extent.width, extent.height },
-         },
-         .clearValueCount = 0,
-         .pClearValues = NULL,
-      }, VK_SUBPASS_CONTENTS_INLINE);
-
-   VkPipeline pipeline = device->meta_state.blit2d.pipeline_2d_src;
-
-   if (cmd_buffer->state.pipeline != anv_pipeline_from_handle(pipeline)) {
-      anv_CmdBindPipeline(anv_cmd_buffer_to_handle(cmd_buffer),
-                          VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
-   }
-
-   anv_CmdSetViewport(anv_cmd_buffer_to_handle(cmd_buffer), 0, 1,
-                      &(VkViewport) {
-                        .x = 0.0f,
-                        .y = 0.0f,
-                        .width = dest_iview->extent.width,
-                        .height = dest_iview->extent.height,
-                        .minDepth = 0.0f,
-                        .maxDepth = 1.0f,
-                      });
-
-   anv_CmdBindDescriptorSets(anv_cmd_buffer_to_handle(cmd_buffer),
-                             VK_PIPELINE_BIND_POINT_GRAPHICS,
-                             device->meta_state.blit2d.pipeline_layout, 0, 1,
-                             &set, 0, NULL);
-
-   ANV_CALL(CmdDraw)(anv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
-
-   ANV_CALL(CmdEndRenderPass)(anv_cmd_buffer_to_handle(cmd_buffer));
-
-   /* At the point where we emit the draw call, all data from the
-    * descriptor sets, etc. has been used.  We are free to delete it.
-    */
-   anv_DestroyDescriptorPool(anv_device_to_handle(device),
-                             desc_pool, &cmd_buffer->pool->alloc);
-   anv_DestroyFramebuffer(anv_device_to_handle(device), fb,
-                          &cmd_buffer->pool->alloc);
-}
-
 void
 anv_meta_end_blit2d(struct anv_cmd_buffer *cmd_buffer,
                     struct anv_meta_saved_state *save)
@@ -335,6 +151,7 @@
                 unsigned num_rects,
                 struct anv_meta_blit2d_rect *rects)
 {
+   struct anv_device *device = cmd_buffer->device;
    VkDevice vk_device = anv_device_to_handle(cmd_buffer->device);
    VkImageUsageFlags src_usage = VK_IMAGE_USAGE_SAMPLED_BIT;
    VkImageUsageFlags dst_usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -347,13 +164,175 @@
       create_iview(cmd_buffer, src, &rects[r], src_usage, &src_img, &src_iview);
       create_iview(cmd_buffer, dst, &rects[r], dst_usage, &dst_img, &dst_iview);

-      /* Perform blit */
-      meta_emit_blit2d(cmd_buffer,
-                       &src_iview, src->pitch,
-                       (VkOffset3D){rects[r].src_x, rects[r].src_y, 0},
-                       &dst_iview,
-                       (VkOffset3D){rects[r].dst_x, rects[r].dst_y, 0},
-                       (VkExtent3D){rects[r].width, rects[r].height, 1});
+      struct blit_vb_data {
+         float pos[2];
+         float tex_coord[3];
+      } *vb_data;
+
+      unsigned vb_size = sizeof(struct anv_vue_header) + 3 * sizeof(*vb_data);
+
+      struct anv_state vb_state =
+         anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, vb_size, 16);
+      memset(vb_state.map, 0, sizeof(struct anv_vue_header));
+      vb_data = vb_state.map + sizeof(struct anv_vue_header);
+
+      vb_data[0] = (struct blit_vb_data) {
+         .pos = {
+            rects[r].dst_x + rects[r].width,
+            rects[r].dst_y + rects[r].height,
+         },
+         .tex_coord = {
+            rects[r].src_x + rects[r].width,
+            rects[r].src_y + rects[r].height,
+            src->pitch,
+         },
+      };
+
+      vb_data[1] = (struct blit_vb_data) {
+         .pos = {
+            rects[r].dst_x,
+            rects[r].dst_y + rects[r].height,
+         },
+         .tex_coord = {
+            rects[r].src_x,
+            rects[r].src_y + rects[r].height,
+            src->pitch,
+         },
+      };
+
+      vb_data[2] = (struct blit_vb_data) {
+         .pos = {
+            rects[r].dst_x,
+            rects[r].dst_y,
+         },
+         .tex_coord = {
+            rects[r].src_x,
+            rects[r].src_y,
+            src->pitch,
+         },
+      };
+
+      anv_state_clflush(vb_state);
+
+      struct anv_buffer vertex_buffer = {
+         .device = device,
+         .size = vb_size,
+         .bo = &device->dynamic_state_block_pool.bo,
+         .offset = vb_state.offset,
+      };
+
+      anv_CmdBindVertexBuffers(anv_cmd_buffer_to_handle(cmd_buffer), 0, 2,
+         (VkBuffer[]) {
+            anv_buffer_to_handle(&vertex_buffer),
+            anv_buffer_to_handle(&vertex_buffer)
+         },
+         (VkDeviceSize[]) {
+            0,
+            sizeof(struct anv_vue_header),
+         });
+
+      VkDescriptorPool desc_pool;
+      anv_CreateDescriptorPool(vk_device,
+         &(const VkDescriptorPoolCreateInfo) {
+            .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
+            .pNext = NULL,
+            .flags = 0,
+            .maxSets = 1,
+            .poolSizeCount = 1,
+            .pPoolSizes = (VkDescriptorPoolSize[]) {
+               {
+                  .type = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
+                  .descriptorCount = 1
+               },
+            }
+         }, &cmd_buffer->pool->alloc, &desc_pool);
+
+      VkDescriptorSet set;
+      anv_AllocateDescriptorSets(vk_device,
+         &(VkDescriptorSetAllocateInfo) {
+            .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
+            .descriptorPool = desc_pool,
+            .descriptorSetCount = 1,
+            .pSetLayouts = &device->meta_state.blit2d.ds_layout
+         }, &set);
+
+      anv_UpdateDescriptorSets(vk_device,
+         1, /* writeCount */
+         (VkWriteDescriptorSet[]) {
+            {
+               .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+               .dstSet = set,
+               .dstBinding = 0,
+               .dstArrayElement = 0,
+               .descriptorCount = 1,
+               .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
+               .pImageInfo = (VkDescriptorImageInfo[]) {
+                  {
+                     .sampler = NULL,
+                     .imageView = anv_image_view_to_handle(&src_iview),
+                     .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                  },
+               }
+            }
+         }, 0, NULL);
+
+      VkFramebuffer fb;
+      anv_CreateFramebuffer(vk_device,
+         &(VkFramebufferCreateInfo) {
+            .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
+            .attachmentCount = 1,
+            .pAttachments = (VkImageView[]) {
+               anv_image_view_to_handle(&dst_iview),
+            },
+            .width = dst_iview.extent.width,
+            .height = dst_iview.extent.height,
+            .layers = 1
+         }, &cmd_buffer->pool->alloc, &fb);
+
+      ANV_CALL(CmdBeginRenderPass)(anv_cmd_buffer_to_handle(cmd_buffer),
+         &(VkRenderPassBeginInfo) {
+            .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+            .renderPass = device->meta_state.blit2d.render_pass,
+            .framebuffer = fb,
+            .renderArea = {
+               .offset = { rects[r].dst_x, rects[r].dst_y, },
+               .extent = { rects[r].width, rects[r].height },
+            },
+            .clearValueCount = 0,
+            .pClearValues = NULL,
+         }, VK_SUBPASS_CONTENTS_INLINE);
+
+      VkPipeline pipeline = device->meta_state.blit2d.pipeline_2d_src;
+
+      if (cmd_buffer->state.pipeline != anv_pipeline_from_handle(pipeline)) {
+         anv_CmdBindPipeline(anv_cmd_buffer_to_handle(cmd_buffer),
+                             VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
+      }
+
+      anv_CmdSetViewport(anv_cmd_buffer_to_handle(cmd_buffer), 0, 1,
+                         &(VkViewport) {
+                           .x = 0.0f,
+                           .y = 0.0f,
+                           .width = dst_iview.extent.width,
+                           .height = dst_iview.extent.height,
+                           .minDepth = 0.0f,
+                           .maxDepth = 1.0f,
+                         });
+
+      anv_CmdBindDescriptorSets(anv_cmd_buffer_to_handle(cmd_buffer),
+                                VK_PIPELINE_BIND_POINT_GRAPHICS,
+                                device->meta_state.blit2d.pipeline_layout, 0, 1,
+                                &set, 0, NULL);
+
+      ANV_CALL(CmdDraw)(anv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
+
+      ANV_CALL(CmdEndRenderPass)(anv_cmd_buffer_to_handle(cmd_buffer));
+
+      /* At the point where we emit the draw call, all data from the
+       * descriptor sets, etc. has been used.  We are free to delete it.
+       */
+      anv_DestroyDescriptorPool(vk_device, desc_pool, &cmd_buffer->pool->alloc);
+      anv_DestroyFramebuffer(vk_device, fb, &cmd_buffer->pool->alloc);

       anv_DestroyImage(vk_device, src_img, &cmd_buffer->pool->alloc);
       anv_DestroyImage(vk_device, dst_img, &cmd_buffer->pool->alloc);


Fixed #593 by removing unimplemented method declarations

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@4573 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- io/include/pcl/io/openni_grabber.h
+++ io/include/pcl/io/openni_grabber.h
@@ -138,40 +138,6 @@
       /** \brief Obtain a list of the available image modes that this device supports. */
       std::vector<std::pair<int, XnMapOutputMode> >
       getAvailableImageModes () const;
-
-      /** \brief Set the principal point.
-        * \param[in] cx ...
-        * \param[in] cy ...
-        */
-      void
-      setPrincipalPoint (float cx, float cy);
-
-      /** \brief Set the aspect ratio camera parameter
-        * \param[in] aspect_ratio ...
-        */
-      void
-      setAspectRatio (float aspect_ratio);
-
-      /** \brief Set the focal length camera parameter
-        * \param[in] focal_length ...
-        */
-      void
-      setFocalLength (float focal_length);
-
-      /** \brief Set the lens distortion camera parameter
-        * \param[in] k1 ...
-        * \param[in] k2 ...
-        * \param[in] t1 ...
-        * \param[in] t2 ...
-        */
-      void
-      setLensDistortion (float k1, float k2, float t1, float t2);
-
-      /** \brief Obtain the focal length camera parameter for a given image width
-        * \param[in] image_width the image width to get the focal length for
-        */
-      float
-      getFocalLength (unsigned image_width) const;

     private:
       /** \brief ... */


another thought

another thought

--- Code/StabilizerChain.h
+++ Code/StabilizerChain.h
@@ -14,7 +14,8 @@
 // One idea that would certainly reduce factorization sizes is to use a stabilizer tree, instead of a chain.
 // This would come at high memory cost, unless the tree wasn't as full as it could be.  In any case, the sifting
 // process could make a decision about which branch of the tree to go down in order to minimize collisions with
-// transversal elements.
+// transversal elements.  It might not be hard to modify the Schreier-Sims algorithm to handle a base-tree and
+// generate a stabilizer tree from it.
 class StabilizerChain
 {
 public:


bsd optimalization

bsd optimalization

--- sniffer.c
+++ sniffer.c
@@ -12,7 +12,7 @@
 #include "mutils.h"

 /* packet buffer size */
-#define BUF_SIZE ETH_FRAME_LEN
+#define BUF_SIZE 1500 //ETH_FRAME_LEN (commented because of the BSD compatibility)
 /* buffer for replacement pairs size */
 #define REPL_BUF_SIZE 64


oak: revise warm reset control for rev3

oak: revise warm reset control for rev3

The AP warm reset pin is changed from rev3 of oak board.
PB3 is stuffed before rev3 and connected to PMIC RESET pin to
reset the AP. For rev3, the AP reset mechanism is changed:
PC3 connects to PMIC SYSRSTB, pull PC3 to low, to reset AP.

BRANCH=none
BUG=none
TEST=manual
1. define CONFIG_BOARD_OAK_REV_2 in board.h
   make -j BOARD=oak
2. define CONFIG_BOARD_OAK_REV_3 in board.h
   make -j BOARD=oak
both cases should be built successfully and run "apreset" command.
AP should be reset normally.

Change-Id: I979e93acf755509f8cb7a12dd77eb7c9e7a98ccc
Signed-off-by: Ben Lok <310171a828df105188e0b545d65d6370e8133283@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/289476
Reviewed-by: Rong Chang <3a05493f7adfb36d203f663b3bc2ba30e9d6284f@chromium.org>

--- power/mediatek.c
+++ power/mediatek.c
@@ -265,15 +265,27 @@
 }

 /**
- * Set the PMIC WARM RESET signal.
- *
- * @param asserted	Resetting (=0) or idle (=1)
- */
-static void set_pmic_warm_reset(int asserted)
-{
-	/* Signal is active-high */
-	/* @param asserted: Resetting (=0) or idle (=1) */
-	gpio_set_level(GPIO_PMIC_WARM_RESET_H, asserted);
+ * Set the WARM RESET signal.
+ *
+ * PMIC_WARM_RESET_H (PB3) is stuffed before rev < 3 and connected to PMIC RESET
+ * After rev >= 3, this is removed. This should not effected the new board.
+ *
+ * AP_RESET_L (PC3, CPU_WARM_RESET_L) is stuffed after rev >= 3
+ * and connected to PMIC SYSRSTB
+ *
+ * @param asserted	off (=0) or on (=1)
+ */
+static void set_warm_reset(int asserted)
+{
+	if (system_get_board_version() < 3) {
+		/* Signal is active-high */
+		CPRINTS("pmic warm reset(%d)", asserted);
+		gpio_set_level(GPIO_PMIC_WARM_RESET_H, asserted);
+	} else {
+		/* Signal is active-low */
+		CPRINTS("ap warm reset(%d)", asserted);
+		gpio_set_level(GPIO_AP_RESET_L, !asserted);
+	}
 }

 /**
@@ -565,7 +577,7 @@
 		       GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH);

 	/* Make sure we de-assert and GPIO_PMIC_WARM_RESET_H pin. */
-	set_pmic_warm_reset(0);
+	set_warm_reset(0);

 	/*
 	 * Before we push PMIC power button, wait for the PMI RTC ready, which
@@ -646,10 +658,10 @@
 		set_pmic_pwron(0);
 	} else {
 		CPRINTS("EC triggered warm reboot");
-		set_pmic_warm_reset(1);
+		set_warm_reset(1);
 		usleep(PMIC_WARM_RESET_H_HOLD_TIME);
 		/* deassert the reset signals */
-		set_pmic_warm_reset(0);
+		set_warm_reset(0);
 	}
 }


Bump version to 2.9.1

Bump version to 2.9.1

--- Common/FSAudioStream.h
+++ Common/FSAudioStream.h
@@ -21,7 +21,7 @@
 /**
  * The reversion of the current release
  */
-#define FREESTREAMER_VERSION_REVISION       0
+#define FREESTREAMER_VERSION_REVISION       1

 /**
  * Follow this notification for the audio stream state changes.


concurrentqueue: Fix test (respect changes in wibble library).

--- project/src/concurrentqueue.test.h
+++ project/src/concurrentqueue.test.h
@@ -23,7 +23,7 @@
             q.enqueue( i );
         for ( int i = 0; i < 100; ++i ) {
             auto x = q.tryDequeue();
-            assert( !x.nothing() );
+            assert( !x.isNothing() );
             assert_eq( x.value(), i );
         }
         assert( q.empty() );
@@ -57,7 +57,7 @@
         void operator()() {
             for ( auto &x : last )
                 x = -1;
-            for ( int i = 0; end < last.size(); ++i ) {
+            for ( int i = 0; end < int( last.size() ); ++i ) {
                 auto x = queue.dequeue();
                 assert_leq( -1, x.first );
                 assert_leq( x.first, int( last.size() ) );


Ocfs2/move_extents: helper to validate and adjust moving goal.

First best-effort attempt to validate and adjust the goal (physical address in
block), while it can't guarantee later operation can succeed all the time since
global_bitmap may change a bit over time.

Signed-off-by: Tristan Ye <1c61ece1e0e3e7d92a41e9a901fc3956c7c63903@oracle.com>

--- fs/ocfs2/move_extents.c
+++ fs/ocfs2/move_extents.c
@@ -455,3 +455,64 @@
 	 */
 	return ret;
 }
+
+/*
+ * XXX: helper to validate and adjust moving goal.
+ */
+static int ocfs2_validate_and_adjust_move_goal(struct inode *inode,
+					       struct ocfs2_move_extents *range)
+{
+	int ret, goal_bit = 0;
+
+	struct buffer_head *gd_bh = NULL;
+	struct ocfs2_group_desc *bg;
+	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
+	int c_to_b = 1 << (osb->s_clustersize_bits -
+					inode->i_sb->s_blocksize_bits);
+
+	/*
+	 * validate goal sits within global_bitmap, and return the victim
+	 * group desc
+	 */
+	ret = ocfs2_find_victim_alloc_group(inode, range->me_goal,
+					    GLOBAL_BITMAP_SYSTEM_INODE,
+					    OCFS2_INVALID_SLOT,
+					    &goal_bit, &gd_bh);
+	if (ret)
+		goto out;
+
+	bg = (struct ocfs2_group_desc *)gd_bh->b_data;
+
+	/*
+	 * make goal become cluster aligned.
+	 */
+	if (range->me_goal % c_to_b)
+		range->me_goal = range->me_goal / c_to_b * c_to_b;
+
+	/*
+	 * moving goal is not allowd to start with a group desc blok(#0 blk)
+	 * let's compromise to the latter cluster.
+	 */
+	if (range->me_goal == le64_to_cpu(bg->bg_blkno))
+		range->me_goal += c_to_b;
+
+	/*
+	 * movement is not gonna cross two groups.
+	 */
+	if ((le16_to_cpu(bg->bg_bits) - goal_bit) * osb->s_clustersize <
+								range->me_len) {
+		ret = -EINVAL;
+		goto out;
+	}
+	/*
+	 * more exact validations/adjustments will be performed later during
+	 * moving operation for each extent range.
+	 */
+	mlog(0, "extents get ready to be moved to #%llu block\n",
+	     range->me_goal);
+
+out:
+	brelse(gd_bh);
+
+	return ret;
+}


[fuchsia] Remove unused header file. (#4769)

--- content_handler/rasterizer.h
+++ content_handler/rasterizer.h
@@ -10,7 +10,6 @@
 #include "flutter/flow/layers/layer_tree.h"
 #include "lib/fxl/functional/closure.h"
 #include "lib/fxl/macros.h"
-#include "lib/ui/scenic/fidl/session.fidl.h"
 #include "zircon/system/ulib/zx/include/zx/eventpair.h"

 namespace flutter_runner {