SecurityPkg: AuthVariableLib: Fix GCC compile error

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>

git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@19140 6f19259b-4bc3-4df7-8a09-765794883524

--- SecurityPkg/Library/AuthVariableLib/AuthService.c
+++ SecurityPkg/Library/AuthVariableLib/AuthService.c
@@ -555,10 +555,10 @@
   )
 {
   EFI_STATUS  Status;
-  UINT8       *AuditVarData;
-  UINT8       *DeployedVarData;
-  UINT8       *SetupVarData;
-  UINT8       *SecureBootVarData;
+  VOID        *AuditVarData;
+  VOID        *DeployedVarData;
+  VOID        *SetupVarData;
+  VOID        *SecureBootVarData;
   UINT8       SecureBootEnable;
   UINTN       DataSize;

@@ -693,9 +693,9 @@
   )
 {
   EFI_STATUS  Status;
-  UINT8       *DeployedVarData;
-  UINT8       *SetupVarData;
-  UINT8       *SecureBootVarData;
+  VOID        *DeployedVarData;
+  VOID        *SetupVarData;
+  VOID        *SecureBootVarData;
   UINT8       SecureBootEnable;
   UINTN       DataSize;

@@ -835,11 +835,11 @@
   )
 {
   EFI_STATUS   Status;
-  UINT8        *AuditVarData;
-  UINT8        *DeployedVarData;
-  UINT8        *SetupVarData;
-  UINT8        *PkVarData;
-  UINT8        *SecureBootVarData;
+  VOID         *AuditVarData;
+  VOID         *DeployedVarData;
+  VOID         *SetupVarData;
+  VOID         *PkVarData;
+  VOID         *SecureBootVarData;
   UINT8        SecureBootEnable;
   UINTN        DataSize;
   VARIABLE_ENTRY_CONSISTENCY  VariableEntry;
@@ -1034,9 +1034,9 @@
   )
 {
   EFI_STATUS   Status;
-  UINT8        *AuditVarData;
-  UINT8        *SetupVarData;
-  UINT8        *SecureBootVarData;
+  VOID         *AuditVarData;
+  VOID         *SetupVarData;
+  VOID         *SecureBootVarData;
   UINT8        SecureBootEnable;
   UINTN        DataSize;

@@ -1746,7 +1746,7 @@
   )
 {
   EFI_STATUS    Status;
-  UINT8         *VarData;
+  VOID          *VarData;
   UINTN         VarDataSize;

   //
@@ -1801,7 +1801,7 @@
   //
   // If AuditMode/DeployedMode is assigned same value. Simply return EFI_SUCCESS
   //
-  if (*VarData == *(UINT8 *)Data) {
+  if (*(UINT8 *)VarData == *(UINT8 *)Data) {
     return EFI_SUCCESS;
   }


Fixed SIGSEGV (turned it into an exception) in extrapolate_mask

--- bob/ip/base/include/bob.ip.base/Affine.h
+++ bob/ip/base/include/bob.ip.base/Affine.h
@@ -399,6 +399,10 @@
     blitz::Array<bool,1> column_true(blitz::any(src_mask(j,i), j) );
     int true_min_index=blitz::first(column_true);
     int true_max_index=blitz::last(column_true);
+
+    if (true_min_index < 0 || true_max_index < 0){
+      throw std::runtime_error("The given mask is invalid as it contains only 'False' values.");
+    }

     // Extrapolate the "non false" columns
     for(int jj=true_min_index; jj<=true_max_index; ++jj)
@@ -571,4 +575,3 @@
 } } } // namespaces

 #endif // BOB_IP_BASE_AFFINE_H
-


librender: speed up slice array iteration

--- software/librender/SliceArray.h
+++ software/librender/SliceArray.h
@@ -147,27 +147,32 @@
 			{
 				fIndex = 0;
 				fBucket++;
+				fPtr = fArray->fBuckets[fBucket];
 			}
+			else
+				fPtr++;

 			return *this;
 		}

 		T& operator*() const
 		{
-			return fArray->fBuckets[fBucket][fIndex];
+			return *fPtr;
 		}

 	private:
 		iterator(SliceArray *array, int bucket, int index)
 			: 	fArray(array),
 				fBucket(bucket),
-				fIndex(index)
+				fIndex(index),
+				fPtr(fArray->fBuckets[fBucket])
 		{}

 		SliceArray *fArray;
 		int fBucket;
 		int fIndex;
 		friend class SliceArray;
+		T *fPtr;
 	};

 	iterator begin()


set mmap pragma for sqlite backend

set mmap pragma for sqlite backend

--- source/functions/sqlite.c
+++ source/functions/sqlite.c
@@ -28,6 +28,7 @@
 #define ALLCLUSTER_SQL "select distinct cluster from clusters"
 #define CLUSTERS_SQL "select distinct cluster from expanded_reverse_clusters where node LIKE ? and key LIKE 'CLUSTER'"
 #define MEM_SQL "select distinct key from expanded_reverse_clusters where cluster LIKE ? and node LIKE ?"
+#define MMAP_PRAGMA_SQL "PRAGMA mmap_size=268435456"
 #define EMPTY_STRING ""

@@ -35,6 +36,7 @@
 {
     char * sqlite_db_path;
     sqlite3* db;
+    sqlite3_stmt* stmt;
     libcrange* lr = range_request_lr(rr);
     int err;

@@ -48,6 +50,18 @@
           return NULL;
         }
         assert(err == SQLITE_OK);
+        /* set mmap pragma */
+        err = sqlite3_prepare(db, MMAP_PRAGMA_SQL, strlen(MMAP_PRAGMA_SQL), &stmt, NULL);
+        if (err != SQLITE_OK) {
+          range_request_warn(rr, "allclusters(): cannot query sqlite db");
+          return NULL;
+        }
+        assert(err == SQLITE_OK);
+        while(sqlite3_step(stmt) == SQLITE_ROW) {
+            // do nothing. Is this even necessary for the mmap_size pragma? docs are unclear
+        }
+        /* end mmap pragma setup */
+
         libcrange_set_cache(lr, "sqlite:nodes", db);
     }


Removed the EXT from some GL_TEXTURE calls that are no longer extensions and which I missed changing over on v1.15

--- source/graphics/texture.c
+++ source/graphics/texture.c
@@ -3643,11 +3643,10 @@
 			glCallList(texture->display_list);
 			/* SAB There seems to be some problem with losing a bound texture,
 				this tries to correct this */
-#if defined (GL_EXT_texture_object)
 			/* If using texture_objects then we need to check that the texture
 				is still resident */
 			glGetTexParameteriv(GL_TEXTURE_2D,
-				GL_TEXTURE_RESIDENT_EXT,
+				GL_TEXTURE_RESIDENT,
 				&resident);
 			if(GL_TRUE != resident)
 			{
@@ -3664,7 +3663,6 @@
 					direct_render_Texture(texture);
 				}
 			}
-#endif /* defined (GL_EXT_texture_object) */
 			return_code=1;
 #else /* defined (OPENGL_API) */
 			display_message(ERROR_MESSAGE,


use dev->dmat.  Missed this one in an earlier diff.

--- dev/pci/drm/i915_dma.c
+++ dev/pci/drm/i915_dma.c
@@ -144,7 +144,7 @@

 	/* Clear the HWS virtual address at teardown */
 	if (I915_NEED_GFX_HWS(dev_priv))
-		i915_free_hws(dev_priv, dev->pa.pa_dmat);
+		i915_free_hws(dev_priv, dev->dmat);

 	return 0;
 }


Iopoolification. Tested by mcbride@, dlg@, and Gabriel Kihlman on tech@.

ok dlg@

--- dev/sdmmc/sdmmc_scsi.c
+++ dev/sdmmc/sdmmc_scsi.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: sdmmc_scsi.c,v 1.25 2010/08/24 14:52:23 blambert Exp $	*/
+/*	$OpenBSD: sdmmc_scsi.c,v 1.26 2010/10/25 10:36:49 krw Exp $	*/

 /*
  * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -70,12 +70,14 @@
 	struct sdmmc_ccb *sc_ccbs;		/* allocated ccbs */
 	struct sdmmc_ccb_list sc_ccb_freeq;	/* free ccbs */
 	struct sdmmc_ccb_list sc_ccb_runq;	/* queued ccbs */
+	struct mutex sc_ccb_mtx;
+	struct scsi_iopool sc_iopool;
 };

 int	sdmmc_alloc_ccbs(struct sdmmc_scsi_softc *, int);
 void	sdmmc_free_ccbs(struct sdmmc_scsi_softc *);
-struct sdmmc_ccb *sdmmc_get_ccb(struct sdmmc_scsi_softc *, int);
-void	sdmmc_put_ccb(struct sdmmc_ccb *);
+void	*sdmmc_ccb_alloc(void *);
+void	sdmmc_ccb_free(void *, void *);

 void	sdmmc_scsi_cmd(struct scsi_xfer *);
 void	sdmmc_start_xs(struct sdmmc_softc *, struct sdmmc_ccb *);
@@ -133,6 +135,7 @@
 	scbus->sc_link.luns = 1;
 	scbus->sc_link.openings = 1;
 	scbus->sc_link.adapter = &scbus->sc_adapter;
+	scbus->sc_link.pool = &scbus->sc_iopool;

 	bzero(&saa, sizeof(saa));
 	saa.scsi_link = &scbus->sc_link;
@@ -200,6 +203,9 @@

 	TAILQ_INIT(&scbus->sc_ccb_freeq);
 	TAILQ_INIT(&scbus->sc_ccb_runq);
+	mtx_init(&scbus->sc_ccb_mtx, IPL_BIO);
+	scsi_iopool_init(&scbus->sc_iopool, scbus, sdmmc_ccb_alloc,
+	    sdmmc_ccb_free);

 	for (i = 0; i < nccbs; i++) {
 		ccb = &scbus->sc_ccbs[i];
@@ -222,40 +228,42 @@
 	}
 }

-struct sdmmc_ccb *
-sdmmc_get_ccb(struct sdmmc_scsi_softc *scbus, int flags)
-{
+void *
+sdmmc_ccb_alloc(void *xscbus)
+{
+	struct sdmmc_scsi_softc *scbus = xscbus;
 	struct sdmmc_ccb *ccb;
-	int s;
-
-	s = splbio();
-	while ((ccb = TAILQ_FIRST(&scbus->sc_ccb_freeq)) == NULL &&
-	    !ISSET(flags, SCSI_NOSLEEP))
-		tsleep(&scbus->sc_ccb_freeq, PRIBIO, "getccb", 0);
+
+	mtx_enter(&scbus->sc_ccb_mtx);
+	ccb = TAILQ_FIRST(&scbus->sc_ccb_freeq);
 	if (ccb != NULL) {
 		TAILQ_REMOVE(&scbus->sc_ccb_freeq, ccb, ccb_link);
 		ccb->ccb_state = SDMMC_CCB_READY;
 	}
-	splx(s);
+	mtx_leave(&scbus->sc_ccb_mtx);
+
 	return ccb;
 }

 void
-sdmmc_put_ccb(struct sdmmc_ccb *ccb)
-{
-	struct sdmmc_scsi_softc *scbus = ccb->ccb_scbus;
+sdmmc_ccb_free(void *xscbus, void *xccb)
+{
+	struct sdmmc_scsi_softc *scbus = xscbus;
+	struct sdmmc_ccb *ccb = xccb;
 	int s;

 	s = splbio();
 	if (ccb->ccb_state == SDMMC_CCB_QUEUED)
 		TAILQ_REMOVE(&scbus->sc_ccb_runq, ccb, ccb_link);
+	splx(s);
+
 	ccb->ccb_state = SDMMC_CCB_FREE;
 	ccb->ccb_flags = 0;
 	ccb->ccb_xs = NULL;
+
+	mtx_enter(&scbus->sc_ccb_mtx);
 	TAILQ_INSERT_TAIL(&scbus->sc_ccb_freeq, ccb, ccb_link);
-	if (TAILQ_NEXT(ccb, ccb_link) == NULL)
-		wakeup(&scbus->sc_ccb_freeq);
-	splx(s);
+	mtx_leave(&scbus->sc_ccb_mtx);
 }

 /*
@@ -366,16 +374,9 @@
 		return;
 	}

-	ccb = sdmmc_get_ccb(sc->sc_scsibus, xs->flags);
-	if (ccb == NULL) {
-		printf("%s: out of ccbs\n", DEVNAME(sc));
-		xs->error = XS_DRIVER_STUFFUP;
-		scsi_done(xs);
-		return;
-	}
+	ccb = xs->io;

 	ccb->ccb_xs = xs;
-
 	ccb->ccb_blockcnt = blockcnt;
 	ccb->ccb_blockno = blockno;

@@ -458,7 +459,6 @@
 	if (ISSET(ccb->ccb_flags, SDMMC_CCB_F_ERR))
 		xs->error = XS_DRIVER_STUFFUP;

-	sdmmc_put_ccb(ccb);
 	scsi_done(xs);
 }


Set the ANDROID_APP_PATH env var in start.c

--- bootstrap_templates/sdl2/jni/src/start.c
+++ bootstrap_templates/sdl2/jni/src/start.c
@@ -71,6 +71,7 @@

     setenv("ANDROID_ARGUMENT", env_argument, 1);
     setenv("ANDROID_PRIVATE", env_argument, 1);
+    setenv("ANDROID_APP_PATH", env_argument, 1);
     setenv("PYTHONHOME", env_argument, 1);
     setenv("PYTHONPATH", "/data/data/net.inclem.android/files:/data/data/net.inclem.android/files/lib", 1);

@@ -95,7 +96,7 @@
     initandroidembed();

     LOG("AND: Init embed");
-
+
     /* inject our bootstrap code to redirect python stdin/stdout
      * replace sys.path with our path
      */


Forgot this one, sorry, reported by maja@.

--- dev/usb/if_urndisreg.h
+++ dev/usb/if_urndisreg.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: if_urndisreg.h,v 1.7 2010/03/04 20:23:45 armani Exp $ */
+/*	$OpenBSD: if_urndisreg.h,v 1.8 2010/03/06 19:04:57 armani Exp $ */

 /*
  * Copyright (c) 2010 Jonathan Armani <dbd@asystant.net>
@@ -45,6 +45,7 @@
 struct urndis_softc {
 	struct device			sc_dev;

+	char				sc_attached;
 	int				sc_dying;
 	struct arpcom			sc_arpcom;


regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode function

We already know the mask in lp8788_init_dvs() function, and we can update
the corresponding bit for default_dvs_mode in lp8788_init_dvs() function.
This function looks not necessary to me.

Signed-off-by: Axel Lin <b6ffd6973e972cb999e8e535ab74da7fee0c035f@gmail.com>
Acked-by: Milo(Woogyom) Kim <44ea671b8b7a8196e0a2fe07b01cac0858e18926@ti.com>
Tested-by: Milo(Woogyom) Kim <44ea671b8b7a8196e0a2fe07b01cac0858e18926@ti.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- drivers/regulator/lp8788-buck.c
+++ drivers/regulator/lp8788-buck.c
@@ -459,27 +459,6 @@
 	},
 };

-static int lp8788_set_default_dvs_ctrl_mode(struct lp8788 *lp,
-					enum lp8788_buck_id id)
-{
-	u8 mask, val;
-
-	switch (id) {
-	case BUCK1:
-		mask = LP8788_BUCK1_DVS_SEL_M;
-		val  = LP8788_BUCK1_DVS_I2C;
-		break;
-	case BUCK2:
-		mask = LP8788_BUCK2_DVS_SEL_M;
-		val  = LP8788_BUCK2_DVS_I2C;
-		break;
-	default:
-		return 0;
-	}
-
-	return lp8788_update_bits(lp, LP8788_BUCK_DVS_SEL, mask, val);
-}
-
 static int _gpio_request(struct lp8788_buck *buck, int gpio, char *name)
 {
 	struct device *dev = buck->lp->dev;
@@ -530,6 +509,7 @@
 	struct lp8788_platform_data *pdata = buck->lp->pdata;
 	u8 mask[] = { LP8788_BUCK1_DVS_SEL_M, LP8788_BUCK2_DVS_SEL_M };
 	u8 val[]  = { LP8788_BUCK1_DVS_PIN, LP8788_BUCK2_DVS_PIN };
+	u8 default_dvs_mode[] = { LP8788_BUCK1_DVS_I2C, LP8788_BUCK2_DVS_I2C };

 	/* no dvs for buck3, 4 */
 	if (id == BUCK3 || id == BUCK4)
@@ -550,7 +530,8 @@
 				val[id]);

 set_default_dvs_mode:
-	return lp8788_set_default_dvs_ctrl_mode(buck->lp, id);
+	return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id],
+				  default_dvs_mode[id]);
 }

 static __devinit int lp8788_buck_probe(struct platform_device *pdev)


[S390] sclp: remove unnecessary sendmask check

The sendmask check is not needed. Remove it.

Signed-off-by: Heiko Carstens <8dcf0f69152f32f23184f83357a3731522e56b9c@de.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>

--- drivers/s390/char/sclp_config.c
+++ drivers/s390/char/sclp_config.c
@@ -71,21 +71,9 @@

 static int __init sclp_conf_init(void)
 {
-	int rc;
-
 	INIT_WORK(&sclp_cpu_capability_work, sclp_cpu_capability_notify);
 	INIT_WORK(&sclp_cpu_change_work, sclp_cpu_change_notify);
-
-	rc = sclp_register(&sclp_conf_register);
-	if (rc)
-		return rc;
-
-	if (!(sclp_conf_register.sclp_send_mask & EVTYP_CONFMGMDATA_MASK)) {
-		pr_warning("no configuration management.\n");
-		sclp_unregister(&sclp_conf_register);
-		rc = -ENOSYS;
-	}
-	return rc;
+	return sclp_register(&sclp_conf_register);
 }

 __initcall(sclp_conf_init);


[SCSI] be2iscsi: Fix to handle request_irq failure

This patch handles request_irq failures  by properly cleaning up

Signed-off-by: Jayamohan Kallickal <7eb5c2835a16c01af5a9ffad94772756d08fe351@serverengines.com>
Reviewed-by: Mike Christie <6fe105eefab41990d7ec714c6c25ade3095cdb48@cs.wisc.edu>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>

--- drivers/scsi/be2iscsi/be_main.c
+++ drivers/scsi/be2iscsi/be_main.c
@@ -616,7 +616,7 @@
 	struct pci_dev *pcidev = phba->pcidev;
 	struct hwi_controller *phwi_ctrlr;
 	struct hwi_context_memory *phwi_context;
-	int ret, msix_vec, i = 0;
+	int ret, msix_vec, i, j;
 	char desc[32];

 	phwi_ctrlr = phba->phwi_ctrlr;
@@ -628,10 +628,25 @@
 			msix_vec = phba->msix_entries[i].vector;
 			ret = request_irq(msix_vec, be_isr_msix, 0, desc,
 					  &phwi_context->be_eq[i]);
+			if (ret) {
+				shost_printk(KERN_ERR, phba->shost,
+					     "beiscsi_init_irqs-Failed to"
+					     "register msix for i = %d\n", i);
+				if (!i)
+					return ret;
+				goto free_msix_irqs;
+			}
 		}
 		msix_vec = phba->msix_entries[i].vector;
 		ret = request_irq(msix_vec, be_isr_mcc, 0, "beiscsi_msix_mcc",
 				  &phwi_context->be_eq[i]);
+		if (ret) {
+			shost_printk(KERN_ERR, phba->shost, "beiscsi_init_irqs-"
+				     "Failed to register beiscsi_msix_mcc\n");
+			i++;
+			goto free_msix_irqs;
+		}
+
 	} else {
 		ret = request_irq(pcidev->irq, be_isr, IRQF_SHARED,
 				  "beiscsi", phba);
@@ -642,6 +657,10 @@
 		}
 	}
 	return 0;
+free_msix_irqs:
+	for (j = i - 1; j == 0; j++)
+		free_irq(msix_vec, &phwi_context->be_eq[j]);
+	return ret;
 }

 static void hwi_ring_cq_db(struct beiscsi_hba *phba,


[SCSI] qla2xxx: Use pci_disable_rom() to manipulate PCI config space.

http://bugzilla.kernel.org/show_bug.cgi?id=9422

Signed-off-by: Andrew Vasquez <67840a4977006af7f584bdc4c86d7243c1629cad@qlogic.com>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@HansenPartnership.com>

--- drivers/scsi/qla2xxx/qla_init.c
+++ drivers/scsi/qla2xxx/qla_init.c
@@ -140,7 +140,6 @@
 qla2100_pci_config(scsi_qla_host_t *ha)
 {
 	uint16_t w;
-	uint32_t d;
 	unsigned long flags;
 	struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;

@@ -151,10 +150,7 @@
 	w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
 	pci_write_config_word(ha->pdev, PCI_COMMAND, w);

-	/* Reset expansion ROM address decode enable */
-	pci_read_config_dword(ha->pdev, PCI_ROM_ADDRESS, &d);
-	d &= ~PCI_ROM_ADDRESS_ENABLE;
-	pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d);
+	pci_disable_rom(ha->pdev);

 	/* Get PCI bus information. */
 	spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -174,7 +170,6 @@
 qla2300_pci_config(scsi_qla_host_t *ha)
 {
 	uint16_t	w;
-	uint32_t	d;
 	unsigned long   flags = 0;
 	uint32_t	cnt;
 	struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
@@ -236,10 +231,7 @@

 	pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80);

-	/* Reset expansion ROM address decode enable */
-	pci_read_config_dword(ha->pdev, PCI_ROM_ADDRESS, &d);
-	d &= ~PCI_ROM_ADDRESS_ENABLE;
-	pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d);
+	pci_disable_rom(ha->pdev);

 	/* Get PCI bus information. */
 	spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -259,7 +251,6 @@
 qla24xx_pci_config(scsi_qla_host_t *ha)
 {
 	uint16_t w;
-	uint32_t d;
 	unsigned long flags = 0;
 	struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;

@@ -281,10 +272,7 @@
 	if (pci_find_capability(ha->pdev, PCI_CAP_ID_EXP))
 		pcie_set_readrq(ha->pdev, 2048);

-	/* Reset expansion ROM address decode enable */
-	pci_read_config_dword(ha->pdev, PCI_ROM_ADDRESS, &d);
-	d &= ~PCI_ROM_ADDRESS_ENABLE;
-	pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d);
+	pci_disable_rom(ha->pdev);

 	ha->chip_revision = ha->pdev->revision;

@@ -306,7 +294,6 @@
 qla25xx_pci_config(scsi_qla_host_t *ha)
 {
 	uint16_t w;
-	uint32_t d;

 	pci_set_master(ha->pdev);
 	pci_try_set_mwi(ha->pdev);
@@ -320,10 +307,7 @@
 	if (pci_find_capability(ha->pdev, PCI_CAP_ID_EXP))
 		pcie_set_readrq(ha->pdev, 2048);

-	/* Reset expansion ROM address decode enable */
-	pci_read_config_dword(ha->pdev, PCI_ROM_ADDRESS, &d);
-	d &= ~PCI_ROM_ADDRESS_ENABLE;
-	pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d);
+	pci_disable_rom(ha->pdev);

 	ha->chip_revision = ha->pdev->revision;


staging: cxt1e1: musycc.c: Return negative error codes

Return negative error codes as is followed in the rest of the
kernel.

Signed-off-by: Sachin Kamat <1c3b1584a6008857f36c03c58f657c0fc16fc09e@linaro.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


Staging: hv: blkvsc_drv: Get rid of the indirection for invoking io request

Signed-off-by: K. Y. Srinivasan <bcbf172338421f26297a2592698edf8cc84ecbef@microsoft.com>
Signed-off-by: Haiyang Zhang <6c26c5044f1d67d9ed5db6596adb36d25510e216@microsoft.com>
Signed-off-by: Abhishek Kane <a6f940ddb8198bd6787d8a32aef6daff28b15d2f@microsoft.com>
Signed-off-by: Hank Janssen <e6f1dacc1d794bd13c3a15bd13b25100c5d4d1f8@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/hv/blkvsc_drv.c
+++ drivers/staging/hv/blkvsc_drv.c
@@ -195,8 +195,6 @@
 	DPRINT_INFO(BLKVSC, "max io outstd %u",
 		    stor_driver->max_outstanding_req_per_channel);

-	/* Setup the dispatch table */
-	stor_driver->on_io_request = storvsc_do_io;

 	return ret;
 }
@@ -206,9 +204,6 @@
 			void (*request_completion)(struct hv_storvsc_request *))
 {
 	struct block_device_context *blkdev = blkvsc_req->dev;
-	struct hv_device *device_ctx = blkdev->device_ctx;
-	struct storvsc_driver *storvsc_drv =
-			drv_to_stordrv(device_ctx->device.driver);
 	struct hv_storvsc_request *storvsc_req;
 	struct vmscsi_request *vm_srb;
 	int ret;
@@ -233,7 +228,7 @@

 	storvsc_req->sense_buffer = blkvsc_req->sense_buffer;

-	ret = storvsc_drv->on_io_request(blkdev->device_ctx,
+	ret =  storvsc_do_io(blkdev->device_ctx,
 					   &blkvsc_req->request);
 	if (ret == 0)
 		blkdev->num_outstanding_reqs++;


staging/winbond: use err and remove nr

staging/winbond: use err and remove nr

err can be used get return status of the  usb_control_msg, rather using
nr and assigning it to err when the function returns error.

Signed-off-by: Devendra Naga <97fdf9fb34d40445b99f4e064a18057cd6e2bccb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/winbond/wbusb.c
+++ drivers/staging/winbond/wbusb.c
@@ -747,20 +747,18 @@
 	struct usb_host_interface *interface;
 	struct ieee80211_hw *dev;
 	struct wbsoft_priv *priv;
-	int nr, err;
+	int err;
 	u32 ltmp;

 	usb_get_dev(udev);

 	/* Check the device if it already be opened */
-	nr = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+	err = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
 			     0x01,
 			     USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 			     0x0, 0x400, &ltmp, 4, HZ * 100);
-	if (nr < 0) {
-		err = nr;
+	if (err < 0)
 		goto error;
-	}

 	/* Is already initialized? */
 	ltmp = cpu_to_le32(ltmp);


zram: fix invalid memory access

zram: fix invalid memory access

[1] tried to fix invalid memory access on zram->disk but it didn't
fix properly because get_disk failed during module exit path.

Actually, we don't need to reset zram->disk's capacity to zero
in module exit path so that this patch introduces new argument
"reset_capacity" on zram_reset_divice and it only reset it when
reset_store is called.

[1] 6030ea9b,  zram: avoid invalid memory access in zram_exit()

Change-Id: I6616ac8f82aab6d03a47f3cfb91d28a825e6e3a6
Cc: Nitin Gupta <cc4fec8a34766005dd45d48be045c08d736c11ed@vflare.org>
Cc: Jiang Liu <68ee766e574f18b34b683085865827393efe88bd@huawei.com>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Signed-off-by: Minchan Kim <eee62f459f15dcddf87a8df69e8328e2a2562028@kernel.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>
Git-commit: 2b86ab9cc29fcd435cde9378c3b9ffe8b5c76128
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Olav Haugan <fbf4ddd114d5f0aa83cb721b7dacab8a264ccf22@codeaurora.org>

--- drivers/staging/zram/zram_drv.c
+++ drivers/staging/zram/zram_drv.c
@@ -523,7 +523,7 @@
 	return ret;
 }

-static void zram_reset_device(struct zram *zram)
+static void zram_reset_device(struct zram *zram, bool reset_capacity)
 {
 	size_t index;
 	struct zram_meta *meta;
@@ -552,7 +552,8 @@
 	memset(&zram->stats, 0, sizeof(zram->stats));

 	zram->disksize = 0;
-	set_capacity(zram->disk, 0);
+	if (reset_capacity)
+		set_capacity(zram->disk, 0);
 	up_write(&zram->init_lock);
 }

@@ -636,7 +637,7 @@
 	if (bdev)
 		fsync_bdev(bdev);

-	zram_reset_device(zram);
+	zram_reset_device(zram, true);
 	return len;
 }

@@ -903,10 +904,12 @@
 	for (i = 0; i < num_devices; i++) {
 		zram = &zram_devices[i];

-		get_disk(zram->disk);
 		destroy_device(zram);
-		zram_reset_device(zram);
-		put_disk(zram->disk);
+		/*
+		 * Shouldn't access zram->disk after destroy_device
+		 * because destroy_device already released zram->disk.
+		 */
+		zram_reset_device(zram, false);
 	}

 	unregister_blkdev(zram_major, "zram");


serial: pl011: (cosmetic) remove superfluous register write

In pl011_rx_chars() if pl011_dma_rx_trigger_dma() succeeds it will disable
the receive interrupt, no need to do this again.

Signed-off-by: Guennadi Liakhovetski <50875182aae23d69ca7738697596f18a14e926fc@gmx.de>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


usb: r8a66597-hcd: fix up error path.

usb: r8a66597-hcd: fix up error path.

Currently when registration fails we're left with a stray reference to
release_mem_region(), this leads to the following case:

    r8a66597_hcd r8a66597_hcd: irq 13, io base 0x18040000
    drivers/usb/host/r8a66597-hcd.c: register access fail.
    r8a66597_hcd r8a66597_hcd: startup error -6
    r8a66597_hcd r8a66597_hcd: USB bus 1 deregistered
    drivers/usb/host/r8a66597-hcd.c: Failed to add hcd
    Trying to free nonexistent resource <0000000018040000-0000000018040000>

This fixes it up.

Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/host/r8a66597-hcd.c
+++ drivers/usb/host/r8a66597-hcd.c
@@ -2208,8 +2208,6 @@
 clean_up:
 	if (reg)
 		iounmap(reg);
-	if (res)
-		release_mem_region(res->start, 1);

 	return ret;
 }


OMAPDSS: APPLY: rename overlay_cache_data

overlay_cache_data is not a suitable name for the struct. It is more of
a private data for the overlay.

Rename the struct to ovl_priv_data, and add a function,
get_ovl_priv(ovl), to get a pointer to the data.

Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@ti.com>

--- drivers/video/omap2/dss/apply.c
+++ drivers/video/omap2/dss/apply.c
@@ -54,7 +54,7 @@
  * +--------------------+
  */

-struct overlay_cache_data {
+struct ovl_priv_data {
 	/* If true, cache changed, but not written to shadow registers. Set
 	 * in apply(), cleared when registers written. */
 	bool dirty;
@@ -90,11 +90,16 @@

 static struct {
 	spinlock_t lock;
-	struct overlay_cache_data overlay_cache[MAX_DSS_OVERLAYS];
+	struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS];
 	struct manager_cache_data manager_cache[MAX_DSS_MANAGERS];

 	bool irq_enabled;
 } dss_cache;
+
+static struct ovl_priv_data *get_ovl_priv(struct omap_overlay *ovl)
+{
+	return &dss_cache.ovl_priv_data_array[ovl->id];
+}

 void dss_apply_init(void)
 {
@@ -177,7 +182,7 @@
 int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
 {
 	unsigned long timeout = msecs_to_jiffies(500);
-	struct overlay_cache_data *oc;
+	struct ovl_priv_data *op;
 	struct omap_dss_device *dssdev;
 	u32 irq;
 	int r;
@@ -196,15 +201,15 @@

 	irq = dispc_mgr_get_vsync_irq(ovl->manager->id);

-	oc = &dss_cache.overlay_cache[ovl->id];
+	op = get_ovl_priv(ovl);
 	i = 0;
 	while (1) {
 		unsigned long flags;
 		bool shadow_dirty, dirty;

 		spin_lock_irqsave(&dss_cache.lock, flags);
-		dirty = oc->dirty;
-		shadow_dirty = oc->shadow_dirty;
+		dirty = op->dirty;
+		shadow_dirty = op->shadow_dirty;
 		spin_unlock_irqrestore(&dss_cache.lock, flags);

 		if (!dirty && !shadow_dirty) {
@@ -239,17 +244,17 @@

 static int dss_ovl_write_regs(struct omap_overlay *ovl)
 {
-	struct overlay_cache_data *c;
+	struct ovl_priv_data *op;
 	struct omap_overlay_info *oi;
 	bool ilace, replication;
 	int r;

 	DSSDBGF("%d", ovl->id);

-	c = &dss_cache.overlay_cache[ovl->id];
-	oi = &c->info;
-
-	if (!c->enabled) {
+	op = get_ovl_priv(ovl);
+	oi = &op->info;
+
+	if (!op->enabled) {
 		dispc_ovl_enable(ovl->id, 0);
 		return 0;
 	}
@@ -258,7 +263,7 @@

 	ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC;

-	dispc_ovl_set_channel_out(ovl->id, c->channel);
+	dispc_ovl_set_channel_out(ovl->id, op->channel);

 	r = dispc_ovl_setup(ovl->id, oi, ilace, replication);
 	if (r) {
@@ -268,7 +273,7 @@
 		return r;
 	}

-	dispc_ovl_set_fifo_threshold(ovl->id, c->fifo_low, c->fifo_high);
+	dispc_ovl_set_fifo_threshold(ovl->id, op->fifo_low, op->fifo_high);

 	dispc_ovl_enable(ovl->id, 1);

@@ -294,7 +299,7 @@
 {
 	struct omap_overlay *ovl;
 	struct omap_overlay_manager *mgr;
-	struct overlay_cache_data *oc;
+	struct ovl_priv_data *op;
 	struct manager_cache_data *mc;
 	const int num_ovls = dss_feat_get_num_ovls();
 	const int num_mgrs = dss_feat_get_num_mgrs();
@@ -315,16 +320,16 @@
 	/* Commit overlay settings */
 	for (i = 0; i < num_ovls; ++i) {
 		ovl = omap_dss_get_overlay(i);
-		oc = &dss_cache.overlay_cache[i];
-		mc = &dss_cache.manager_cache[oc->channel];
-
-		if (!oc->dirty)
+		op = get_ovl_priv(ovl);
+		mc = &dss_cache.manager_cache[op->channel];
+
+		if (!op->dirty)
 			continue;

 		if (mc->manual_update && !mc->do_manual_update)
 			continue;

-		if (mgr_busy[oc->channel]) {
+		if (mgr_busy[op->channel]) {
 			busy = true;
 			continue;
 		}
@@ -333,9 +338,9 @@
 		if (r)
 			DSSERR("dss_ovl_write_regs %d failed\n", i);

-		oc->dirty = false;
-		oc->shadow_dirty = true;
-		mgr_go[oc->channel] = true;
+		op->dirty = false;
+		op->shadow_dirty = true;
+		mgr_go[op->channel] = true;
 	}

 	/* Commit manager settings */
@@ -385,7 +390,7 @@
 void dss_mgr_start_update(struct omap_overlay_manager *mgr)
 {
 	struct manager_cache_data *mc;
-	struct overlay_cache_data *oc;
+	struct ovl_priv_data *op;
 	struct omap_overlay *ovl;

 	mc = &dss_cache.manager_cache[mgr->id];
@@ -395,8 +400,8 @@
 	mc->do_manual_update = false;

 	list_for_each_entry(ovl, &mgr->overlays, list) {
-		oc = &dss_cache.overlay_cache[ovl->id];
-		oc->shadow_dirty = false;
+		op = get_ovl_priv(ovl);
+		op->shadow_dirty = false;
 	}

 	mc = &dss_cache.manager_cache[mgr->id];
@@ -441,8 +446,9 @@

 static void dss_apply_irq_handler(void *data, u32 mask)
 {
+	struct omap_overlay *ovl;
 	struct manager_cache_data *mc;
-	struct overlay_cache_data *oc;
+	struct ovl_priv_data *op;
 	const int num_ovls = dss_feat_get_num_ovls();
 	const int num_mgrs = dss_feat_get_num_mgrs();
 	int i, r;
@@ -454,9 +460,10 @@
 	spin_lock(&dss_cache.lock);

 	for (i = 0; i < num_ovls; ++i) {
-		oc = &dss_cache.overlay_cache[i];
-		if (!mgr_busy[oc->channel])
-			oc->shadow_dirty = false;
+		ovl = omap_dss_get_overlay(i);
+		op = get_ovl_priv(ovl);
+		if (!mgr_busy[op->channel])
+			op->shadow_dirty = false;
 	}

 	for (i = 0; i < num_mgrs; ++i) {
@@ -488,10 +495,10 @@

 static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
 {
-	struct overlay_cache_data *oc;
+	struct ovl_priv_data *op;
 	struct omap_dss_device *dssdev;

-	oc = &dss_cache.overlay_cache[ovl->id];
+	op = get_ovl_priv(ovl);

 	if (ovl->manager_changed) {
 		ovl->manager_changed = false;
@@ -499,9 +506,9 @@
 	}

 	if (!overlay_enabled(ovl)) {
-		if (oc->enabled) {
-			oc->enabled = false;
-			oc->dirty = true;
+		if (op->enabled) {
+			op->enabled = false;
+			op->dirty = true;
 		}
 		return 0;
 	}
@@ -512,20 +519,20 @@
 	dssdev = ovl->manager->device;

 	if (dss_check_overlay(ovl, dssdev)) {
-		if (oc->enabled) {
-			oc->enabled = false;
-			oc->dirty = true;
+		if (op->enabled) {
+			op->enabled = false;
+			op->dirty = true;
 		}
 		return -EINVAL;
 	}

 	ovl->info_dirty = false;
-	oc->dirty = true;
-	oc->info = ovl->info;
-
-	oc->channel = ovl->manager->id;
-
-	oc->enabled = true;
+	op->dirty = true;
+	op->info = ovl->info;
+
+	op->channel = ovl->manager->id;
+
+	op->enabled = true;

 	return 0;
 }
@@ -556,13 +563,13 @@

 static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl)
 {
-	struct overlay_cache_data *oc;
+	struct ovl_priv_data *op;
 	struct omap_dss_device *dssdev;
 	u32 size, burst_size;

-	oc = &dss_cache.overlay_cache[ovl->id];
-
-	if (!oc->enabled)
+	op = get_ovl_priv(ovl);
+
+	if (!op->enabled)
 		return;

 	dssdev = ovl->manager->device;
@@ -578,14 +585,14 @@
 	case OMAP_DISPLAY_TYPE_VENC:
 	case OMAP_DISPLAY_TYPE_HDMI:
 		default_get_overlay_fifo_thresholds(ovl->id, size,
-				burst_size, &oc->fifo_low,
-				&oc->fifo_high);
+				burst_size, &op->fifo_low,
+				&op->fifo_high);
 		break;
 #ifdef CONFIG_OMAP2_DSS_DSI
 	case OMAP_DISPLAY_TYPE_DSI:
 		dsi_get_overlay_fifo_thresholds(ovl->id, size,
-				burst_size, &oc->fifo_low,
-				&oc->fifo_high);
+				burst_size, &op->fifo_low,
+				&op->fifo_high);
 		break;
 #endif
 	default:


OMAPDSS: clean up dss_mgr_set_timings

OMAPDSS: clean up dss_mgr_set_timings

dss_mgr_set_timings() can only be called when the output is not active.
This means that most of the code in the function is extra, as there's no
need to write the values to registers, etc, because that will be handled
when the output will be enabled.

Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@ti.com>

--- drivers/video/omap2/dss/apply.c
+++ drivers/video/omap2/dss/apply.c
@@ -1314,21 +1314,19 @@
 		const struct omap_video_timings *timings)
 {
 	unsigned long flags;
-
-	mutex_lock(&apply_lock);
-
-	spin_lock_irqsave(&data_lock, flags);
+	struct mgr_priv_data *mp = get_mgr_priv(mgr);
+
+	spin_lock_irqsave(&data_lock, flags);
+
+	if (mp->updating) {
+		DSSERR("cannot set timings for %s: manager needs to be disabled\n",
+			mgr->name);
+		goto out;
+	}

 	dss_apply_mgr_timings(mgr, timings);
-
-	dss_write_regs();
-	dss_set_go_bits();
-
-	spin_unlock_irqrestore(&data_lock, flags);
-
-	wait_pending_extra_info_updates();
-
-	mutex_unlock(&apply_lock);
+out:
+	spin_unlock_irqrestore(&data_lock, flags);
 }

 static void dss_apply_mgr_lcd_config(struct omap_overlay_manager *mgr,


OMAPDSS: DISPC: Update Accumulator configuration for chroma plane

DISPC has two accumulator registers DISPC_VIDp_ACCU_0 and DISPC_VIDp_ACCU_1 each
with horizontal and vertical bit fields. The bit fields can take values in the
range of -1024 to 1023. Based on bit field values DISPC decides on which one out
of 8 phases the filtering starts. DISPC_VIDp_ACCU_0 is used for progressive
output and for interlaced output both DISPC_VIDp_ACCU_0 and DISPC_VIDp_ACCU_1
are used.

The current accumulator values in DISPC scaling logic for chroma plane takes
default values for all color modes and rotation types. So, the horizontal and
vertical up and downsampling accumulator bit field values have been updated for
better performance.

Signed-off-by: Chandrabhanu Mahapatra <80a4f28145aaf3116a60f9e581f7ff3a14686cba@ti.com>
Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@ti.com>

--- drivers/video/omap2/dss/dispc.c
+++ drivers/video/omap2/dss/dispc.c
@@ -1153,6 +1153,92 @@
 	dispc_ovl_set_fir(plane, fir_hinc, fir_vinc, color_comp);
 }

+static void dispc_ovl_set_accu_uv(enum omap_plane plane,
+		u16 orig_width,	u16 orig_height, u16 out_width, u16 out_height,
+		bool ilace, enum omap_color_mode color_mode, u8 rotation)
+{
+	int h_accu2_0, h_accu2_1;
+	int v_accu2_0, v_accu2_1;
+	int chroma_hinc, chroma_vinc;
+	int idx;
+
+	struct accu {
+		s8 h0_m, h0_n;
+		s8 h1_m, h1_n;
+		s8 v0_m, v0_n;
+		s8 v1_m, v1_n;
+	};
+
+	const struct accu *accu_table;
+	const struct accu *accu_val;
+
+	static const struct accu accu_nv12[4] = {
+		{  0, 1,  0, 1 , -1, 2, 0, 1 },
+		{  1, 2, -3, 4 ,  0, 1, 0, 1 },
+		{ -1, 1,  0, 1 , -1, 2, 0, 1 },
+		{ -1, 2, -1, 2 , -1, 1, 0, 1 },
+	};
+
+	static const struct accu accu_nv12_ilace[4] = {
+		{  0, 1,  0, 1 , -3, 4, -1, 4 },
+		{ -1, 4, -3, 4 ,  0, 1,  0, 1 },
+		{ -1, 1,  0, 1 , -1, 4, -3, 4 },
+		{ -3, 4, -3, 4 , -1, 1,  0, 1 },
+	};
+
+	static const struct accu accu_yuv[4] = {
+		{  0, 1, 0, 1,  0, 1, 0, 1 },
+		{  0, 1, 0, 1,  0, 1, 0, 1 },
+		{ -1, 1, 0, 1,  0, 1, 0, 1 },
+		{  0, 1, 0, 1, -1, 1, 0, 1 },
+	};
+
+	switch (rotation) {
+	case OMAP_DSS_ROT_0:
+		idx = 0;
+		break;
+	case OMAP_DSS_ROT_90:
+		idx = 1;
+		break;
+	case OMAP_DSS_ROT_180:
+		idx = 2;
+		break;
+	case OMAP_DSS_ROT_270:
+		idx = 3;
+		break;
+	default:
+		BUG();
+	}
+
+	switch (color_mode) {
+	case OMAP_DSS_COLOR_NV12:
+		if (ilace)
+			accu_table = accu_nv12_ilace;
+		else
+			accu_table = accu_nv12;
+		break;
+	case OMAP_DSS_COLOR_YUV2:
+	case OMAP_DSS_COLOR_UYVY:
+		accu_table = accu_yuv;
+		break;
+	default:
+		BUG();
+	}
+
+	accu_val = &accu_table[idx];
+
+	chroma_hinc = 1024 * orig_width / out_width;
+	chroma_vinc = 1024 * orig_height / out_height;
+
+	h_accu2_0 = (accu_val->h0_m * chroma_hinc / accu_val->h0_n) % 1024;
+	h_accu2_1 = (accu_val->h1_m * chroma_hinc / accu_val->h1_n) % 1024;
+	v_accu2_0 = (accu_val->v0_m * chroma_vinc / accu_val->v0_n) % 1024;
+	v_accu2_1 = (accu_val->v1_m * chroma_vinc / accu_val->v1_n) % 1024;
+
+	dispc_ovl_set_vid_accu2_0(plane, h_accu2_0, v_accu2_0);
+	dispc_ovl_set_vid_accu2_1(plane, h_accu2_1, v_accu2_1);
+}
+
 static void dispc_ovl_set_scaling_common(enum omap_plane plane,
 		u16 orig_width, u16 orig_height,
 		u16 out_width, u16 out_height,
@@ -1216,6 +1302,9 @@
 {
 	int scale_x = out_width != orig_width;
 	int scale_y = out_height != orig_height;
+
+	dispc_ovl_set_accu_uv(plane, orig_width, orig_height, out_width,
+			out_height, ilace, color_mode, rotation);

 	if (!dss_has_feature(FEAT_HANDLE_UV_SEPARATE))
 		return;
@@ -1265,9 +1354,6 @@
 	REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), scale_x ? 1 : 0, 5, 5);
 	/* set V scaling */
 	REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), scale_y ? 1 : 0, 6, 6);
-
-	dispc_ovl_set_vid_accu2_0(plane, 0x80, 0);
-	dispc_ovl_set_vid_accu2_1(plane, 0x80, 0);
 }

 static void dispc_ovl_set_scaling(enum omap_plane plane,


*** empty log message ***

*** empty log message ***

--- dtool/src/dtoolbase/dtoolbase.h
+++ dtool/src/dtoolbase/dtoolbase.h
@@ -29,6 +29,10 @@
 #pragma warning (disable : 4503)
 /* C4305: truncation from 'const double' to 'float' */
 #pragma warning (disable : 4305)
+/* C4250: 'myclass' : inherits 'baseclass::member' via dominance */
+#pragma warning (disable : 4250)
+/* C4355: 'this' : used in base member initializer list */
+#pragma warning (disable : 4355)

 #endif  /* WIN32_VC */


examples:rpl_udp removed the limit of 5 characters as payload size

--- examples/rpl_udp/udp.c
+++ examples/rpl_udp/udp.c
@@ -102,17 +102,21 @@
     ipv6_addr_t ipaddr;
     int bytes_sent;
     int address;
-    char text[5];

     if (argc != 3) {
         printf("usage: send <addr> <text>\n");
         return 1;
     }

+    /* max payload size = MTU - MAC - AES - IPV6_HDR_LEN - UDP_HDR_LEN
+     *              33  = 127 - 25 - 21 - 40 - 8
+     */
+    if (strlen(argv[2]) > 32) {
+        puts("<text> is too large to be sent (max. 33 characters).");
+        return 1;
+    }
+
     address = atoi(argv[1]);
-
-    strncpy(text, argv[2], sizeof(text));
-    text[sizeof(text) - 1] = 0;

     sock = socket_base_socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);

@@ -134,8 +138,8 @@
     memcpy(&sa.sin6_addr, &ipaddr, 16);
     sa.sin6_port = HTONS(SERVER_PORT);

-    bytes_sent = socket_base_sendto(sock, (char *)text,
-                                       strlen(text) + 1, 0, &sa,
+    bytes_sent = socket_base_sendto(sock, argv[2],
+                                       strlen(argv[2]), 0, &sa,
                                        sizeof(sa));

     if (bytes_sent < 0) {


HAWQ-1032. Fix bug of set bucket number of child partition to parent partition only when policy type equals to POLICYTYPE_PARTITIONED.

--- src/backend/cdb/cdbpartition.c
+++ src/backend/cdb/cdbpartition.c
@@ -6623,7 +6623,10 @@
 				/* propagate owner */
 				((CreateStmt *)q->utilityStmt)->ownerid = ownerid;
 				/* child partition should have the same bucket number with parent partition */
-				if (parPolicy && parPolicy->ptype == POLICYTYPE_PARTITIONED) {
+				if (parPolicy && ((CreateStmt *)q->utilityStmt)->policy
+				    && ((CreateStmt *)q->utilityStmt)->policy->nattrs > 0
+				    && ((CreateStmt *)q->utilityStmt)->policy->ptype ==
+				        POLICYTYPE_PARTITIONED) {
 				  ((CreateStmt *)q->utilityStmt)->policy->bucketnum = parPolicy->bucketnum;
 				}
 			}


memory_pool: all tracepoint events

memory_pool: all tracepoint events

Signed-off-by: Sébastien Boisvert <1a4d2e25eb5ba040b6ad5779a730a1a8a0ff9bc5@anl.gov>

--- core/system/memory_pool.c
+++ core/system/memory_pool.c
@@ -186,9 +186,11 @@
         printf("TRACEPOINT_EVENT memory_pool:allocate name %x size %zu\n",
                         self->name, size);

+#if 0
         if (size == 9) {
             core_tracer_print_stack_backtrace();
         }
+#endif
     }

     /*
@@ -366,6 +368,12 @@
         metadata = sizeof(size_t);
     }

+    if (CORE_BITMAP_GET_BIT(self->flags, FLAG_ENABLE_TRACEPOINTS)) {
+        printf("TRACEPOINT_EVENT memory_pool:allocate_private name %x size %zu free_list_size %d\n",
+                        self->name, size,
+                        (queue != NULL ? core_free_list_size(queue) : 0));
+    }
+
     /* recycling is good for the environment
      */
     if (queue != NULL
@@ -397,6 +405,9 @@

     pointer = core_memory_block_allocate(self->current_block, size + metadata);

+    if (CORE_BITMAP_GET_BIT(self->flags, FLAG_ENABLE_TRACEPOINTS))
+        printf("TRACEPOINT_EVENT memory_block:allocate size %zu\n", size + metadata);
+
     /* the current block is exausted...
      */
     if (pointer == NULL) {
@@ -406,6 +417,9 @@
         core_memory_pool_add_block(self);

         pointer = core_memory_block_allocate(self->current_block, size + metadata);
+
+        if (CORE_BITMAP_GET_BIT(self->flags, FLAG_ENABLE_TRACEPOINTS))
+            printf("TRACEPOINT_EVENT memory_block:allocate size %zu\n", size + metadata);

 #ifdef DEBUG_MEMORY_POOL_ALLOCATE
         printf("DEBUG pool_allocate_private from block size %zu pointer %p\n",


Fixing 'atspi_accessible_get_id' annotation

--- atspi/atspi-accessible.c
+++ atspi/atspi-accessible.c
@@ -872,7 +872,7 @@
 }

 /**
- * atspi_accessible_get_toolkit_version:
+ * atspi_accessible_get_id:
  * @obj: a pointer to the #AtspiAccessible object on which to operate.
  *
  * Gets the application id for a #AtspiAccessible object.


MFC 1.62:    Fix reading of files that use pax 'size' attribute
to store size.  In particular, the pax 'size' attribute is required
for any file over 8G.

This seems to fix tar -cf - | tar -xf - when there are files
over 8G in the heirarchy being copied.


Put back code in nodeAgg to generate a dummy all-nulls input tuple before calling execProject, when the outerPlan has returned zero tuples. I took this out under the mistaken impression that the input tuple couldn't be referenced by execProject if we weren't in GROUP BY mode. But it can, if we're in an UPDATE or DELETE...

--- src/backend/executor/nodeAgg.c
+++ src/backend/executor/nodeAgg.c
@@ -11,7 +11,7 @@
  *	  SQL aggregates. (Do not expect POSTQUEL semantics.)	 -- ay 2/95
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.57 1999/10/08 03:49:55 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.58 1999/10/30 01:18:16 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -408,24 +408,43 @@
 				return NULL;
 		}
 		else
+		{
 			aggstate->agg_done = true;
+			/*
+			 * If inputtuple==NULL (ie, the outerPlan didn't return anything),
+			 * create a dummy all-nulls input tuple for use by execProject.
+			 * 99.44% of the time this is a waste of cycles, because
+			 * ordinarily the projected output tuple's targetlist cannot
+			 * contain any direct (non-aggregated) references to input
+			 * columns, so the dummy tuple will not be referenced.  However
+			 * there are special cases where this isn't so --- in particular
+			 * an UPDATE involving an aggregate will have a targetlist
+			 * reference to ctid.  We need to return a null for ctid in that
+			 * situation, not coredump.
+			 *
+			 * The values returned for the aggregates will be the initial
+			 * values of the transition functions.
+			 */
+			if (inputTuple == NULL)
+			{
+				TupleDesc	tupType;
+				Datum	   *tupValue;
+				char	   *null_array;
+				AttrNumber	attnum;
+
+				tupType = aggstate->csstate.css_ScanTupleSlot->ttc_tupleDescriptor;
+				tupValue = projInfo->pi_tupValue;
+				null_array = (char *) palloc(sizeof(char) * tupType->natts);
+				for (attnum = 0; attnum < tupType->natts; attnum++)
+					null_array[attnum] = 'n';
+				inputTuple = heap_formtuple(tupType, tupValue, null_array);
+				pfree(null_array);
+			}
+		}

 		/*
-		 * We used to create a dummy all-nulls input tuple here if
-		 * inputTuple == NULL (ie, the outerPlan didn't return anything).
-		 * However, now that we don't return a bogus tuple in Group mode,
-		 * we can only get here with inputTuple == NULL in non-Group mode.
-		 * So, if the parser has done its job right, the projected output
-		 * tuple's targetList must not contain any direct references to
-		 * input columns, and so it's a waste of time to create an
-		 * all-nulls input tuple.  We just let the tuple slot get set
-		 * to NULL instead.  The values returned for the aggregates will
-		 * be the initial values of the transition functions.
-		 */
-
-		/*
-		 * Store the representative input tuple (or NULL, if none)
-		 * in the tuple table slot reserved for it.
+		 * Store the representative input tuple in the tuple table slot
+		 * reserved for it.
 		 */
 		ExecStoreTuple(inputTuple,
 					   aggstate->csstate.css_ScanTupleSlot,


Add depth annotations to i386 register classes

Set correct "depth" field for i386 register classes,
so the logic class operations (intersection, ancestor
etc.) behave correctly.

--- src/backend/i386/registerset.c
+++ src/backend/i386/registerset.c
@@ -18,56 +18,56 @@
 	[jive_i386_flags] = {
 		.name = "flags", .nbits = 16,
 		.regs = &jive_i386_regs[jive_i386_cc], .nregs = 1,
-		.index = jive_i386_flags, .parent = 0,
+		.index = jive_i386_flags, .parent = 0, .depth = 0
 	},
 	[jive_i386_gpr] = {
 		.name = "gpr", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_eax], .nregs = 8,
-		.index = jive_i386_gpr, .parent = 0,
+		.index = jive_i386_gpr, .parent = 0, .depth = 0
 	},
 	[jive_i386_gpr_byte] = {
 		.name = "gpr_byte_addressible", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_eax], .nregs = 4,
-		.index = jive_i386_gpr_byte, .parent = &jive_i386_regcls[jive_i386_gpr],
+		.index = jive_i386_gpr_byte, .parent = &jive_i386_regcls[jive_i386_gpr], .depth = 1
 	},
 	[jive_i386_gpr_eax] = {
 		.name = "gpr_eax", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_eax], .nregs = 1,
-		.index = jive_i386_gpr_eax, .parent = &jive_i386_regcls[jive_i386_gpr_byte],
+		.index = jive_i386_gpr_eax, .parent = &jive_i386_regcls[jive_i386_gpr_byte], .depth = 2
 	},
 	[jive_i386_gpr_ecx] = {
 		.name = "gpr_ecx", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_ecx], .nregs = 1,
-		.index = jive_i386_gpr_ecx, .parent = &jive_i386_regcls[jive_i386_gpr_byte],
+		.index = jive_i386_gpr_ecx, .parent = &jive_i386_regcls[jive_i386_gpr_byte], .depth = 2
 	},
 	[jive_i386_gpr_ebx] = {
 		.name = "gpr_ebx", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_ebx], .nregs = 1,
-		.index = jive_i386_gpr_ebx, .parent = &jive_i386_regcls[jive_i386_gpr_byte],
+		.index = jive_i386_gpr_ebx, .parent = &jive_i386_regcls[jive_i386_gpr_byte], .depth = 2
 	},
 	[jive_i386_gpr_edx] = {
 		.name = "gpr_edx", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_edx], .nregs = 1,
-		.index = jive_i386_gpr_edx, .parent = &jive_i386_regcls[jive_i386_gpr_byte],
+		.index = jive_i386_gpr_edx, .parent = &jive_i386_regcls[jive_i386_gpr_byte], .depth = 2
 	},
 	[jive_i386_gpr_esi] = {
 		.name = "gpr_esi", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_esi], .nregs = 1,
-		.index = jive_i386_gpr_esi, .parent = &jive_i386_regcls[jive_i386_gpr],
+		.index = jive_i386_gpr_esi, .parent = &jive_i386_regcls[jive_i386_gpr], .depth = 1
 	},
 	[jive_i386_gpr_edi] = {
 		.name = "gpr_edi", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_edi], .nregs = 1,
-		.index = jive_i386_gpr_edi, .parent = &jive_i386_regcls[jive_i386_gpr],
+		.index = jive_i386_gpr_edi, .parent = &jive_i386_regcls[jive_i386_gpr], .depth = 1
 	},
 	[jive_i386_gpr_esp] = {
 		.name = "gpr_esp", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_esp], .nregs = 1,
-		.index = jive_i386_gpr_esp, .parent = &jive_i386_regcls[jive_i386_gpr],
+		.index = jive_i386_gpr_esp, .parent = &jive_i386_regcls[jive_i386_gpr], .depth = 1
 	},
 	[jive_i386_gpr_ebp] = {
 		.name = "gpr_ebp", .nbits = 32, .int_arithmetic_width = 32, .loadstore_width = 8|16|32,
 		.regs = &jive_i386_regs[jive_i386_ebp], .nregs = 1,
-		.index = jive_i386_gpr_ebp, .parent = &jive_i386_regcls[jive_i386_gpr],
+		.index = jive_i386_gpr_ebp, .parent = &jive_i386_regcls[jive_i386_gpr], .depth = 1
 	}
 };


Add equality checking for T_Query so that we don't get complaints in UNION regress test.  Probably still need some more node types to be handled here, but I'm done for the day...

--- src/backend/nodes/equalfuncs.c
+++ src/backend/nodes/equalfuncs.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.24 1999/02/06 17:29:25 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.25 1999/02/07 00:52:12 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -559,6 +559,105 @@
 	return true;
 }

+/*
+ * Stuff from parsenodes.h
+ */
+
+static bool
+_equalQuery(Query *a, Query *b)
+{
+	if (a->commandType != b->commandType)
+		return false;
+	if (!equal(a->utilityStmt, b->utilityStmt))
+		return false;
+	if (a->resultRelation != b->resultRelation)
+		return false;
+	if (a->into && b->into) {
+		if (strcmp(a->into, b->into) != 0)
+			return false;
+	} else {
+		if (a->into != b->into)
+			return false;
+	}
+	if (a->isPortal != b->isPortal)
+		return false;
+	if (a->isBinary != b->isBinary)
+		return false;
+	if (a->isTemp != b->isTemp)
+		return false;
+	if (a->unionall != b->unionall)
+		return false;
+	if (a->hasAggs != b->hasAggs)
+		return false;
+	if (a->hasSubLinks != b->hasSubLinks)
+		return false;
+	if (a->uniqueFlag && b->uniqueFlag) {
+		if (strcmp(a->uniqueFlag, b->uniqueFlag) != 0)
+			return false;
+	} else {
+		if (a->uniqueFlag != b->uniqueFlag)
+			return false;
+	}
+	if (!equal(a->sortClause, b->sortClause))
+		return false;
+	if (!equal(a->rtable, b->rtable))
+		return false;
+	if (!equal(a->targetList, b->targetList))
+		return false;
+	if (!equal(a->qual, b->qual))
+		return false;
+	if (!equal(a->rowMark, b->rowMark))
+		return false;
+	if (!equal(a->groupClause, b->groupClause))
+		return false;
+	if (!equal(a->havingQual, b->havingQual))
+		return false;
+	if (!equal(a->intersectClause, b->intersectClause))
+		return false;
+	if (!equal(a->unionClause, b->unionClause))
+		return false;
+	if (!equal(a->limitOffset, b->limitOffset))
+		return false;
+	if (!equal(a->limitCount, b->limitCount))
+		return false;
+
+	/* We do not check the internal-to-the-planner fields
+	 * base_rel_list and join_rel_list.  They might not be
+	 * set yet, and in any case they should be derivable
+	 * from the other fields.
+	 */
+	return true;
+}
+
+static bool
+_equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
+{
+	if (a->relname && b->relname) {
+		if (strcmp(a->relname, b->relname) != 0)
+			return false;
+	} else {
+		if (a->relname != b->relname)
+			return false;
+	}
+	if (a->refname && b->refname) {
+		if (strcmp(a->refname, b->refname) != 0)
+			return false;
+	} else {
+		if (a->refname != b->refname)
+			return false;
+	}
+	if (a->relid != b->relid)
+		return false;
+	if (a->inh != b->inh)
+		return false;
+	if (a->inFromCl != b->inFromCl)
+		return false;
+	if (a->skipAcl != b->skipAcl)
+		return false;
+
+	return true;
+}
+
 static bool
 _equalTargetEntry(TargetEntry *a, TargetEntry *b)
 {
@@ -572,13 +671,10 @@
 	return true;
 }

-
-/*
- *	equal -- are two lists equal?
- *
- *		This is a comparison by value.	It would be simpler to write it
- *		to be recursive, but it should run faster if we iterate.
- */
+/*
+ * Stuff from pg_list.h
+ */
+
 static bool
 _equalValue(Value *a, Value *b)
 {
@@ -634,9 +730,6 @@
 			break;
 		case T_Expr:
 			retval = _equalExpr(a, b);
-			break;
-		case T_TargetEntry:
-			retval = _equalTargetEntry(a, b);
 			break;
 		case T_Iter:
 			retval = _equalIter(a, b);
@@ -734,6 +827,15 @@
 				retval = true;
 			}
 			break;
+		case T_Query:
+			retval = _equalQuery(a, b);
+			break;
+		case T_RangeTblEntry:
+			retval = _equalRangeTblEntry(a, b);
+			break;
+		case T_TargetEntry:
+			retval = _equalTargetEntry(a, b);
+			break;
 		default:
 			elog(NOTICE, "equal: don't know whether nodes of type %d are equal",
 				 nodeTag(a));


Correct comment to use RS_EPHEMERAL

Correct comment to use RS_EPHEMERAL

--- src/backend/replication/slot.c
+++ src/backend/replication/slot.c
@@ -544,7 +544,7 @@
 }

 /*
- * Convert a slot that's marked as RS_DROP_ON_ERROR to a RS_PERSISTENT slot,
+ * Convert a slot that's marked as RS_EPHEMERAL to a RS_PERSISTENT slot,
  * guaranteeing it will be there after a eventual crash.
  */
 void


Fix nasty bugs in pg_convert() and pg_convert2().

    o they sometimes returns a result garbage string appended.
    o they do not work if client encoding is different from server
      encoding

--- src/backend/utils/mb/mbutils.c
+++ src/backend/utils/mb/mbutils.c
@@ -3,7 +3,7 @@
  * client encoding and server internal encoding.
  * (currently mule internal code (mic) is used)
  * Tatsuo Ishii
- * $Id: mbutils.c,v 1.25 2001/10/25 05:49:51 momjian Exp $
+ * $Id: mbutils.c,v 1.26 2001/11/19 06:48:39 ishii Exp $
  */
 #include "postgres.h"

@@ -220,6 +220,8 @@
 	from_mic_converter dest;
 	unsigned char *result;
 	text	   *retval;
+	unsigned char *str;
+	int len;

 	if (encoding < 0)
 		elog(ERROR, "Invalid encoding name %s", NameStr(*s));
@@ -231,14 +233,28 @@
 		elog(ERROR, "Conversion from %s to %s is not possible", NameStr(*s), encoding_name);
 	}

-	result = pg_do_encoding_conversion(VARDATA(string), VARSIZE(string) - VARHDRSZ,
-									   src, dest);
+	/* make sure that source string is null terminated */
+	len = VARSIZE(string) - VARHDRSZ;
+	str = palloc(len + 1);
+	memcpy(str, VARDATA(string), len);
+	*(str + len) = '\0';
+
+	result = pg_do_encoding_conversion(str, len, src, dest);
 	if (result == NULL)
 		elog(ERROR, "Encoding conversion failed");

-	retval = DatumGetTextP(DirectFunctionCall1(textin, CStringGetDatum(result)));
-	if (result != (unsigned char *) VARDATA(string))
+	/* build text data type structre. we cannot use textin() here,
+	   since textin assumes that input string encoding is same as
+	   database encoding.  */
+	len = strlen(result) + VARHDRSZ;
+	retval = palloc(len);
+	VARATT_SIZEP(retval) = len;
+	memcpy(VARDATA(retval), result, len - VARHDRSZ);
+
+	/* free memory allocated by pg_do_encoding_conversion */
+	if (result != str)
 		pfree(result);
+        pfree(str);

 	/* free memory if allocated by the toaster */
 	PG_FREE_IF_COPY(string, 0);
@@ -263,6 +279,8 @@
 	from_mic_converter dest;
 	unsigned char *result;
 	text	   *retval;
+	unsigned char *str;
+	int len;

 	if (src_encoding < 0)
 		elog(ERROR, "Invalid source encoding name %s", src_encoding_name);
@@ -275,14 +293,27 @@
 			 src_encoding_name, dest_encoding_name);
 	}

-	result = pg_do_encoding_conversion(VARDATA(string), VARSIZE(string) - VARHDRSZ,
-									   src, dest);
+	/* make sure that source string is null terminated */
+	len = VARSIZE(string) - VARHDRSZ;
+	str = palloc(len + 1);
+	memcpy(str, VARDATA(string), len);
+	*(str + len) = '\0';
+
+	result = pg_do_encoding_conversion(str, len, src, dest);
 	if (result == NULL)
 		elog(ERROR, "Encoding conversion failed");

-	retval = DatumGetTextP(DirectFunctionCall1(textin, CStringGetDatum(result)));
-	if (result != (unsigned char *) VARDATA(string))
+	/* build text data type structre. we cannot use textin() here,
+	   since textin assumes that input string encoding is same as
+	   database encoding.  */
+	len = strlen(result) + VARHDRSZ;
+	retval = palloc(len);
+	VARATT_SIZEP(retval) = len;
+	memcpy(VARDATA(retval), result, len - VARHDRSZ);
+
+	if (result != str)
 		pfree(result);
+        pfree(str);

 	/* free memory if allocated by the toaster */
 	PG_FREE_IF_COPY(string, 0);


Add missing variable, per Massimo.

Add missing variable, per Massimo.

--- src/backend/utils/misc/trace.c
+++ src/backend/utils/misc/trace.c
@@ -190,6 +190,8 @@
 void
 write_syslog(int level, char *line)
 {
+	static int openlog_done = 0;
+
 	if (UseSyslog >= 1)
 	{
 		if (!openlog_done)


fixing incorrect error handling in pancake.c

issue identified by coverity

--- src/backends/pancake/pancake.c
+++ src/backends/pancake/pancake.c
@@ -48,7 +48,7 @@
     }

     runtime = ic_backend_pancake_runtime_new(instructions);
-    if (!instructions) {
+    if (!runtime) {
         puts("ic_backend_pancake: call to ic_backend_pancake_runtime_new failed");
         return 0;
     }


Do not consider Shared symbols as defined symbols.

I don't remember why I made shared symbols one type of defined symbols.
Shared symbols aren't undefined, so it could be considered defined, but
categorizing three symbols as:

 - defined
   - really defined
   - shared
 - undefined

is not as intuitive as

 - defined
 - shared
 - undefined

to me. So, in this patch, I made a change to stop handling shared
symbols as defined symbols.

Surprisingly, I didn't have to update any tests for this change.

Differential Revision: https://reviews.llvm.org/D39394

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@317446 91177308-0d34-0410-b5e6-96231b3b80d8

--- ELF/Symbols.h
+++ ELF/Symbols.h
@@ -40,9 +40,9 @@
   enum Kind {
     DefinedFirst,
     DefinedRegularKind = DefinedFirst,
-    SharedKind,
     DefinedCommonKind,
     DefinedLast = DefinedCommonKind,
+    SharedKind,
     UndefinedKind,
     LazyArchiveKind,
     LazyObjectKind,
@@ -247,13 +247,13 @@
   static bool classof(const Symbol *S) { return S->kind() == UndefinedKind; }
 };

-class SharedSymbol : public Defined {
+class SharedSymbol : public Symbol {
 public:
   static bool classof(const Symbol *S) { return S->kind() == SharedKind; }

   SharedSymbol(StringRef Name, uint8_t StOther, uint8_t Type, uint64_t Value,
                uint64_t Size, uint32_t Alignment, const void *Verdef)
-      : Defined(SharedKind, Name, /*IsLocal=*/false, StOther, Type),
+      : Symbol(SharedKind, Name, /*IsLocal=*/false, StOther, Type),
         Verdef(Verdef), Value(Value), Size(Size), Alignment(Alignment) {
     // GNU ifunc is a mechanism to allow user-supplied functions to
     // resolve PLT slot values at load-time. This is contrary to the


ALSA: hda - reorder intelhdmi prepare/cleanup callbacks

No behavior change.

Signed-off-by: Wu Fengguang <24f7fe9d205c8a9f6ade0c2894e14303ca16087f@intel.com>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/pci/hda/patch_intelhdmi.c
+++ sound/pci/hda/patch_intelhdmi.c
@@ -543,18 +543,6 @@
  * Callbacks
  */

-static int intel_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
-					   struct hda_codec *codec,
-					   struct snd_pcm_substream *substream)
-{
-	struct intel_hdmi_spec *spec = codec->spec;
-
-	hdmi_stop_infoframe_trans(codec, pin_nid);
-
-	snd_hda_codec_cleanup_stream(codec, hinfo->nid);
-	return 0;
-}
-
 static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
 					   struct hda_codec *codec,
 					   unsigned int stream_tag,
@@ -567,6 +555,18 @@
 	hdmi_setup_audio_infoframe(codec, cvt_nid, substream);

 	snd_hda_codec_setup_stream(codec, hinfo->nid, stream_tag, 0, format);
+	return 0;
+}
+
+static int intel_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
+					   struct hda_codec *codec,
+					   struct snd_pcm_substream *substream)
+{
+	struct intel_hdmi_spec *spec = codec->spec;
+
+	hdmi_stop_infoframe_trans(codec, pin_nid);
+
+	snd_hda_codec_cleanup_stream(codec, hinfo->nid);
 	return 0;
 }


ASoC: samsung: s3c2412-i2s: Move to clk_prepare_enable/clk_disable_unprepare

Use clk_prepare_enable/clk_disable_unprepare to make the driver
work properly with common clock framework.

Signed-off-by: Vasily Khoruzhick <2750baa0af9b656228a0c6ae55ea7df1c78e68de@gmail.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>

--- sound/soc/samsung/s3c2412-i2s.c
+++ sound/soc/samsung/s3c2412-i2s.c
@@ -76,7 +76,7 @@
 	/* Set MPLL as the source for IIS CLK */

 	clk_set_parent(s3c2412_i2s.iis_cclk, clk_get(NULL, "mpll"));
-	clk_enable(s3c2412_i2s.iis_cclk);
+	clk_prepare_enable(s3c2412_i2s.iis_cclk);

 	s3c2412_i2s.iis_cclk = s3c2412_i2s.iis_pclk;

@@ -89,7 +89,7 @@

 static int s3c2412_i2s_remove(struct snd_soc_dai *dai)
 {
-	clk_disable(s3c2412_i2s.iis_cclk);
+	clk_disable_unprepare(s3c2412_i2s.iis_cclk);

 	return 0;
 }


board/banshee/fw_config.h: Format with clang-format

BUG=b:236386294
BRANCH=none
TEST=none

Change-Id: I631ef39efb77191106c15202bf600dc93df7af78
Signed-off-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727999
Reviewed-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>

--- board/banshee/fw_config.h
+++ board/banshee/fw_config.h
@@ -14,7 +14,6 @@
  * Source of truth is the project/brya/brya/config.star configuration file.
  */

-
 enum ec_cfg_keyboard_backlight_type {
 	KEYBOARD_BACKLIGHT_DISABLED = 0,
 	KEYBOARD_BACKLIGHT_ENABLED = 1
@@ -22,11 +21,11 @@

 union banshee_cbi_fw_config {
 	struct {
-		uint32_t				sd_db : 2;
-		uint32_t				lte_db : 1;
-		enum ec_cfg_keyboard_backlight_type	kb_bl : 1;
-		uint32_t				audio : 3;
-		uint32_t				reserved_1 : 21;
+		uint32_t sd_db : 2;
+		uint32_t lte_db : 1;
+		enum ec_cfg_keyboard_backlight_type kb_bl : 1;
+		uint32_t audio : 3;
+		uint32_t reserved_1 : 21;
 	};
 	uint32_t raw_value;
 };


move the define related to Mass to here; remove product ID

--- components/drivers/usb/usbdevice/class/mstorage.h
+++ components/drivers/usb/usbdevice/class/mstorage.h
@@ -18,12 +18,53 @@

 #include <rtthread.h>

-#define USBREQ_GET_MAX_LUN                  0xfe
-#define USBREQ_MASS_STORAGE_RESET           0xff
+#define USBREQ_GET_MAX_LUN              0xfe
+#define USBREQ_MASS_STORAGE_RESET       0xff

-#define USB_MASS_STORAGE_PRODUCT_ID         0x1000   /* Product ID */
+#define SIZEOF_CSW                      0x0d
+#define SIZEOF_CBW                      0x1f
+
+#define CBWFLAGS_DIR_M                  0x80
+#define CBWFLAGS_DIR_IN                 0x80
+#define CBWFLAGS_DIR_OUT                0x00
+
+#define SCSI_TEST_UNIT_READY            0x00
+#define SCSI_REQUEST_SENSE              0x03
+#define SCSI_INQUIRY_CMD                0x12
+#define SCSI_ALLOW_MEDIUM_REMOVAL       0x1e
+#define SCSI_MODE_SENSE_6               0x1a
+#define SCSI_READ_CAPACITIES            0x23
+#define SCSI_READ_CAPACITY              0x25
+#define SCSI_READ_10                    0x28
+#define SCSI_WRITE_10                   0x2a
+#define SCSI_VERIFY_10                  0x2f
+
+#define CBW_SIGNATURE                   0x43425355
+#define CSW_SIGNATURE                   0x53425355
+#define CBW_TAG_VALUE                   0x12345678

 #pragma pack(1)
+
+struct ustorage_cbw
+{
+    rt_uint32_t signature;
+    rt_uint32_t tag;
+    rt_uint32_t xfer_len;
+    rt_uint8_t dflags;
+    rt_uint8_t lun;
+    rt_uint8_t cb_len;
+    rt_uint8_t cb[16];
+};
+typedef struct ustorage_cbw* ustorage_cbw_t;
+
+struct ustorage_csw
+{
+    rt_uint32_t signature;
+    rt_uint32_t tag;
+    rt_uint32_t data_reside;
+    rt_uint8_t  status;
+};
+typedef struct ustorage_csw* ustorage_csw_t;

 struct umass_descriptor
 {


Remove the border->border_dialog checks..this is handled in e_border.c
actually.

git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@27310 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/bin/e_int_config_borders.c
+++ src/bin/e_int_config_borders.c
@@ -37,16 +37,6 @@
 {
    E_Config_Dialog *cfd;
    E_Config_Dialog_View *v;
-
-   cfd = e_config_dialog_get("E", "_config_border_border_style_dialog");
-   if (cfd)
-     {
-	E_Border *bd2;
-
-	bd2 = cfd->data;
-	if (!e_util_strcmp(e_border_name_get(bd2), e_border_name_get(bd)))
-	  return NULL;
-     }

    v = _config_view_new();
    if (!v) return NULL;


Move description area to be below both loaded & unloaded because descriptions can be shown for either.

--- src/bin/e_int_config_modules.c
+++ src/bin/e_int_config_modules.c
@@ -162,7 +162,7 @@
 {
    Evas_Object *o, *of, *ol;

-   o = e_widget_list_add(evas, 0, 1);
+   o = e_widget_table_add(evas, 0);

    of = e_widget_frametable_add(evas, _("Available Modules"), 0);
    ol = e_widget_ilist_add(evas, 24, 24, NULL);
@@ -171,17 +171,14 @@
    e_widget_on_change_hook_set(ol, _avail_list_cb_change, cfdata);
    _fill_list(ol, 0);
    e_widget_frametable_object_append(of, ol, 0, 0, 1, 1, 1, 1, 1, 1);
-   ol = e_widget_textblock_add(evas);
-   e_widget_min_size_set(ol, 200, 70);
-   cfdata->o_desc = ol;
-   e_widget_textblock_markup_set(ol, _("Description: Unavailable"));
-   e_widget_frametable_object_append(of, ol, 0, 1, 1, 1, 1, 1, 1, 0);
    ol = e_widget_button_add(evas, _("Load Module"), NULL,
 			    _btn_cb_load, cfdata, NULL);
    cfdata->b_load = ol;
    e_widget_disabled_set(ol, 1);
-   e_widget_frametable_object_append(of, ol, 0, 2, 1, 1, 1, 1, 1, 0);
-   e_widget_list_object_append(o, of, 1, 1, 0.5);
+   e_widget_frametable_object_append(of, ol, 0, 1, 1, 1, 1, 1, 1, 0);
+   e_widget_table_object_append(o, of, 0, 0, 1, 1, 1, 1, 1, 1);
+
+//   e_widget_list_object_append(o, of, 1, 1, 0.5);

    of = e_widget_frametable_add(evas, _("Loaded Modules"), 0);
    ol = e_widget_ilist_add(evas, 24, 24, NULL);
@@ -195,7 +192,18 @@
    cfdata->b_unload = ol;
    e_widget_disabled_set(ol, 1);
    e_widget_frametable_object_append(of, ol, 0, 1, 1, 1, 1, 1, 1, 0);
-   e_widget_list_object_append(o, of, 1, 1, 0.5);
+   e_widget_table_object_append(o, of, 1, 0, 1, 1, 1, 1, 1, 1);
+
+//   e_widget_list_object_append(o, of, 1, 1, 0.5);
+
+   ol = e_widget_textblock_add(evas);
+   e_widget_min_size_set(ol, 200, 70);
+   cfdata->o_desc = ol;
+   e_widget_textblock_markup_set(ol, _("Description: Unavailable"));
+//   e_widget_frametable_object_append(of, ol, 0, 1, 1, 1, 1, 1, 1, 0);
+   e_widget_table_object_append(o, ol, 0, 1, 2, 1, 1, 0, 1, 0);
+
+//   e_widget_list_object_append(o, of, 1, 1, 0.5);

    return o;
 }
@@ -338,7 +346,7 @@

    e_widget_ilist_go(obj);
    e_widget_min_size_get(obj, &w, NULL);
-   e_widget_min_size_set(obj, w, 200);
+   e_widget_min_size_set(obj, w, 250);
    e_widget_ilist_thaw(obj);
    edje_thaw();
    evas_event_thaw(evas);


formatting

git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@19200 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/bin/e_int_config_modules.c
+++ src/bin/e_int_config_modules.c
@@ -355,7 +355,7 @@
    o = e_widget_list_add(evas, 0, 1);
    of = e_widget_framelist_add(evas, "Modules", 1);
    ob = e_widget_ilist_add(evas, 16, 16, NULL);
-   for(l = cfdata->mods; l; l = l->next)
+   for (l = cfdata->mods; l; l = l->next)
      {
 	E_Cfg_Mod_Data *cb_data;

@@ -420,20 +420,20 @@

    of = e_widget_framelist_add(evas, "Loaded", 1);
    ob = e_widget_ilist_add(evas, 16, 16, NULL);
-   for(l = cfdata->mods; l; l = l->next)
-   {
-      E_Cfg_Mod_Data *cb_data;
-
-      m = l->data;
-      sob = e_icon_add(evas);
-      if (m->icon_file)
-	e_icon_file_set(sob, m->icon_file);
-      cb_data = E_NEW(E_Cfg_Mod_Data, 1);
-      cb_data->cfd = cfd;
-      cb_data->loaded = 1;
-      cb_data->mod = m;
-      e_widget_ilist_append(ob, sob, m->name, _e_config_mod_cb_standard, cb_data, m->name);
-   }
+   for (l = cfdata->mods; l; l = l->next)
+     {
+	E_Cfg_Mod_Data *cb_data;
+
+	m = l->data;
+	sob = e_icon_add(evas);
+	if (m->icon_file)
+	  e_icon_file_set(sob, m->icon_file);
+	cb_data = E_NEW(E_Cfg_Mod_Data, 1);
+	cb_data->cfd = cfd;
+	cb_data->loaded = 1;
+	cb_data->mod = m;
+	e_widget_ilist_append(ob, sob, m->name, _e_config_mod_cb_standard, cb_data, m->name);
+     }
    cfdata->gui.loaded = ob;
    e_widget_ilist_go(ob);
    e_widget_min_size_set(ob, 120, 120);


 Try to use FDO icons as some modules (screensaver, for instance) use them.

SVN revision: 40363

--- src/bin/e_int_config_modules.c
+++ src/bin/e_int_config_modules.c
@@ -507,12 +507,19 @@
 	char buf[4096];

 	if (!mod) continue;
-	if (mod->orig_path)
+	if (mod->icon)
 	  {
-	     path = ecore_file_dir_get(mod->orig_path);
-	     snprintf(buf, sizeof(buf), "%s/%s.edj", path, mod->icon);
-	     ic = e_util_icon_add(buf, evas);
-	     free(path);
+	     ic = e_icon_add(evas);
+	     if (!e_util_icon_theme_set(ic, mod->icon))
+	       {
+		  if (mod->orig_path)
+		    {
+		       path = ecore_file_dir_get(mod->orig_path);
+		       snprintf(buf, sizeof(buf), "%s/%s.edj", path, mod->icon);
+		       e_icon_file_edje_set(ic, buf, "icon");
+		       free(path);
+		    }
+	       }
 	  }
 	if (mod->name)
 	  e_widget_ilist_append(obj, ic, mod->name, NULL, mod, NULL);


postpone module list construction to idler.

Create the list later so the dialog shows up immediately and is later
populated. The creation of the list is quite expensive, with disk,
efreet and later computation of the final list.

It seems good now, but if required it could be split a bit more,
instead of doing one directory per idle run, do one file.

git-svn-id: 6ac5796aeae0cef97fb47bcc287d4ce899c6fa6e@46843 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/bin/e_int_config_modules.c
+++ src/bin/e_int_config_modules.c
@@ -37,6 +37,14 @@
       Eina_List *loaded, *unloaded;
       Ecore_Idler *idler;
    } selected;
+
+   /* just exists while loading: */
+   Eina_List *modules_paths;
+   Eina_List *modules_path_current;
+   Eina_Hash *types_hash;
+   Ecore_Timer *data_delay;
+   Ecore_Idler *data_loader;
+   Eina_Bool did_modules_list;
 };

 struct _CFTypes
@@ -112,6 +120,16 @@
 {
    CFType *cft;

+   if (cfdata->data_delay)
+     ecore_timer_del(cfdata->data_delay);
+   else if (cfdata->data_loader)
+     ecore_idler_del(cfdata->data_loader);
+
+   if (cfdata->modules_paths)
+     e_path_dir_list_free(cfdata->modules_paths);
+   if (cfdata->types_hash)
+     eina_hash_free(cfdata->types_hash);
+
    EINA_LIST_FREE(cfdata->types, cft) _cftype_free(cft);

    eina_list_free(cfdata->selected.loaded);
@@ -131,7 +149,6 @@
    of = e_widget_frametable_add(evas, _("Modules"), 0);
    ol = e_widget_ilist_add(evas, 24, 24, NULL);
    cfdata->l_modules = ol;
-   _widget_list_populate(cfdata);

    e_widget_size_min_get(cfdata->l_modules, &w, NULL);
    if (w < 200 * e_scale) w = 200 * e_scale;
@@ -369,28 +386,66 @@
    return strcmp(t1->name, t2->name);
 }

+static int
+_fill_data_loader_iterate(void *data)
+{
+   E_Config_Dialog_Data *cfdata = data;
+
+   if (cfdata->modules_path_current)
+     {
+	E_Path_Dir *epd = cfdata->modules_path_current->data;
+	cfdata->modules_path_current = cfdata->modules_path_current->next;
+
+	if (ecore_file_is_dir(epd->dir))
+	  _load_modules(epd->dir, cfdata->types_hash);
+     }
+   else if (!cfdata->did_modules_list)
+     {
+	cfdata->did_modules_list = EINA_TRUE;
+
+	e_path_dir_list_free(cfdata->modules_paths);
+	cfdata->modules_paths = NULL;
+
+	eina_hash_foreach
+	  (cfdata->types_hash, _types_list_create_foreach_cb, cfdata);
+	eina_hash_free(cfdata->types_hash);
+	cfdata->types_hash = NULL;
+	cfdata->types = eina_list_sort(cfdata->types, -1, _types_list_sort);
+     }
+   else
+     {
+	_widget_list_populate(cfdata);
+	cfdata->data_loader = NULL;
+	return 0;
+     }
+
+   return 1;
+}
+
+static int
+_fill_data_delayed(void *data)
+{
+   E_Config_Dialog_Data *cfdata = data;
+   cfdata->data_loader = ecore_idler_add(_fill_data_loader_iterate, cfdata);
+   cfdata->data_delay = NULL;
+   return 0;
+}
+
 static Eina_Bool
 _fill_data(E_Config_Dialog_Data *cfdata)
 {
-   Eina_List *mdirs, *l;
-   E_Path_Dir *epd;
-   Eina_Hash *types_hash = eina_hash_string_superfast_new(NULL);
-   if (!types_hash) return EINA_FALSE;
-
-   // TODO: postpone this to idler? segment the job?
-   /* loop each path_modules dir and load modules for that path */
-   mdirs = e_path_dir_list_get(path_modules);
-   EINA_LIST_FOREACH(mdirs, l, epd)
-     {
-	if (!ecore_file_is_dir(epd->dir)) continue;
-	_load_modules(epd->dir, types_hash);
-     }
-   if (mdirs) e_path_dir_list_free(mdirs);
-
-   eina_hash_foreach(types_hash, _types_list_create_foreach_cb, cfdata);
-   eina_hash_free(types_hash);
-   cfdata->types = eina_list_sort(cfdata->types, -1, _types_list_sort);
-
+   cfdata->types_hash = eina_hash_string_superfast_new(NULL);
+   if (!cfdata->types_hash) return EINA_FALSE;
+
+   cfdata->modules_paths = e_path_dir_list_get(path_modules);
+   if (!cfdata->modules_paths)
+     {
+	eina_hash_free(cfdata->types_hash);
+	cfdata->types_hash = NULL;
+	return EINA_FALSE;
+     }
+   cfdata->modules_path_current = cfdata->modules_paths;
+   cfdata->data_delay = ecore_timer_add(0.2, _fill_data_delayed, cfdata);
    return EINA_TRUE;
 }


Fixed bug 1122 (spinlock fails to compile with -march=armv4t)

--- src/atomic/SDL_spinlock.c
+++ src/atomic/SDL_spinlock.c
@@ -62,7 +62,9 @@
 #elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
     return (__sync_lock_test_and_set(lock, 1) == 0);

-#elif defined(__GNUC__) && defined(__arm__) && (defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__))
+#elif defined(__GNUC__) && defined(__arm__) && \
+        (defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \
+         defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__))
     int result;
     __asm__ __volatile__ (
         "swp %0, %1, [%2]\n"


Connected notify on individuals to refilter if needed

--- libempathy-gtk/empathy-roster-model-aggregator.c
+++ libempathy-gtk/empathy-roster-model-aggregator.c
@@ -80,7 +80,7 @@
 struct _EmpathyRosterModelAggregatorPriv
 {
   FolksIndividualAggregator *aggregator;
-  GHashTable *individuals; /* Individual -> Individual */
+  GHashTable *filtered_individuals; /* Individual -> Individual */

   EmpathyRosterModelAggregatorFilterFunc filter_func;
   gpointer filter_data;
@@ -97,34 +97,74 @@
 }

 static void
+add_to_filtered_individuals (EmpathyRosterModelAggregator *self,
+    FolksIndividual *individual)
+{
+  g_hash_table_add (self->priv->filtered_individuals,
+      g_object_ref (individual));
+
+  tp_g_signal_connect_object (individual, "group-changed",
+      G_CALLBACK (individual_group_changed_cb), self, 0);
+
+  empathy_roster_model_fire_individual_added (EMPATHY_ROSTER_MODEL (self),
+      individual);
+}
+
+static void
+remove_from_filtered_individuals (EmpathyRosterModelAggregator *self,
+    FolksIndividual *individual)
+{
+  g_signal_handlers_disconnect_by_func (individual,
+      individual_group_changed_cb, self);
+
+  g_hash_table_remove (self->priv->filtered_individuals, individual);
+
+  empathy_roster_model_fire_individual_removed (EMPATHY_ROSTER_MODEL (self),
+      individual);
+}
+
+static void
+individual_notify_cb (FolksIndividual *individual,
+    GParamSpec *param,
+    EmpathyRosterModelAggregator *self)
+{
+  if (!self->priv->filter_func (EMPATHY_ROSTER_MODEL (self), individual, self)
+      && g_hash_table_contains (self->priv->filtered_individuals, individual))
+    remove_from_filtered_individuals (self, individual);
+
+  if (self->priv->filter_func (EMPATHY_ROSTER_MODEL (self), individual, self)
+      && !g_hash_table_contains (self->priv->filtered_individuals, individual))
+    add_to_filtered_individuals (self, individual);
+}
+
+static void
 add_individual (EmpathyRosterModelAggregator *self,
     FolksIndividual *individual)
 {
-  if (self->priv->filter_func != NULL && !self->priv->filter_func (
-          EMPATHY_ROSTER_MODEL (self), individual, self))
+  if (self->priv->filter_func != NULL)
+    {
+      tp_g_signal_connect_object (individual, "notify",
+          G_CALLBACK (individual_notify_cb), self, 0);
+
+      if (!self->priv->filter_func (EMPATHY_ROSTER_MODEL (self), individual,
+              self))
         return;
-
-  g_hash_table_add (self->priv->individuals,
-      g_object_ref (individual));
-
-  g_signal_connect (individual, "group-changed",
-      G_CALLBACK (individual_group_changed_cb), self);
-
-  empathy_roster_model_fire_individual_added (EMPATHY_ROSTER_MODEL (self),
-      individual);
+    }
+
+  add_to_filtered_individuals (self, individual);
 }

 static void
 remove_individual (EmpathyRosterModelAggregator *self,
     FolksIndividual *individual)
 {
-  g_signal_handlers_disconnect_by_func (individual,
-      individual_group_changed_cb, self);
-
-  g_hash_table_remove (self->priv->individuals, individual);
-
-  empathy_roster_model_fire_individual_removed (EMPATHY_ROSTER_MODEL (self),
-      individual);
+  if (self->priv->filter_func != NULL)
+    g_signal_handlers_disconnect_by_func (individual,
+        individual_notify_cb, self);
+
+  if (g_hash_table_contains (self->priv->filtered_individuals,
+          individual))
+    remove_from_filtered_individuals (self, individual);
 }

 static void
@@ -259,6 +299,7 @@
       ((GObjectClass *) empathy_roster_model_aggregator_parent_class)->dispose;

   g_clear_object (&self->priv->aggregator);
+  g_clear_pointer (&self->priv->filtered_individuals, g_hash_table_unref);

   if (chain_up != NULL)
     chain_up (object);
@@ -313,7 +354,7 @@
   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
       EMPATHY_TYPE_ROSTER_MODEL_AGGREGATOR, EmpathyRosterModelAggregatorPriv);

-  self->priv->individuals = g_hash_table_new_full (NULL, NULL, NULL,
+  self->priv->filtered_individuals = g_hash_table_new_full (NULL, NULL, NULL,
       g_object_unref);
 }

@@ -348,7 +389,7 @@
 {
   EmpathyRosterModelAggregator *self = EMPATHY_ROSTER_MODEL_AGGREGATOR (model);

-  return g_hash_table_get_values (self->priv->individuals);
+  return g_hash_table_get_values (self->priv->filtered_individuals);
 }

 static GList *


fix warnings like   td_thr_tls_get_addr.c:30: warning: `__used__' attribute ignored

--- libpthread/linuxthreads_db/td_thr_tls_get_addr.c
+++ libpthread/linuxthreads_db/td_thr_tls_get_addr.c
@@ -27,10 +27,10 @@

 td_err_e
-td_thr_tls_get_addr (const td_thrhandle_t *th __attribute_used__,
-		     void *map_address __attribute_used__,
-		     size_t offset __attribute_used__,
-		     void **address __attribute_used__)
+td_thr_tls_get_addr (const td_thrhandle_t *th __attribute__ ((unused)),
+		     void *map_address __attribute__ ((unused)),
+		     size_t offset __attribute__ ((unused)),
+		     void **address __attribute__ ((unused)))
 {
 #if USE_TLS
   size_t modid;


housekeeping

housekeeping

--- source/push[exe]/Hardware/wr0.c
+++ source/push[exe]/Hardware/wr0.c
@@ -157,16 +157,6 @@
 BOOL OpenDriver()
 {
     NTSTATUS status;
-
-    /*gHandle = CreateFile(
-        _T("\\\\.\\") OLS_DRIVER_ID,
-        GENERIC_READ | GENERIC_WRITE,
-        0,
-        NULL,
-        OPEN_EXISTING,
-        FILE_ATTRIBUTE_NORMAL,
-        NULL
-        );*/

     status = File_Create(
         &gHandle,
@@ -344,17 +334,6 @@
     inBuf.PciAddress = pciAddress;
     inBuf.PciOffset = regAddress;

-    /*result = DeviceIoControl(
-        gHandle,
-        IOCTL_OLS_READ_PCI_CONFIG,
-        &inBuf,
-        sizeof(inBuf),
-        value,
-        size,
-        &returnedLength,
-        NULL
-        );*/
-
     status = NtDeviceIoControlFile(
         gHandle,
         NULL,


Test trailing CR in a PE value is interpreted as a newline

--- expat/tests/runtests.c
+++ expat/tests/runtests.c
@@ -318,6 +318,47 @@
                    int UNUSED_P(is_parameter_entity))
 {
     dummy_handler_flags |= DUMMY_SKIP_HANDLER_FLAG;
+}
+
+/*
+ * Parameter entity evaluation support.
+ */
+#define ENTITY_MATCH_FAIL      (-1)
+#define ENTITY_MATCH_NOT_FOUND  (0)
+#define ENTITY_MATCH_SUCCESS    (1)
+static const XML_Char *entity_name_to_match = NULL;
+static const XML_Char *entity_value_to_match = NULL;
+static int entity_match_flag = ENTITY_MATCH_NOT_FOUND;
+
+static void XMLCALL
+param_entity_match_handler(void           *UNUSED_P(userData),
+                           const XML_Char *entityName,
+                           int            is_parameter_entity,
+                           const XML_Char *value,
+                           int            value_length,
+                           const XML_Char *UNUSED_P(base),
+                           const XML_Char *UNUSED_P(systemId),
+                           const XML_Char *UNUSED_P(publicId),
+                           const XML_Char *UNUSED_P(notationName))
+{
+    if (!is_parameter_entity ||
+        entity_name_to_match == NULL ||
+        entity_value_to_match == NULL) {
+        return;
+    }
+    if (!strcmp(entityName, entity_name_to_match)) {
+        /* The cast here is safe because we control the horizontal and
+         * the vertical, and we therefore know our strings are never
+         * going to overflow an int.
+         */
+        if (value_length != (int)strlen(entity_value_to_match) ||
+            strncmp(value, entity_value_to_match, value_length)) {
+            entity_match_flag = ENTITY_MATCH_FAIL;
+        } else {
+            entity_match_flag = ENTITY_MATCH_SUCCESS;
+        }
+    }
+    /* Else leave the match flag alone */
 }

 /*
@@ -4911,6 +4952,43 @@
                                 XML_TRUE) == XML_STATUS_ERROR)
         xml_failure(parser);
 }
+END_TEST
+
+/* Test that a parameter entity value ending with a carriage return
+ * has it translated internally into a newline.
+ */
+START_TEST(test_param_entity_with_trailing_cr)
+{
+#define PARAM_ENTITY_NAME "pe"
+#define PARAM_ENTITY_CORE_VALUE "<!ATTLIST doc att CDATA \"default\">"
+    const char *text =
+        "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+        "<doc/>";
+    ExtTest test_data = {
+        "<!ENTITY % " PARAM_ENTITY_NAME
+        " '" PARAM_ENTITY_CORE_VALUE "\r'>\n"
+        "%" PARAM_ENTITY_NAME ";\n",
+        NULL,
+        NULL
+    };
+
+    XML_SetUserData(parser, &test_data);
+    XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+    XML_SetExternalEntityRefHandler(parser, external_entity_loader);
+    XML_SetEntityDeclHandler(parser, param_entity_match_handler);
+    entity_name_to_match = PARAM_ENTITY_NAME;
+    entity_value_to_match = PARAM_ENTITY_CORE_VALUE "\n";
+    entity_match_flag = ENTITY_MATCH_NOT_FOUND;
+    if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+                                XML_TRUE) == XML_STATUS_ERROR)
+        xml_failure(parser);
+    if (entity_match_flag == ENTITY_MATCH_FAIL)
+        fail("Parameter entity CR->NEWLINE conversion failed");
+    else if (entity_match_flag == ENTITY_MATCH_NOT_FOUND)
+        fail("Parameter entity not parsed");
+}
+#undef PARAM_ENTITY_NAME
+#undef PARAM_ENTITY_CORE_VALUE
 END_TEST

@@ -8452,6 +8530,7 @@
     tcase_add_test(tc_basic, test_skipped_external_entity);
     tcase_add_test(tc_basic, test_skipped_null_loaded_ext_entity);
     tcase_add_test(tc_basic, test_skipped_unloaded_ext_entity);
+    tcase_add_test(tc_basic, test_param_entity_with_trailing_cr);

     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,


Check that if we default to int, all necessary traits are there.

--- parse/infer.c
+++ parse/infer.c
@@ -2175,15 +2175,22 @@
 tyfix(Node *ctx, Type *orig, int noerr)
 {
 	static Type *tyint, *tyflt;
+	static Bitset *intset, *fltset;
 	Type *t, *d, *base;
 	Tyenv *env;
 	size_t i;
 	char buf[1024];

-	if (!tyint)
+	if (!tyint) {
 		tyint = mktype(Zloc, Tyint);
-	if (!tyflt)
+		intset = mkbs();
+		traitsfor(tyint, intset);
+	}
+	if (!tyflt) {
 		tyflt = mktype(Zloc, Tyflt64);
+		fltset = mkbs();
+		traitsfor(tyflt, fltset);
+	}

 	t = tysearch(tf(orig));
 	env = t->env;
@@ -2202,9 +2209,9 @@
 		}
 	}
 	if (t->type == Tyvar && t->trneed) {
-		if (bshas(t->trneed, Tcint) && bshas(t->trneed, Tcnum))
+		if (bsissubset(t->trneed, intset))
 			t = tyint;
-		else if (bshas(t->trneed, Tcflt) && bshas(t->trneed, Tcnum))
+		else if (bsissubset(t->trneed, fltset))
 			t = tyflt;
 	} else if (!t->fixed) {
 		t->fixed = 1;
@@ -2233,8 +2240,11 @@

 	if (t->type == Tyvar && !noerr)
 		fatal(ctx, "underconstrained type %s near %s", tyfmt(buf, 1024, t), ctxstr(ctx));
-	if (base)
-		t->seqaux = tyfix(ctx, base, noerr);
+	if (base) {
+		if (base != orig)
+			base = tyfix(ctx, base, noerr);
+		t->seqaux = base;
+	}
 	if (env)
 		popenv(env);
 	return t;