SAPI: Add missing _complete calls to header file

Commit 090641a missed adding _complete functions to the header files
as well. This adds the _complete functions to the headers.

Signed-off-by: Andreas Fuchs <622ac2c25087201462d23b927a044354eba8dded@sit.fraunhofer.de>

--- include/sapi/sys_api_part3.h
+++ include/sapi/sys_api_part3.h
@@ -418,6 +418,10 @@
     TPM2_SU	startupType
     );

+TSS2_RC Tss2_Sys_Startup_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_Startup(
     TSS2_SYS_CONTEXT *sysContext,
     TPM2_SU	startupType
@@ -428,6 +432,10 @@
     TPM2_SU	shutdownType
     );

+TSS2_RC Tss2_Sys_Shutdown_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_Shutdown(
     TSS2_SYS_CONTEXT *sysContext,
     TSS2L_SYS_AUTH_COMMAND const *cmdAuthsArray,
@@ -438,6 +446,10 @@
 TSS2_RC Tss2_Sys_SelfTest_Prepare(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_YES_NO	fullTest
+    );
+
+TSS2_RC Tss2_Sys_SelfTest_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_SelfTest(
@@ -518,6 +530,10 @@
 TSS2_RC Tss2_Sys_PolicyRestart_Prepare(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	sessionHandle
+    );
+
+TSS2_RC Tss2_Sys_PolicyRestart_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_PolicyRestart(
@@ -1062,6 +1078,10 @@
     const TPM2B_SENSITIVE_DATA	*inData
     );

+TSS2_RC Tss2_Sys_StirRandom_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_StirRandom(
     TSS2_SYS_CONTEXT *sysContext,
     TSS2L_SYS_AUTH_COMMAND const *cmdAuthsArray,
@@ -1115,6 +1135,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_DH_OBJECT	sequenceHandle,
     const TPM2B_MAX_BUFFER	*buffer
+    );
+
+TSS2_RC Tss2_Sys_SequenceUpdate_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_SequenceUpdate(
@@ -1437,6 +1461,10 @@
     const TPML_CC	*clearList
     );

+TSS2_RC Tss2_Sys_SetCommandCodeAuditStatus_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_SetCommandCodeAuditStatus(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PROVISION	auth,
@@ -1451,6 +1479,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_DH_PCR	pcrHandle,
     const TPML_DIGEST_VALUES	*digests
+    );
+
+TSS2_RC Tss2_Sys_PCR_Extend_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_PCR_Extend(
@@ -1537,6 +1569,10 @@
     TPMI_DH_PCR	pcrNum
     );

+TSS2_RC Tss2_Sys_PCR_SetAuthPolicy_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PCR_SetAuthPolicy(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PLATFORM	authHandle,
@@ -1553,6 +1589,10 @@
     const TPM2B_DIGEST	*auth
     );

+TSS2_RC Tss2_Sys_PCR_SetAuthValue_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PCR_SetAuthValue(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_DH_PCR	pcrHandle,
@@ -1564,6 +1604,10 @@
 TSS2_RC Tss2_Sys_PCR_Reset_Prepare(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_DH_PCR	pcrHandle
+    );
+
+TSS2_RC Tss2_Sys_PCR_Reset_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_PCR_Reset(
@@ -1645,6 +1689,10 @@
     const TPMT_TK_AUTH	*ticket
     );

+TSS2_RC Tss2_Sys_PolicyTicket_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyTicket(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1663,6 +1711,10 @@
     const TPML_DIGEST	*pHashList
     );

+TSS2_RC Tss2_Sys_PolicyOR_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyOR(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1678,6 +1730,10 @@
     const TPML_PCR_SELECTION	*pcrs
     );

+TSS2_RC Tss2_Sys_PolicyPCR_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyPCR(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1691,6 +1747,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
     TPMA_LOCALITY	locality
+    );
+
+TSS2_RC Tss2_Sys_PolicyLocality_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_PolicyLocality(
@@ -1711,6 +1771,10 @@
     TPM2_EO	operation
     );

+TSS2_RC Tss2_Sys_PolicyNV_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyNV(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_AUTH	authHandle,
@@ -1731,6 +1795,10 @@
     TPM2_EO	operation
     );

+TSS2_RC Tss2_Sys_PolicyCounterTimer_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyCounterTimer(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1747,6 +1815,10 @@
     TPM2_CC	code
     );

+TSS2_RC Tss2_Sys_PolicyCommandCode_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyCommandCode(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1760,6 +1832,10 @@
     TPMI_SH_POLICY	policySession
     );

+TSS2_RC Tss2_Sys_PolicyPhysicalPresence_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyPhysicalPresence(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1773,6 +1849,10 @@
     const TPM2B_DIGEST	*cpHashA
     );

+TSS2_RC Tss2_Sys_PolicyCpHash_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyCpHash(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1785,6 +1865,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
     const TPM2B_DIGEST	*nameHash
+    );
+
+TSS2_RC Tss2_Sys_PolicyNameHash_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_PolicyNameHash(
@@ -1801,6 +1885,10 @@
     const TPM2B_NAME	*objectName,
     const TPM2B_NAME	*newParentName,
     TPMI_YES_NO	includeObject
+    );
+
+TSS2_RC Tss2_Sys_PolicyDuplicationSelect_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_PolicyDuplicationSelect(
@@ -1822,6 +1910,10 @@
     const TPMT_TK_VERIFIED	*checkTicket
     );

+TSS2_RC Tss2_Sys_PolicyAuthorize_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyAuthorize(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1838,6 +1930,10 @@
     TPMI_SH_POLICY	policySession
     );

+TSS2_RC Tss2_Sys_PolicyAuthValue_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyAuthValue(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1850,6 +1946,10 @@
     TPMI_SH_POLICY	policySession
     );

+TSS2_RC Tss2_Sys_PolicyPassword_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PolicyPassword(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
@@ -1879,6 +1979,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_SH_POLICY	policySession,
     TPMI_YES_NO	writtenSet
+    );
+
+TSS2_RC Tss2_Sys_PolicyNvWritten_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_PolicyNvWritten(
@@ -1932,6 +2036,10 @@
     TPMI_YES_NO	state
     );

+TSS2_RC Tss2_Sys_HierarchyControl_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_HierarchyControl(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_HIERARCHY	authHandle,
@@ -1948,6 +2056,10 @@
     TPMI_ALG_HASH	hashAlg
     );

+TSS2_RC Tss2_Sys_SetPrimaryPolicy_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_SetPrimaryPolicy(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_HIERARCHY_AUTH	authHandle,
@@ -1962,6 +2074,10 @@
     TPMI_RH_PLATFORM	authHandle
     );

+TSS2_RC Tss2_Sys_ChangePPS_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_ChangePPS(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PLATFORM	authHandle,
@@ -1974,6 +2090,10 @@
     TPMI_RH_PLATFORM	authHandle
     );

+TSS2_RC Tss2_Sys_ChangeEPS_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_ChangeEPS(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PLATFORM	authHandle,
@@ -1984,6 +2104,10 @@
 TSS2_RC Tss2_Sys_Clear_Prepare(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_CLEAR	authHandle
+    );
+
+TSS2_RC Tss2_Sys_Clear_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_Clear(
@@ -1999,6 +2123,10 @@
     TPMI_YES_NO	disable
     );

+TSS2_RC Tss2_Sys_ClearControl_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_ClearControl(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_CLEAR	auth,
@@ -2013,6 +2141,10 @@
     const TPM2B_AUTH	*newAuth
     );

+TSS2_RC Tss2_Sys_HierarchyChangeAuth_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_HierarchyChangeAuth(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_HIERARCHY_AUTH	authHandle,
@@ -2024,6 +2156,10 @@
 TSS2_RC Tss2_Sys_DictionaryAttackLockReset_Prepare(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_LOCKOUT	lockHandle
+    );
+
+TSS2_RC Tss2_Sys_DictionaryAttackLockReset_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_DictionaryAttackLockReset(
@@ -2041,6 +2177,10 @@
     UINT32	lockoutRecovery
     );

+TSS2_RC Tss2_Sys_DictionaryAttackParameters_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_DictionaryAttackParameters(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_LOCKOUT	lockHandle,
@@ -2058,6 +2198,10 @@
     const TPML_CC	*clearList
     );

+TSS2_RC Tss2_Sys_PP_Commands_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_PP_Commands(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PLATFORM	auth,
@@ -2071,6 +2215,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PLATFORM	authHandle,
     UINT32	algorithmSet
+    );
+
+TSS2_RC Tss2_Sys_SetAlgorithmSet_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_SetAlgorithmSet(
@@ -2089,6 +2237,10 @@
     TPMT_SIGNATURE	*manifestSignature
     );

+TSS2_RC Tss2_Sys_FieldUpgradeStart_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_FieldUpgradeStart(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PLATFORM	authorization,
@@ -2174,6 +2326,10 @@
     TPMI_DH_CONTEXT	flushHandle
     );

+TSS2_RC Tss2_Sys_FlushContext_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_FlushContext(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_DH_CONTEXT	flushHandle
@@ -2186,6 +2342,10 @@
     TPMI_DH_PERSISTENT	persistentHandle
     );

+TSS2_RC Tss2_Sys_EvictControl_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_EvictControl(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PROVISION	auth,
@@ -2215,6 +2375,10 @@
     UINT64	newTime
     );

+TSS2_RC Tss2_Sys_ClockSet_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_ClockSet(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PROVISION	auth,
@@ -2227,6 +2391,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PROVISION	auth,
     TPM2_CLOCK_ADJUST	rateAdjust
+    );
+
+TSS2_RC Tss2_Sys_ClockRateAdjust_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_ClockRateAdjust(
@@ -2266,6 +2434,10 @@
     const TPMT_PUBLIC_PARMS	*parameters
     );

+TSS2_RC Tss2_Sys_TestParms_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_TestParms(
     TSS2_SYS_CONTEXT *sysContext,
     TSS2L_SYS_AUTH_COMMAND const *cmdAuthsArray,
@@ -2280,6 +2452,10 @@
     const TPM2B_NV_PUBLIC	*publicInfo
     );

+TSS2_RC Tss2_Sys_NV_DefineSpace_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_NV_DefineSpace(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PROVISION	authHandle,
@@ -2295,6 +2471,10 @@
     TPMI_RH_NV_INDEX	nvIndex
     );

+TSS2_RC Tss2_Sys_NV_UndefineSpace_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_NV_UndefineSpace(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PROVISION	authHandle,
@@ -2307,6 +2487,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_INDEX	nvIndex,
     TPMI_RH_PLATFORM	platform
+    );
+
+TSS2_RC Tss2_Sys_NV_UndefineSpaceSpecial_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_NV_UndefineSpaceSpecial(
@@ -2345,6 +2529,10 @@
     UINT16	offset
     );

+TSS2_RC Tss2_Sys_NV_Write_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_NV_Write(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_AUTH	authHandle,
@@ -2359,6 +2547,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_AUTH	authHandle,
     TPMI_RH_NV_INDEX	nvIndex
+    );
+
+TSS2_RC Tss2_Sys_NV_Increment_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_NV_Increment(
@@ -2376,6 +2568,10 @@
     const TPM2B_MAX_NV_BUFFER	*data
     );

+TSS2_RC Tss2_Sys_NV_Extend_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_NV_Extend(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_AUTH	authHandle,
@@ -2392,6 +2588,10 @@
     UINT64	bits
     );

+TSS2_RC Tss2_Sys_NV_SetBits_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_NV_SetBits(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_AUTH	authHandle,
@@ -2407,6 +2607,10 @@
     TPMI_RH_NV_INDEX	nvIndex
     );

+TSS2_RC Tss2_Sys_NV_WriteLock_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_NV_WriteLock(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_AUTH	authHandle,
@@ -2418,6 +2622,10 @@
 TSS2_RC Tss2_Sys_NV_GlobalWriteLock_Prepare(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_PROVISION	authHandle
+    );
+
+TSS2_RC Tss2_Sys_NV_GlobalWriteLock_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_NV_GlobalWriteLock(
@@ -2457,6 +2665,10 @@
     TPMI_RH_NV_INDEX	nvIndex
     );

+TSS2_RC Tss2_Sys_NV_ReadLock_Complete(
+    TSS2_SYS_CONTEXT *sysContext
+    );
+
 TSS2_RC Tss2_Sys_NV_ReadLock(
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_AUTH	authHandle,
@@ -2469,6 +2681,10 @@
     TSS2_SYS_CONTEXT *sysContext,
     TPMI_RH_NV_INDEX	nvIndex,
     const TPM2B_AUTH	*newAuth
+    );
+
+TSS2_RC Tss2_Sys_NV_ChangeAuth_Complete(
+    TSS2_SYS_CONTEXT *sysContext
     );

 TSS2_RC Tss2_Sys_NV_ChangeAuth(


sb_edac: convert driver to use the new edac ABI

The legacy edac ABI is going to be removed. Port the driver to use
and benefit from the new API functionality.

Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>

--- drivers/edac/sb_edac.c
+++ drivers/edac/sb_edac.c
@@ -314,8 +314,6 @@
 	struct sbridge_info	info;
 	struct sbridge_channel	channel[NUM_CHANNELS];

-	int 			csrow_map[NUM_CHANNELS][MAX_DIMMS];
-
 	/* Memory type detection */
 	bool			is_mirrored, is_lockstep, is_close_pg;

@@ -487,28 +485,13 @@
 }

 /**
- * sbridge_get_active_channels() - gets the number of channels and csrows
+ * check_if_ecc_is_active() - Checks if ECC is active
  * bus:		Device bus
- * @channels:	Number of channels that will be returned
- * @csrows:	Number of csrows found
- *
- * Since EDAC core needs to know in advance the number of available channels
- * and csrows, in order to allocate memory for csrows/channels, it is needed
- * to run two similar steps. At the first step, implemented on this function,
- * it checks the number of csrows/channels present at one socket, identified
- * by the associated PCI bus.
- * this is used in order to properly allocate the size of mci components.
- * Note: one csrow is one dimm.
- */
-static int sbridge_get_active_channels(const u8 bus, unsigned *channels,
-				      unsigned *csrows)
+ */
+static int check_if_ecc_is_active(const u8 bus)
 {
 	struct pci_dev *pdev = NULL;
-	int i, j;
 	u32 mcmtr;
-
-	*channels = 0;
-	*csrows = 0;

 	pdev = get_pdev_slot_func(bus, 15, 0);
 	if (!pdev) {
@@ -523,41 +506,14 @@
 		sbridge_printk(KERN_ERR, "ECC is disabled. Aborting\n");
 		return -ENODEV;
 	}
-
-	for (i = 0; i < NUM_CHANNELS; i++) {
-		u32 mtr;
-
-		/* Device 15 functions 2 - 5  */
-		pdev = get_pdev_slot_func(bus, 15, 2 + i);
-		if (!pdev) {
-			sbridge_printk(KERN_ERR, "Couldn't find PCI device "
-						 "%2x.%02d.%d!!!\n",
-						 bus, 15, 2 + i);
-			return -ENODEV;
-		}
-		(*channels)++;
-
-		for (j = 0; j < ARRAY_SIZE(mtr_regs); j++) {
-			pci_read_config_dword(pdev, mtr_regs[j], &mtr);
-			debugf1("Bus#%02x channel #%d  MTR%d = %x\n", bus, i, j, mtr);
-			if (IS_DIMM_PRESENT(mtr))
-				(*csrows)++;
-		}
-	}
-
-	debugf0("Number of active channels: %d, number of active dimms: %d\n",
-		*channels, *csrows);
-
 	return 0;
 }

 static int get_dimm_config(struct mem_ctl_info *mci)
 {
 	struct sbridge_pvt *pvt = mci->pvt_info;
-	struct csrow_info *csr;
+	struct dimm_info *dimm;
 	int i, j, banks, ranks, rows, cols, size, npages;
-	int csrow = 0;
-	unsigned long last_page = 0;
 	u32 reg;
 	enum edac_type mode;
 	enum mem_type mtype;
@@ -616,7 +572,8 @@
 		u32 mtr;

 		for (j = 0; j < ARRAY_SIZE(mtr_regs); j++) {
-			struct dimm_info *dimm = &mci->dimms[j];
+			dimm = EDAC_DIMM_PTR(mci->layers, mci->dimms, mci->n_layers,
+				       i, j, 0);
 			pci_read_config_dword(pvt->pci_tad[i],
 					      mtr_regs[j], &mtr);
 			debugf4("Channel #%d  MTR%d = %x\n", i, j, mtr);
@@ -636,16 +593,6 @@
 					size, npages,
 					banks, ranks, rows, cols);

-				/*
-				 * Fake stuff. This controller doesn't see
-				 * csrows.
-				 */
-				csr = &mci->csrows[csrow];
-				pvt->csrow_map[i][j] = csrow;
-				last_page += npages;
-				csrow++;
-
-				csr->channels[0].dimm = dimm;
 				dimm->nr_pages = npages;
 				dimm->grain = 32;
 				dimm->dtype = (banks == 8) ? DEV_X8 : DEV_X4;
@@ -841,11 +788,10 @@
 				 u8 *socket,
 				 long *channel_mask,
 				 u8 *rank,
-				 char *area_type)
+				 char *area_type, char *msg)
 {
 	struct mem_ctl_info	*new_mci;
 	struct sbridge_pvt *pvt = mci->pvt_info;
-	char			msg[256];
 	int 			n_rir, n_sads, n_tads, sad_way, sck_xch;
 	int			sad_interl, idx, base_ch;
 	int			interleave_mode;
@@ -867,12 +813,10 @@
 	 */
 	if ((addr > (u64) pvt->tolm) && (addr < (1LL << 32))) {
 		sprintf(msg, "Error at TOLM area, on addr 0x%08Lx", addr);
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}
 	if (addr >= (u64)pvt->tohm) {
 		sprintf(msg, "Error at MMIOH area, on addr 0x%016Lx", addr);
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}

@@ -889,7 +833,6 @@
 		limit = SAD_LIMIT(reg);
 		if (limit <= prv) {
 			sprintf(msg, "Can't discover the memory socket");
-			edac_mc_handle_ce_no_info(mci, msg);
 			return -EINVAL;
 		}
 		if  (addr <= limit)
@@ -898,7 +841,6 @@
 	}
 	if (n_sads == MAX_SAD) {
 		sprintf(msg, "Can't discover the memory socket");
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}
 	area_type = get_dram_attr(reg);
@@ -939,7 +881,6 @@
 		break;
 	default:
 		sprintf(msg, "Can't discover socket interleave");
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}
 	*socket = sad_interleave[idx];
@@ -954,7 +895,6 @@
 	if (!new_mci) {
 		sprintf(msg, "Struct for socket #%u wasn't initialized",
 			*socket);
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}
 	mci = new_mci;
@@ -970,7 +910,6 @@
 		limit = TAD_LIMIT(reg);
 		if (limit <= prv) {
 			sprintf(msg, "Can't discover the memory channel");
-			edac_mc_handle_ce_no_info(mci, msg);
 			return -EINVAL;
 		}
 		if  (addr <= limit)
@@ -1010,7 +949,6 @@
 		break;
 	default:
 		sprintf(msg, "Can't discover the TAD target");
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}
 	*channel_mask = 1 << base_ch;
@@ -1024,7 +962,6 @@
 			break;
 		default:
 			sprintf(msg, "Invalid mirror set. Can't decode addr");
-			edac_mc_handle_ce_no_info(mci, msg);
 			return -EINVAL;
 		}
 	} else
@@ -1052,7 +989,6 @@
 	if (offset > addr) {
 		sprintf(msg, "Can't calculate ch addr: TAD offset 0x%08Lx is too high for addr 0x%08Lx!",
 			offset, addr);
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}
 	addr -= offset;
@@ -1092,7 +1028,6 @@
 	if (n_rir == MAX_RIR_RANGES) {
 		sprintf(msg, "Can't discover the memory rank for ch addr 0x%08Lx",
 			ch_addr);
-		edac_mc_handle_ce_no_info(mci, msg);
 		return -EINVAL;
 	}
 	rir_way = RIR_WAY(reg);
@@ -1406,7 +1341,8 @@
 {
 	struct mem_ctl_info *new_mci;
 	struct sbridge_pvt *pvt = mci->pvt_info;
-	char *type, *optype, *msg, *recoverable_msg;
+	enum hw_event_mc_err_type tp_event;
+	char *type, *optype, msg[256], *recoverable_msg;
 	bool ripv = GET_BITFIELD(m->mcgstatus, 0, 0);
 	bool overflow = GET_BITFIELD(m->status, 62, 62);
 	bool uncorrected_error = GET_BITFIELD(m->status, 61, 61);
@@ -1418,13 +1354,21 @@
 	u32 optypenum = GET_BITFIELD(m->status, 4, 6);
 	long channel_mask, first_channel;
 	u8  rank, socket;
-	int csrow, rc, dimm;
+	int rc, dimm;
 	char *area_type = "Unknown";

-	if (ripv)
-		type = "NON_FATAL";
-	else
-		type = "FATAL";
+	if (uncorrected_error) {
+		if (ripv) {
+			type = "FATAL";
+			tp_event = HW_EVENT_ERR_FATAL;
+		} else {
+			type = "NON_FATAL";
+			tp_event = HW_EVENT_ERR_UNCORRECTED;
+		}
+	} else {
+		type = "CORRECTED";
+		tp_event = HW_EVENT_ERR_CORRECTED;
+	}

 	/*
 	 * According with Table 15-9 of the Intel Archictecture spec vol 3A,
@@ -1442,19 +1386,19 @@
 	} else {
 		switch (optypenum) {
 		case 0:
-			optype = "generic undef request";
+			optype = "generic undef request error";
 			break;
 		case 1:
-			optype = "memory read";
+			optype = "memory read error";
 			break;
 		case 2:
-			optype = "memory write";
+			optype = "memory write error";
 			break;
 		case 3:
-			optype = "addr/cmd";
+			optype = "addr/cmd error";
 			break;
 		case 4:
-			optype = "memory scrubbing";
+			optype = "memory scrubbing error";
 			break;
 		default:
 			optype = "reserved";
@@ -1463,13 +1407,13 @@
 	}

 	rc = get_memory_error_data(mci, m->addr, &socket,
-				   &channel_mask, &rank, area_type);
+				   &channel_mask, &rank, area_type, msg);
 	if (rc < 0)
-		return;
+		goto err_parsing;
 	new_mci = get_mci_for_node_id(socket);
 	if (!new_mci) {
-		edac_mc_handle_ce_no_info(mci, "Error: socket got corrupted!");
-		return;
+		strcpy(msg, "Error: socket got corrupted!");
+		goto err_parsing;
 	}
 	mci = new_mci;
 	pvt = mci->pvt_info;
@@ -1483,8 +1427,6 @@
 	else
 		dimm = 2;

-	csrow = pvt->csrow_map[first_channel][dimm];
-
 	if (uncorrected_error && recoverable)
 		recoverable_msg = " recoverable";
 	else
@@ -1495,18 +1437,14 @@
 	 * Probably, we can just discard it, as the channel information
 	 * comes from the get_memory_error_data() address decoding
 	 */
-	msg = kasprintf(GFP_ATOMIC,
-			"%d %s error(s): %s on %s area %s%s: cpu=%d Err=%04x:%04x (ch=%d), "
-			"addr = 0x%08llx => socket=%d, Channel=%ld(mask=%ld), rank=%d\n",
+	snprintf(msg, sizeof(msg),
+			"%d error(s)%s: %s%s: cpu=%d Err=%04x:%04x addr = 0x%08llx socket=%d Channel=%ld(mask=%ld), rank=%d\n",
 			core_err_cnt,
+			overflow ? " OVERFLOW" : "",
 			area_type,
-			optype,
-			type,
 			recoverable_msg,
-			overflow ? "OVERFLOW" : "",
 			m->cpu,
 			mscod, errcode,
-			channel,		/* 1111b means not specified */
 			(long long) m->addr,
 			socket,
 			first_channel,		/* This is the real channel on SB */
@@ -1515,13 +1453,19 @@

 	debugf0("%s", msg);

+	/* FIXME: need support for channel mask */
+
 	/* Call the helper to output message */
-	if (uncorrected_error)
-		edac_mc_handle_fbd_ue(mci, csrow, 0, 0, msg);
-	else
-		edac_mc_handle_fbd_ce(mci, csrow, 0, msg);
-
-	kfree(msg);
+	edac_mc_handle_error(tp_event, mci,
+			     m->addr >> PAGE_SHIFT, m->addr & ~PAGE_MASK, 0,
+			     channel, dimm, -1,
+			     optype, msg, m);
+	return;
+err_parsing:
+	edac_mc_handle_error(tp_event, mci, 0, 0, 0,
+			     -1, -1, -1,
+			     msg, "", m);
+
 }

 /*
@@ -1680,16 +1624,25 @@
 static int sbridge_register_mci(struct sbridge_dev *sbridge_dev)
 {
 	struct mem_ctl_info *mci;
+	struct edac_mc_layer layers[2];
 	struct sbridge_pvt *pvt;
-	int rc, channels, csrows;
+	int rc;

 	/* Check the number of active and not disabled channels */
-	rc = sbridge_get_active_channels(sbridge_dev->bus, &channels, &csrows);
+	rc = check_if_ecc_is_active(sbridge_dev->bus);
 	if (unlikely(rc < 0))
 		return rc;

 	/* allocate a new MC control structure */
-	mci = edac_mc_alloc(sizeof(*pvt), csrows, channels, sbridge_dev->mc);
+	layers[0].type = EDAC_MC_LAYER_CHANNEL;
+	layers[0].size = NUM_CHANNELS;
+	layers[0].is_virt_csrow = false;
+	layers[1].type = EDAC_MC_LAYER_SLOT;
+	layers[1].size = MAX_DIMMS;
+	layers[1].is_virt_csrow = true;
+	mci = new_edac_mc_alloc(sbridge_dev->mc, ARRAY_SIZE(layers), layers,
+			    sizeof(*pvt));
+
 	if (unlikely(!mci))
 		return -ENOMEM;


Added some documentation for new features, see #70 Signed-off-by:doe300 <stadeldani@web.de>

Added some documentation for new features, see #70
Signed-off-by:doe300 <ea171286d560108c4b22a58de6300bfe96efc821@web.de>

--- include/sip/Authentication.h
+++ include/sip/Authentication.h
@@ -21,6 +21,8 @@
          * HTTP/SIP authentication
          *
          * see: RFC 2617 https://tools.ietf.org/html/rfc2617
+         *
+         * \since 0.9
          */
         class Authentication
         {
@@ -28,16 +30,48 @@
             Authentication();
             virtual ~Authentication();

+            /*!
+             * \param requestMethod The request-method required to authenticate
+             *
+             * \param requestURI The URI of the request to authenticate
+             *
+             * \param headerField The value of the WWW-Authenticate header-field
+             *
+             * \return the applicable authentication method or an empty pointer
+             */
             static std::unique_ptr<Authentication> getAuthenticationMethod(const std::string& requestMethod, const std::string& requestURI, const std::string& headerField);

+            /*!
+             * \param userName The name to authenticate with
+             *
+             * \param password The password to authenticate with
+             *
+             * \return The value of the Authenticate header-field
+             */
             virtual std::string createAuthenticationHeader(const std::string& userName, const std::string& password) = 0;

+            /*!
+             * Returns whether the authentication was successful.
+             *
+             * NOTE: An expired authentication will be treated as not authenticated
+             */
             bool isAuthenticated() const;

+            /*!
+             * Sets the authentication to successful and the time (in seconds) this authentication expires in
+             *
+             * \param expirationTime The time (in seconds) from now, this authentication will expire on server-side
+             */
             void setAuthenticated(const std::chrono::system_clock::time_point expirationTime);

+            /*!
+             * \return whether this authentication has already expired
+             */
             bool isExpired() const;

+            /*!
+             * \return The time-point on which this authentication will expire
+             */
             std::chrono::system_clock::time_point getExpirationTime() const;

         private:
@@ -46,6 +80,13 @@
             std::chrono::system_clock::time_point expirationTime;
         };

+        /*!
+         * Basic HTTP/SIP authentication
+         *
+         * Sends a Base64 encoded concatenation of user-name and password
+         *
+         * NOTE: SIP actually does not allow this to be used (only digest authentication), but it was so easy to implement...
+         */
         class BasicAuthentication : public Authentication
         {
         public:
@@ -56,6 +97,14 @@
             std::string createAuthenticationHeader(const std::string& userName, const std::string& password) override;
         };

+        /*!
+         * Digest HTTP/SIP authentication
+         *
+         * Uses a challenge send by the server and responds with a hashed version of the answer
+         *
+         * NOTE: The default hash, MD5, is considered to be a WEAK hash and should therefore not be used anymore, but SIP
+         * still requires it to be supported, so we do
+         */
         class DigestAuthentication : public Authentication
         {
         public:


gpio: ge: fix compilation error

gpio: ge: fix compilation error

Include linux/slab.h to fix following compilation error.

drivers/gpio/gpio-ge.c: In function â€˜gef_gpio_probeâ€™:
drivers/gpio/gpio-ge.c:95:2: error: implicit declaration of function â€˜kfreeâ€™ [-Werror=implicit-function-declaration]
  kfree(bgc->gc.label);

Signed-off-by: Kamlakant Patel <9c76e40525d0071d263a497e0e6d1e431143c489@linaro.org>
Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>

--- drivers/gpio/gpio-ge.c
+++ drivers/gpio/gpio-ge.c
@@ -19,6 +19,7 @@

 #include <linux/kernel.h>
 #include <linux/io.h>
+#include <linux/slab.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/of_address.h>


document STXXL_WAIT_LOG_ENABLED

document STXXL_WAIT_LOG_ENABLED

git-svn-id: 4e7379b20b57f8e3dde5a0b7363f233184647162@1916 4e380d45-d1fd-0310-85a7-d18ec86df0ad

--- include/stxxl/bits/defines.h
+++ include/stxxl/bits/defines.h
@@ -25,6 +25,11 @@
 // used in: io/iostats.{h,cpp}
 // effect:  makes calls to wait time counting functions no-ops

+//#define STXXL_WAIT_LOG_ENABLED
+// default: not defined
+// used in: io/iostats.{h,cpp}
+// effect:  writes wait timing information to stxxl.waitlog
+
 //#define STXXL_SORT_OPTIMAL_PREFETCHING 0/1
 // default: 1
 // used in: algo/*sort.h, stream/sort_stream.h


gpio: handle pca953{4,5,6,7,8} too

gpio: handle pca953{4,5,6,7,8} too

This third part of an extension to support more pca953x chips updates the
logic to handle the smaller register widths used by the 4-bit and 8-bit parts,
and to use the chip type to determine how many GPIOs it provides.

As long as we don't support interrupt and reset capabilities, those size
issues are the only software-visible differences between these parts.

Signed-off-by: Guennadi Liakhovetski <50875182aae23d69ca7738697596f18a14e926fc@pengutronix.de>
Signed-off-by: David Brownell <a0d09457d62acbdeb1fae1223575100ccbfffdf9@users.sourceforge.net>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- drivers/gpio/pca953x.c
+++ drivers/gpio/pca953x.c
@@ -1,5 +1,5 @@
 /*
- *  pca953x.c - 16-bit I/O port with interrupt and reset
+ *  pca953x.c - 4/8/16 bit I/O ports
  *
  *  Copyright (C) 2005 Ben Gardner <bgardner@wabtec.com>
  *  Copyright (C) 2007 Marvell International Ltd.
@@ -18,13 +18,26 @@

 #include <asm/gpio.h>

-
-#define NR_PCA953X_GPIOS	16
-
-#define PCA953X_INPUT		0
-#define PCA953X_OUTPUT		2
-#define PCA953X_INVERT		4
-#define PCA953X_DIRECTION	6
+#define PCA953X_INPUT          0
+#define PCA953X_OUTPUT         1
+#define PCA953X_INVERT         2
+#define PCA953X_DIRECTION      3
+
+/* This is temporary - in 2.6.26 i2c_driver_data should replace it. */
+struct pca953x_desc {
+	char		name[I2C_NAME_SIZE];
+	unsigned long	driver_data;
+};
+
+static const struct pca953x_desc pca953x_descs[] = {
+	{ "pca9534", 8, },
+	{ "pca9535", 16, },
+	{ "pca9536", 4, },
+	{ "pca9537", 4, },
+	{ "pca9538", 8, },
+	{ "pca9539", 16, },
+	/* REVISIT several pca955x parts should work here too */
+};

 struct pca953x_chip {
 	unsigned gpio_start;
@@ -40,17 +53,30 @@
  */
 static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val)
 {
-	if (i2c_smbus_write_word_data(chip->client, reg, val) < 0)
+	int ret;
+
+	if (chip->gpio_chip.ngpio <= 8)
+		ret = i2c_smbus_write_byte_data(chip->client, reg, val);
+	else
+		ret = i2c_smbus_write_word_data(chip->client, reg << 1, val);
+
+	if (ret < 0) {
+		dev_err(&chip->client->dev, "failed writing register\n");
 		return -EIO;
+	}
+
+	return 0;
+}
+
+static int pca953x_read_reg(struct pca953x_chip *chip, int reg, uint16_t *val)
+{
+	int ret;
+
+	if (chip->gpio_chip.ngpio <= 8)
+		ret = i2c_smbus_read_byte_data(chip->client, reg);
 	else
-		return 0;
-}
-
-static int pca953x_read_reg(struct pca953x_chip *chip, int reg, uint16_t *val)
-{
-	int ret;
-
-	ret = i2c_smbus_read_word_data(chip->client, reg);
+		ret = i2c_smbus_read_word_data(chip->client, reg << 1);
+
 	if (ret < 0) {
 		dev_err(&chip->client->dev, "failed reading register\n");
 		return -EIO;
@@ -148,7 +174,7 @@
 	chip->reg_output = reg_val;
 }

-static int pca953x_init_gpio(struct pca953x_chip *chip)
+static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
 {
 	struct gpio_chip *gc;

@@ -160,22 +186,30 @@
 	gc->set = pca953x_gpio_set_value;

 	gc->base = chip->gpio_start;
-	gc->ngpio = NR_PCA953X_GPIOS;
-	gc->label = "pca953x";
-
-	return gpiochip_add(gc);
+	gc->ngpio = gpios;
+	gc->label = chip->client->name;
 }

 static int __devinit pca953x_probe(struct i2c_client *client)
 {
 	struct pca953x_platform_data *pdata;
 	struct pca953x_chip *chip;
-	int ret;
+	int ret, i;
+	const struct pca953x_desc *id = NULL;

 	pdata = client->dev.platform_data;
 	if (pdata == NULL)
 		return -ENODEV;

+	/* this loop vanishes when we get i2c_device_id */
+	for (i = 0; i < ARRAY_SIZE(pca953x_descs); i++)
+		if (!strcmp(pca953x_descs[i].name, client->name)) {
+			id = pca953x_descs + i;
+			break;
+		}
+	if (!id)
+		return -ENODEV;
+
 	chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL);
 	if (chip == NULL)
 		return -ENOMEM;
@@ -187,6 +221,8 @@
 	/* initialize cached registers from their original values.
 	 * we can't share this chip with another i2c master.
 	 */
+	pca953x_setup_gpio(chip, id->driver_data);
+
 	ret = pca953x_read_reg(chip, PCA953X_OUTPUT, &chip->reg_output);
 	if (ret)
 		goto out_failed;
@@ -200,7 +236,8 @@
 	if (ret)
 		goto out_failed;

-	ret = pca953x_init_gpio(chip);
+
+	ret = gpiochip_add(&chip->gpio_chip);
 	if (ret)
 		goto out_failed;


msm: kgsl: Use ERR_PTR to return errors from kgsl_create_context()

Normally kgsl_create_context() returns a pointer to a new context.
In case of errors it just returns NULL pointer, and that doesn't allow
to propagate the right error code back to the user via
kgsl_ioctl_drawctxt_create()
This fix modifies kgsl_create_context to use ERR_PTR macro for passing
error codes to its caller.

Change-Id: I447c1765828912b0994bcae67a73864e62eef9b6
Signed-off-by: Vladimir Razgulin <8eaa3efb18b230dd66a618fbfc839294f1763d4e@codeaurora.org>

--- drivers/gpu/msm/kgsl.c
+++ drivers/gpu/msm/kgsl.c
@@ -332,14 +332,17 @@

 	context = kzalloc(sizeof(*context), GFP_KERNEL);

-	if (context == NULL)
-		return NULL;
+	if (context == NULL) {
+		KGSL_DRV_INFO(dev_priv->device, "kzalloc(%d) failed\n",
+				sizeof(*context));
+		return ERR_PTR(-ENOMEM);
+	}

 	id = idr_alloc(&dev_priv->device->context_idr, context, 1, 0,
 			GFP_KERNEL);
 	if (id < 0) {
-		kfree(context);
-		return NULL;
+		ret = id;
+		goto func_end;
 	}

 	/* MAX - 1, there is one memdesc in memstore for device info */
@@ -348,18 +351,24 @@
 				"ctxts due to memstore limitation\n",
 				KGSL_MEMSTORE_MAX);
 		idr_remove(&dev_priv->device->context_idr, id);
-		kfree(context);
-		return NULL;
+		ret = -ENOSPC;
+		goto func_end;
 	}

 	kref_init(&context->refcount);
 	context->id = id;
 	context->dev_priv = dev_priv;

-	if (kgsl_sync_timeline_create(context)) {
+	ret = kgsl_sync_timeline_create(context);
+	if (ret) {
 		idr_remove(&dev_priv->device->context_idr, id);
+		goto func_end;
+	}
+
+func_end:
+	if (ret) {
 		kfree(context);
-		return NULL;
+		return ERR_PTR(ret);
 	}

 	return context;
@@ -1270,8 +1279,8 @@

 	context = kgsl_create_context(dev_priv);

-	if (context == NULL) {
-		result = -ENOMEM;
+	if (IS_ERR(context)) {
+		result = PTR_ERR(context);
 		goto done;
 	}

@@ -1285,7 +1294,7 @@
 	trace_kgsl_context_create(dev_priv->device, context, param->flags);
 	param->drawctxt_id = context->id;
 done:
-	if (result && context)
+	if (result && !IS_ERR(context))
 		kgsl_context_detach(context);

 	return result;


fix difference of style

fix difference of style

--- components/drivers/src/dataqueue.c
+++ components/drivers/src/dataqueue.c
@@ -43,7 +43,7 @@

     rt_list_init(&(queue->suspended_push_list));
     rt_list_init(&(queue->suspended_pop_list));
-
+
     queue->queue = (struct rt_data_item *)rt_malloc(sizeof(struct rt_data_item) * size);
     if (queue->queue == RT_NULL)
     {


HID: sony: fix uninitialized per-controller spinlock

Per-controller spinlock needs to be properly initialized during device probe.

[ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz: massage changelog]
[ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz: drop hunk that has already been applied by previous
 patch]
Signed-off-by: Frank Praznik <f15ca1017e972332ff061b480de666d55b1ccfa2@oh.rr.com>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

--- drivers/hid/hid-sony.c
+++ drivers/hid/hid-sony.c
@@ -1944,6 +1944,8 @@
 		return -ENOMEM;
 	}

+	spin_lock_init(&sc->lock);
+
 	sc->quirks = quirks;
 	hid_set_drvdata(hdev, sc);
 	sc->hdev = hdev;


hwmon/ds1621: Fix swapped temperature limits

The low temperature limit and the high temperature limit registers
have been accidentally swapped, causing alarms to trigger
when they shouldn't.

Signed-off-by: Jean Delvare <49ad6a9f5aa17024c23048df346d55bda6837e01@linux-fr.org>
Acked-by: Aurelien Jarno <bceb368e7f2cb351af47298f32034f0587bbe4a6@aurel32.net>

--- drivers/hwmon/ds1621.c
+++ drivers/hwmon/ds1621.c
@@ -53,8 +53,8 @@

 /* The DS1621 registers */
 #define DS1621_REG_TEMP			0xAA /* word, RO */
-#define DS1621_REG_TEMP_MIN		0xA1 /* word, RW */
-#define DS1621_REG_TEMP_MAX		0xA2 /* word, RW */
+#define DS1621_REG_TEMP_MIN		0xA2 /* word, RW */
+#define DS1621_REG_TEMP_MAX		0xA1 /* word, RW */
 #define DS1621_REG_CONF			0xAC /* byte, RW */
 #define DS1621_COM_START		0xEE /* no data */
 #define DS1621_COM_STOP			0x22 /* no data */
@@ -328,9 +328,9 @@

 		/* reset alarms if necessary */
 		new_conf = data->conf;
-		if (data->temp < data->temp_min)
+		if (data->temp > data->temp_min)
 			new_conf &= ~DS1621_ALARM_TEMP_LOW;
-		if (data->temp > data->temp_max)
+		if (data->temp < data->temp_max)
 			new_conf &= ~DS1621_ALARM_TEMP_HIGH;
 		if (data->conf != new_conf)
 			ds1621_write_value(client, DS1621_REG_CONF,


hwmon: (ina2xx) use module_i2c_driver to simplify the code

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <b8f9cab8be13de37b9588aedad10a20fc3a68783@trendmicro.com.cn>
Signed-off-by: Guenter Roeck <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@roeck-us.net>

--- drivers/hwmon/ina2xx.c
+++ drivers/hwmon/ina2xx.c
@@ -302,19 +302,8 @@
 	.id_table	= ina2xx_id,
 };

-static int __init ina2xx_init(void)
-{
-	return i2c_add_driver(&ina2xx_driver);
-}
-
-static void __exit ina2xx_exit(void)
-{
-	i2c_del_driver(&ina2xx_driver);
-}
+module_i2c_driver(ina2xx_driver);

 MODULE_AUTHOR("Lothar Felten <l-felten@ti.com>");
 MODULE_DESCRIPTION("ina2xx driver");
 MODULE_LICENSE("GPL");
-
-module_init(ina2xx_init);
-module_exit(ina2xx_exit);


i2c: i2c EXPORT_SYMBOL cleanup

i2c: i2c EXPORT_SYMBOL cleanup

Make i2c-core.c obey Documentation/CodingStyle better by snugging
the EXPORT_SYMBOL declarations next to the relevant definitions.

Signed-off-by: David Brownell <a0d09457d62acbdeb1fae1223575100ccbfffdf9@users.sourceforge.net>
Signed-off-by: Jean Delvare <49ad6a9f5aa17024c23048df346d55bda6837e01@linux-fr.org>

--- drivers/i2c/i2c-core.c
+++ drivers/i2c/i2c-core.c
@@ -201,6 +201,7 @@
 	.suspend	= i2c_device_suspend,
 	.resume		= i2c_device_resume,
 };
+EXPORT_SYMBOL_GPL(i2c_bus_type);

 /**
  * i2c_new_device - instantiate an i2c device for use with a new style driver
@@ -285,6 +286,7 @@
 	struct i2c_adapter *adap = to_i2c_adapter(dev);
 	complete(&adap->dev_released);
 }
+EXPORT_SYMBOL_GPL(i2c_adapter_dev_release);	/* exported to i2c-isa */

 static ssize_t
 show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
@@ -303,6 +305,7 @@
 	.name			= "i2c-adapter",
 	.dev_attrs		= i2c_adapter_attrs,
 };
+EXPORT_SYMBOL_GPL(i2c_adapter_class);		/* exported to i2c-isa */

 static void i2c_scan_static_board_info(struct i2c_adapter *adapter)
 {
@@ -533,6 +536,7 @@
 	mutex_unlock(&core_lists);
 	return res;
 }
+EXPORT_SYMBOL(i2c_del_adapter);

 /* ------------------------------------------------------------------------- */
@@ -650,6 +654,7 @@
 	mutex_unlock(&core_lists);
 	return 0;
 }
+EXPORT_SYMBOL(i2c_del_driver);

 /* ------------------------------------------------------------------------- */

@@ -676,6 +681,7 @@

 	return rval;
 }
+EXPORT_SYMBOL(i2c_check_addr);

 int i2c_attach_client(struct i2c_client *client)
 {
@@ -729,7 +735,7 @@
 	mutex_unlock(&adapter->clist_lock);
 	return res;
 }
-
+EXPORT_SYMBOL(i2c_attach_client);

 int i2c_detach_client(struct i2c_client *client)
 {
@@ -762,6 +768,7 @@
  out:
 	return res;
 }
+EXPORT_SYMBOL(i2c_detach_client);

 static int i2c_inc_use_client(struct i2c_client *client)
 {
@@ -794,6 +801,7 @@

 	return 0;
 }
+EXPORT_SYMBOL(i2c_use_client);

 int i2c_release_client(struct i2c_client *client)
 {
@@ -808,6 +816,7 @@

 	return 0;
 }
+EXPORT_SYMBOL(i2c_release_client);

 void i2c_clients_command(struct i2c_adapter *adap, unsigned int cmd, void *arg)
 {
@@ -828,6 +837,7 @@
        }
        mutex_unlock(&adap->clist_lock);
 }
+EXPORT_SYMBOL(i2c_clients_command);

 static int __init i2c_init(void)
 {
@@ -877,6 +887,7 @@
 		return -ENOSYS;
 	}
 }
+EXPORT_SYMBOL(i2c_transfer);

 int i2c_master_send(struct i2c_client *client,const char *buf ,int count)
 {
@@ -895,6 +906,7 @@
 	   transmitted, else error code. */
 	return (ret == 1) ? count : ret;
 }
+EXPORT_SYMBOL(i2c_master_send);

 int i2c_master_recv(struct i2c_client *client, char *buf ,int count)
 {
@@ -914,7 +926,7 @@
 	   transmitted, else error code. */
 	return (ret == 1) ? count : ret;
 }
-
+EXPORT_SYMBOL(i2c_master_recv);

 int i2c_control(struct i2c_client *client,
 	unsigned int cmd, unsigned long arg)
@@ -936,6 +948,7 @@
 	}
 	return ret;
 }
+EXPORT_SYMBOL(i2c_control);

 /* ----------------------------------------------------
  * the i2c address scanning function
@@ -1077,6 +1090,7 @@

 	return 0;
 }
+EXPORT_SYMBOL(i2c_probe);

 struct i2c_adapter* i2c_get_adapter(int id)
 {
@@ -1090,11 +1104,13 @@
 	mutex_unlock(&core_lists);
 	return adapter;
 }
+EXPORT_SYMBOL(i2c_get_adapter);

 void i2c_put_adapter(struct i2c_adapter *adap)
 {
 	module_put(adap->owner);
 }
+EXPORT_SYMBOL(i2c_put_adapter);

 /* The SMBus parts */

@@ -1163,6 +1179,7 @@
 	return i2c_smbus_xfer(client->adapter,client->addr,client->flags,
 	                      value,0,I2C_SMBUS_QUICK,NULL);
 }
+EXPORT_SYMBOL(i2c_smbus_write_quick);

 s32 i2c_smbus_read_byte(struct i2c_client *client)
 {
@@ -1173,12 +1190,14 @@
 	else
 		return data.byte;
 }
+EXPORT_SYMBOL(i2c_smbus_read_byte);

 s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value)
 {
 	return i2c_smbus_xfer(client->adapter,client->addr,client->flags,
 	                      I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL);
 }
+EXPORT_SYMBOL(i2c_smbus_write_byte);

 s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command)
 {
@@ -1189,6 +1208,7 @@
 	else
 		return data.byte;
 }
+EXPORT_SYMBOL(i2c_smbus_read_byte_data);

 s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 command, u8 value)
 {
@@ -1198,6 +1218,7 @@
 	                      I2C_SMBUS_WRITE,command,
 	                      I2C_SMBUS_BYTE_DATA,&data);
 }
+EXPORT_SYMBOL(i2c_smbus_write_byte_data);

 s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command)
 {
@@ -1208,6 +1229,7 @@
 	else
 		return data.word;
 }
+EXPORT_SYMBOL(i2c_smbus_read_word_data);

 s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value)
 {
@@ -1217,6 +1239,7 @@
 	                      I2C_SMBUS_WRITE,command,
 	                      I2C_SMBUS_WORD_DATA,&data);
 }
+EXPORT_SYMBOL(i2c_smbus_write_word_data);

 s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command,
 			       u8 length, const u8 *values)
@@ -1231,6 +1254,7 @@
 			      I2C_SMBUS_WRITE,command,
 			      I2C_SMBUS_BLOCK_DATA,&data);
 }
+EXPORT_SYMBOL(i2c_smbus_write_block_data);

 /* Returns the number of read bytes */
 s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *values)
@@ -1245,6 +1269,7 @@
 	memcpy(values, &data.block[1], data.block[0]);
 	return data.block[0];
 }
+EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);

 s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command,
 				   u8 length, const u8 *values)
@@ -1259,6 +1284,7 @@
 			      I2C_SMBUS_WRITE, command,
 			      I2C_SMBUS_I2C_BLOCK_DATA, &data);
 }
+EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data);

 /* Simulate a SMBus command using the i2c protocol
    No checking of parameters is done!  */
@@ -1445,41 +1471,7 @@

 	return res;
 }
-
-
-/* Next three are needed by i2c-isa */
-EXPORT_SYMBOL_GPL(i2c_adapter_dev_release);
-EXPORT_SYMBOL_GPL(i2c_adapter_class);
-EXPORT_SYMBOL_GPL(i2c_bus_type);
-
-EXPORT_SYMBOL(i2c_del_adapter);
-EXPORT_SYMBOL(i2c_del_driver);
-EXPORT_SYMBOL(i2c_attach_client);
-EXPORT_SYMBOL(i2c_detach_client);
-EXPORT_SYMBOL(i2c_use_client);
-EXPORT_SYMBOL(i2c_release_client);
-EXPORT_SYMBOL(i2c_clients_command);
-EXPORT_SYMBOL(i2c_check_addr);
-
-EXPORT_SYMBOL(i2c_master_send);
-EXPORT_SYMBOL(i2c_master_recv);
-EXPORT_SYMBOL(i2c_control);
-EXPORT_SYMBOL(i2c_transfer);
-EXPORT_SYMBOL(i2c_get_adapter);
-EXPORT_SYMBOL(i2c_put_adapter);
-EXPORT_SYMBOL(i2c_probe);
-
 EXPORT_SYMBOL(i2c_smbus_xfer);
-EXPORT_SYMBOL(i2c_smbus_write_quick);
-EXPORT_SYMBOL(i2c_smbus_read_byte);
-EXPORT_SYMBOL(i2c_smbus_write_byte);
-EXPORT_SYMBOL(i2c_smbus_read_byte_data);
-EXPORT_SYMBOL(i2c_smbus_write_byte_data);
-EXPORT_SYMBOL(i2c_smbus_read_word_data);
-EXPORT_SYMBOL(i2c_smbus_write_word_data);
-EXPORT_SYMBOL(i2c_smbus_write_block_data);
-EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
-EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data);

 MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
 MODULE_DESCRIPTION("I2C-Bus main module");


read-dict.c: Remove unneeded include regex-morph.h

--- link-grammar/dict-file/read-dict.c
+++ link-grammar/dict-file/read-dict.c
@@ -18,7 +18,6 @@
 #include "dict-common/dict-defines.h" // For SUBSCRIPT_MARK
 #include "dict-common/file-utils.h"
 #include "dict-common/idiom.h"
-#include "dict-common/regex-morph.h"
 #include "error.h"
 #include "print/print.h"
 #include "externs.h"


ide: fix ->data_phase in taskfile_load_raw()

It should be TASKFILE_NO_DATA, not TASKFILE_IN.  Luckily ATM ->data_phase is
unused if ->command_type == IDE_DRIVE_TASK_NO_DATA but this may change in the
future.

Signed-off-by: Bartlomiej Zolnierkiewicz <248de9df611a028e5eceb9d893a2ed6c24c89ef4@gmail.com>

--- drivers/ide/ide-acpi.c
+++ drivers/ide/ide-acpi.c
@@ -350,7 +350,7 @@

 	memset(&args, 0, sizeof(ide_task_t));
 	args.command_type = IDE_DRIVE_TASK_NO_DATA;
-	args.data_phase   = TASKFILE_IN;
+	args.data_phase   = TASKFILE_NO_DATA;
 	args.handler      = &task_no_data_intr;

 	/* convert gtf to IDE Taskfile */


ide-tape: convert ide_do_drive_cmd path to use blk_execute_rq

This converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori <93dac1fe9c4b2a3957982200319981492ad4976e@lab.ntt.co.jp>
Cc: Borislav Petkov <05cf5215df467c93a630616da7c46dd16a0a5f70@gmail.com>
Cc: Jens Axboe <165ab144a3ccfd9429d5c6466b275f24fafdb114@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <248de9df611a028e5eceb9d893a2ed6c24c89ef4@gmail.com>

--- drivers/ide/ide-tape.c
+++ drivers/ide/ide-tape.c
@@ -1519,12 +1519,16 @@
 static int idetape_queue_pc_tail(ide_drive_t *drive, struct ide_atapi_pc *pc)
 {
 	struct ide_tape_obj *tape = drive->driver_data;
-	struct request rq;
-
-	idetape_init_rq(&rq, REQ_IDETAPE_PC1);
-	rq.buffer = (char *) pc;
-	rq.rq_disk = tape->disk;
-	return ide_do_drive_cmd(drive, &rq, ide_wait);
+	struct request *rq;
+	int error;
+
+	rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
+	rq->cmd_type = REQ_TYPE_SPECIAL;
+	rq->cmd[0] = REQ_IDETAPE_PC1;
+	rq->buffer = (char *)pc;
+	error = blk_execute_rq(drive->queue, tape->disk, rq, 0);
+	blk_put_request(rq);
+	return error;
 }

 static void idetape_create_load_unload_cmd(ide_drive_t *drive,
@@ -1701,26 +1705,33 @@
 				 struct idetape_bh *bh)
 {
 	idetape_tape_t *tape = drive->driver_data;
-	struct request rq;
+	struct request *rq;
+	int ret, errors;

 	debug_log(DBG_SENSE, "%s: cmd=%d\n", __func__, cmd);

-	idetape_init_rq(&rq, cmd);
-	rq.rq_disk = tape->disk;
-	rq.special = (void *)bh;
-	rq.sector = tape->first_frame;
-	rq.nr_sectors		= blocks;
-	rq.current_nr_sectors	= blocks;
-	(void) ide_do_drive_cmd(drive, &rq, ide_wait);
+	rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
+	rq->cmd_type = REQ_TYPE_SPECIAL;
+	rq->cmd[0] = cmd;
+	rq->rq_disk = tape->disk;
+	rq->special = (void *)bh;
+	rq->sector = tape->first_frame;
+	rq->nr_sectors = blocks;
+	rq->current_nr_sectors = blocks;
+	blk_execute_rq(drive->queue, tape->disk, rq, 0);
+
+	errors = rq->errors;
+	ret = tape->blk_size * (blocks - rq->current_nr_sectors);
+	blk_put_request(rq);

 	if ((cmd & (REQ_IDETAPE_READ | REQ_IDETAPE_WRITE)) == 0)
 		return 0;

 	if (tape->merge_bh)
 		idetape_init_merge_buffer(tape);
-	if (rq.errors == IDETAPE_ERROR_GENERAL)
+	if (errors == IDETAPE_ERROR_GENERAL)
 		return -EIO;
-	return (tape->blk_size * (blocks-rq.current_nr_sectors));
+	return ret;
 }

 static void idetape_create_inquiry_cmd(struct ide_atapi_pc *pc)


[PATCH] piix: add Intel ICH8M device IDs

Signed-off-by: Jason Gaston <d8c34119e6b5bb58d6f8dee037ffe19dee91188a@intel.com>
Acked-by: Bartlomiej Zolnierkiewicz <248de9df611a028e5eceb9d893a2ed6c24c89ef4@gmail.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- drivers/ide/pci/piix.c
+++ drivers/ide/pci/piix.c
@@ -135,6 +135,7 @@
 		case PCI_DEVICE_ID_INTEL_ICH6_19:
 		case PCI_DEVICE_ID_INTEL_ICH7_21:
 		case PCI_DEVICE_ID_INTEL_ESB2_18:
+		case PCI_DEVICE_ID_INTEL_ICH8_6:
 			mode = 3;
 			break;
 		/* UDMA 66 capable */
@@ -449,6 +450,7 @@
 		case PCI_DEVICE_ID_INTEL_ICH6_19:
 		case PCI_DEVICE_ID_INTEL_ICH7_21:
 		case PCI_DEVICE_ID_INTEL_ESB2_18:
+		case PCI_DEVICE_ID_INTEL_ICH8_6:
 		{
 			unsigned int extra = 0;
 			pci_read_config_dword(dev, 0x54, &extra);
@@ -575,6 +577,7 @@
 	/* 21 */ DECLARE_PIIX_DEV("ICH7"),
 	/* 22 */ DECLARE_PIIX_DEV("ICH4"),
 	/* 23 */ DECLARE_PIIX_DEV("ESB2"),
+	/* 24 */ DECLARE_PIIX_DEV("ICH8M"),
 };

 /**
@@ -651,6 +654,7 @@
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 21},
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 22},
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_18, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 23},
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 24},
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, piix_pci_tbl);


[PATCH] KVM: Fix oops on oom

[PATCH] KVM: Fix oops on oom

__free_page() doesn't like a NULL argument, so check before calling it.  A
NULL can only happen if memory is exhausted during allocation of a memory
slot.

Signed-off-by: Avi Kivity <8f920f22884d6fea9df883843c4a8095a2e5ac6f@qumranet.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- drivers/kvm/kvm_main.c
+++ drivers/kvm/kvm_main.c
@@ -245,7 +245,8 @@
 	if (!dont || free->phys_mem != dont->phys_mem)
 		if (free->phys_mem) {
 			for (i = 0; i < free->npages; ++i)
-				__free_page(free->phys_mem[i]);
+				if (free->phys_mem[i])
+					__free_page(free->phys_mem[i]);
 			vfree(free->phys_mem);
 		}


mfd: sec-core: Fix IRQ handling after resume if this is not a wakeup source

During suspend the IRQ should be disabled even if this is not a wakeup
source. This is a proper way of fixing the IRQ handling issue during
resume (IRQ handler fails because I2C bus did not resume yet).

When device is suspended and sec-core interrupt is signaled the irq chip
will try to handle it regardless of wakeup source. Device could be woken
up by different IRQ but still the IRQ handler will try to read the
registers over I2C bus and fail because I2C bus won't be ready yet.

Signed-off-by: Krzysztof Kozlowski <1a8531307367602b8284517edb33d53d54e5ce8e@samsung.com>
Signed-off-by: Lee Jones <630e34333487a351a857f6b705e04d30b37c1629@linaro.org>

--- drivers/mfd/sec-core.c
+++ drivers/mfd/sec-core.c
@@ -374,19 +374,18 @@
 	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
 	struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);

-	if (device_may_wakeup(dev)) {
+	if (device_may_wakeup(dev))
 		enable_irq_wake(sec_pmic->irq);
-		/*
-		 * PMIC IRQ must be disabled during suspend for RTC alarm
-		 * to work properly.
-		 * When device is woken up from suspend by RTC Alarm, an
-		 * interrupt occurs before resuming I2C bus controller.
-		 * The interrupt is handled by regmap_irq_thread which tries
-		 * to read RTC registers. This read fails (I2C is still
-		 * suspended) and RTC Alarm interrupt is disabled.
-		 */
-		disable_irq(sec_pmic->irq);
-	}
+	/*
+	 * PMIC IRQ must be disabled during suspend for RTC alarm
+	 * to work properly.
+	 * When device is woken up from suspend, an
+	 * interrupt occurs before resuming I2C bus controller.
+	 * The interrupt is handled by regmap_irq_thread which tries
+	 * to read RTC registers. This read fails (I2C is still
+	 * suspended) and RTC Alarm interrupt is disabled.
+	 */
+	disable_irq(sec_pmic->irq);

 	return 0;
 }
@@ -396,10 +395,9 @@
 	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
 	struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);

-	if (device_may_wakeup(dev)) {
+	if (device_may_wakeup(dev))
 		disable_irq_wake(sec_pmic->irq);
-		enable_irq(sec_pmic->irq);
-	}
+	enable_irq(sec_pmic->irq);

 	return 0;
 }


mmc: core: Remove redundant ->power_restore() callback for MMC

Since the ->reset() callback is implemented for MMC, the ->power_restore()
callback has become redundant, let's remove it.

Signed-off-by: Ulf Hansson <fe47b31f388f85ce6ddf64bf3a0cf6b46077d0e6@linaro.org>

--- drivers/mmc/core/mmc.c
+++ drivers/mmc/core/mmc.c
@@ -1910,17 +1910,6 @@
 	return 0;
 }

-static int mmc_power_restore(struct mmc_host *host)
-{
-	int ret;
-
-	mmc_claim_host(host);
-	ret = mmc_init_card(host, host->card->ocr, host->card);
-	mmc_release_host(host);
-
-	return ret;
-}
-
 int mmc_can_reset(struct mmc_card *card)
 {
 	u8 rst_n_function;
@@ -1958,7 +1947,7 @@
 	mmc_set_initial_state(host);
 	mmc_host_clk_release(host);

-	return mmc_power_restore(host);
+	return mmc_init_card(host, card->ocr, card);
 }

 static const struct mmc_bus_ops mmc_ops = {
@@ -1968,7 +1957,6 @@
 	.resume = mmc_resume,
 	.runtime_suspend = mmc_runtime_suspend,
 	.runtime_resume = mmc_runtime_resume,
-	.power_restore = mmc_power_restore,
 	.alive = mmc_alive,
 	.shutdown = mmc_shutdown,
 	.reset = mmc_reset,


UBI: change cascade of ifs to switch statements

This patch improves readability and simplifies scanning code by changing a
long cascade of 'if' statements to a switch statement. This should presumably
be a little faster as well.

Signed-off-by: Artem Bityutskiy <19b5733dcea388885746d36043d3568bba5b4df7@nokia.com>

--- drivers/mtd/ubi/scan.c
+++ drivers/mtd/ubi/scan.c
@@ -746,11 +746,18 @@
 	err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0);
 	if (err < 0)
 		return err;
-	else if (err == UBI_IO_BITFLIPS)
+	switch (err) {
+	case 0:
+		break;
+	case UBI_IO_BITFLIPS:
 		bitflips = 1;
-	else if (err == UBI_IO_FF || err == UBI_IO_FF_BITFLIPS)
+		break;
+	case UBI_IO_FF:
+	case UBI_IO_FF_BITFLIPS:
 		return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase);
-	else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR) {
+	case UBI_IO_BAD_HDR_EBADMSG:
+		si->read_err_count += 1;
+	case UBI_IO_BAD_HDR:
 		/*
 		 * We have to also look at the VID header, possibly it is not
 		 * corrupted. Set %bitflips flag in order to make this PEB be
@@ -759,6 +766,10 @@
 		ec_err = err;
 		ec = UBI_SCAN_UNKNOWN_EC;
 		bitflips = 1;
+		break;
+	default:
+		ubi_err("'ubi_io_read_ec_hdr()' returned unknown code %d", err);
+		return -EINVAL;
 	}

 	if (!ec_err) {
@@ -814,24 +825,32 @@
 	err = ubi_io_read_vid_hdr(ubi, pnum, vidh, 0);
 	if (err < 0)
 		return err;
-	else if (err == UBI_IO_BITFLIPS)
+	switch (err) {
+	case 0:
+		break;
+	case UBI_IO_BITFLIPS:
 		bitflips = 1;
-	else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR ||
-		 (err == UBI_IO_FF && ec_err) || err == UBI_IO_FF_BITFLIPS) {
-		/* VID header is corrupted */
-		if (err == UBI_IO_BAD_HDR_EBADMSG ||
-		    ec_err == UBI_IO_BAD_HDR_EBADMSG)
-			si->read_err_count += 1;
+		break;
+	case UBI_IO_BAD_HDR_EBADMSG:
+		si->read_err_count += 1;
+	case UBI_IO_BAD_HDR:
+	case UBI_IO_FF_BITFLIPS:
 		err = add_to_list(si, pnum, ec, &si->corr);
 		if (err)
 			return err;
 		goto adjust_mean_ec;
-	} else if (err == UBI_IO_FF) {
-		/* No VID header - the physical eraseblock is free */
-		err = add_to_list(si, pnum, ec, &si->free);
+	case UBI_IO_FF:
+		if (ec_err)
+			err = add_to_list(si, pnum, ec, &si->corr);
+		else
+			err = add_to_list(si, pnum, ec, &si->free);
 		if (err)
 			return err;
 		goto adjust_mean_ec;
+	default:
+		ubi_err("'ubi_io_read_vid_hdr()' returned unknown code %d",
+			err);
+		return -EINVAL;
 	}

 	vol_id = be32_to_cpu(vidh->vol_id);


net: move macsonic's probe function to .devinit.text

A pointer to mac_sonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

Various other functions that are called by mac_sonic_probe need to move
to .devinit.text, too.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <181323dd666a182bc2d953e52d0ac3ab54cd8391@pengutronix.de>
Cc: Jeff Garzik <15f615bf7d20c2937c7eb5aa759110fd6768848c@redhat.com>
Cc: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Tested-by: Finn Thain <94052abb058aed443995dc4f8d236e022112765d@telegraphics.com.au>
Cc: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org>
Cc: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Cc: 1099b3bee480025a15c1b622ecdea77a1d6d7166@vger.kernel.org
Cc: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/macsonic.c
+++ drivers/net/macsonic.c
@@ -179,7 +179,7 @@
 	.ndo_set_mac_address	= eth_mac_addr,
 };

-static int __init macsonic_init(struct net_device *dev)
+static int __devinit macsonic_init(struct net_device *dev)
 {
 	struct sonic_local* lp = netdev_priv(dev);

@@ -223,7 +223,7 @@
 	return 0;
 }

-static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
+static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
 {
 	struct sonic_local *lp = netdev_priv(dev);
 	const int prom_addr = ONBOARD_SONIC_PROM_BASE;
@@ -288,7 +288,7 @@
 	} else return 0;
 }

-static int __init mac_onboard_sonic_probe(struct net_device *dev)
+static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
 {
 	/* Bwahahaha */
 	static int once_is_more_than_enough;
@@ -409,7 +409,7 @@
 	return macsonic_init(dev);
 }

-static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
+static int __devinit mac_nubus_sonic_ethernet_addr(struct net_device *dev,
 						unsigned long prom_addr,
 						int id)
 {
@@ -424,7 +424,7 @@
 	return 0;
 }

-static int __init macsonic_ident(struct nubus_dev *ndev)
+static int __devinit macsonic_ident(struct nubus_dev *ndev)
 {
 	if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
 	    ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
@@ -449,7 +449,7 @@
 	return -1;
 }

-static int __init mac_nubus_sonic_probe(struct net_device *dev)
+static int __devinit mac_nubus_sonic_probe(struct net_device *dev)
 {
 	static int slots;
 	struct nubus_dev* ndev = NULL;
@@ -562,7 +562,7 @@
 	return macsonic_init(dev);
 }

-static int __init mac_sonic_probe(struct platform_device *pdev)
+static int __devinit mac_sonic_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct sonic_local *lp;


In case the types are different, just set to none

--- esvg/lib/esvg_attribute_paint.c
+++ esvg/lib/esvg_attribute_paint.c
@@ -81,6 +81,7 @@

 	if (va->type != vb->type)
 	{
+		r->base.type = ESVG_PAINT_NONE;
 		return;
 	}
 	r->base.type = va->type;


[PATCH] sundance: use NULL for pointer

[PATCH] sundance: use NULL for pointer

Use NULL instead of 0 for pointers (cures sparse warnings).

drivers/net/sundance.c:1106:16: warning: Using plain integer as NULL pointer
drivers/net/sundance.c:1652:16: warning: Using plain integer as NULL pointer

Signed-off-by: Randy Dunlap <e1d10faa7e2a0c027bf1ff1d20e7fd10154be7ea@oracle.com>
Signed-off-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>

--- drivers/net/sundance.c
+++ drivers/net/sundance.c
@@ -1102,7 +1102,7 @@
 	np->cur_tx = np->dirty_tx = 0;
 	np->cur_task = 0;

-	np->last_tx = 0;
+	np->last_tx = NULL;
 	iowrite8(127, ioaddr + TxDMAPollPeriod);

 	iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1);
@@ -1648,7 +1648,7 @@
 	np->cur_tx = 0;
 	np->dirty_tx = 0;
 	np->cur_task = 0;
-	np->last_tx = 0;
+	np->last_tx = NULL;

 	netif_stop_queue(dev);


use stack buffer instead of heap for sigar_net_interface_name_get

--- src/os/win32/win32_sigar.c
+++ src/os/win32/win32_sigar.c
@@ -2668,15 +2668,14 @@
 #define IF_TYPE_IEEE80211 71
 #endif

-static char *
-sigar_net_interface_name_get(sigar_t *sigar, MIB_IFROW *ifr, PIP_ADAPTER_ADDRESSES address_list)
-{
-    char *match = NULL;
+static int
+sigar_net_interface_name_get(sigar_t *sigar, MIB_IFROW *ifr, PIP_ADAPTER_ADDRESSES address_list, char *name)
+{
     PIP_ADAPTER_ADDRESSES iter;
     int lpc = 0;

     if (address_list == NULL) {
-        return NULL;
+        return SIGAR_ENOTIMPL;
     }

     for (iter = address_list; iter != NULL; iter = iter->Next) {
@@ -2687,14 +2686,13 @@
         }

         if (lpc == iter->PhysicalAddressLength) {
-            match = malloc(MAX_INTERFACE_NAME_LEN);
-            wcstombs(match, iter->FriendlyName, MAX_INTERFACE_NAME_LEN);
-            match[MAX_INTERFACE_NAME_LEN-1] = 0;
-            break;
-        }
-    }
-
-    return match;
+            wcstombs(name, iter->FriendlyName, MAX_INTERFACE_NAME_LEN);
+            name[MAX_INTERFACE_NAME_LEN-1] = '\0';
+            return SIGAR_OK;
+        }
+    }
+
+    return SIGAR_ENOENT;
 }

 SIGAR_DECLARE(int)
@@ -2742,22 +2740,18 @@
         int key;
         MIB_IFROW *ifr = ift->table + i;
         sigar_cache_entry_t *entry;
-        char *friendly = NULL;
+
+        status = SIGAR_ENOENT;

         if (strEQ(ifr->bDescr, MS_LOOPBACK_ADAPTER)) {
             /* special-case */
             sprintf(name, NETIF_LA "%d", la++);
         }
         else if (ifr->dwType == MIB_IF_TYPE_LOOPBACK) {
-            friendly = sigar_net_interface_name_get(sigar, ifr, address_list);
-            if (friendly == NULL) {
+            status = sigar_net_interface_name_get(sigar, ifr, address_list, name);
+            if (status != SIGAR_OK) {
                 sprintf(name, "lo%d", lo++);
             }
-            else {
-                snprintf(name, MAX_INTERFACE_NAME_LEN, "%s", friendly);
-            }
-            name[MAX_INTERFACE_NAME_LEN] = 0;
-            free(friendly);
         }
         else if ((ifr->dwType == MIB_IF_TYPE_ETHERNET) ||
                  (ifr->dwType == IF_TYPE_IEEE80211))
@@ -2765,17 +2759,12 @@
             if ((strstr(ifr->bDescr, "Scheduler") == NULL) &&
                 (strstr(ifr->bDescr, "Filter") == NULL))
             {
-                friendly = sigar_net_interface_name_get(sigar, ifr, address_list);
+                status = sigar_net_interface_name_get(sigar, ifr, address_list, name);
             }

-            if (friendly == NULL) {
+            if (status != SIGAR_OK) {
                 snprintf(name, ifr->dwDescrLen, "%s", ifr->bDescr);
             }
-            else {
-                snprintf(name, MAX_INTERFACE_NAME_LEN, "%s", friendly);
-            }
-            name[MAX_INTERFACE_NAME_LEN] = 0;
-            free(friendly);
         }
         else {
             continue; /*XXX*/


s390/cio: cleanup cmb_enable sysfs attr

s390/cio: cleanup cmb_enable sysfs attr

Ensure that we hold the ccwlock when accessing private data. Return errors
that occur during measurement enabling to userspace. Apply some cleanups
while at it.

Signed-off-by: Sebastian Ott <34be3ca399e9e73d80098c083a5b58614c3ca6da@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <94980dd689360e06f79e918bf71ea5fed7a2bc63@de.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>

--- drivers/s390/cio/cmf.c
+++ drivers/s390/cio/cmf.c
@@ -1171,23 +1171,28 @@
 			       struct device_attribute *attr,
 			       char *buf)
 {
-	return sprintf(buf, "%d\n", to_ccwdev(dev)->private->cmb ? 1 : 0);
+	struct ccw_device *cdev = to_ccwdev(dev);
+	int enabled;
+
+	spin_lock_irq(cdev->ccwlock);
+	enabled = !!cdev->private->cmb;
+	spin_unlock_irq(cdev->ccwlock);
+
+	return sprintf(buf, "%d\n", enabled);
 }

 static ssize_t cmb_enable_store(struct device *dev,
 				struct device_attribute *attr, const char *buf,
 				size_t c)
 {
-	struct ccw_device *cdev;
-	int ret;
+	struct ccw_device *cdev = to_ccwdev(dev);
 	unsigned long val;
+	int ret;

 	ret = kstrtoul(buf, 16, &val);
 	if (ret)
 		return ret;

-	cdev = to_ccwdev(dev);
-
 	switch (val) {
 	case 0:
 		ret = disable_cmf(cdev);
@@ -1195,12 +1200,13 @@
 	case 1:
 		ret = enable_cmf(cdev);
 		break;
-	}
-
-	return c;
-}
-
-DEVICE_ATTR(cmb_enable, 0644, cmb_enable_show, cmb_enable_store);
+	default:
+		ret = -EINVAL;
+	}
+
+	return ret ? ret : c;
+}
+DEVICE_ATTR_RW(cmb_enable);

 int ccw_set_cmf(struct ccw_device *cdev, int enable)
 {


Fix compilation error for Trusty.

Fix compilation error for Trusty.

--- EigenLab.h
+++ EigenLab.h
@@ -711,7 +711,7 @@
 				result.mapLocal();
 				return true;
 			}
-        	} else if(name == "max") {
+		} else if(name == "max") {
 			if(arg1.matrix().size() != 1)
 				throw std::runtime_error("Invalid dimension argument for function '" + name + "(...)'.");
 			int dim = floor(std::real(arg1.matrix()(0, 0)));
@@ -727,7 +727,7 @@
 				return true;
 			}
 		} else if(name == "absmax") {
- 			if(arg1.matrix().size() != 1)
+			if(arg1.matrix().size() != 1)
 				throw std::runtime_error("Invalid dimension argument for function '" + name + "(...)'.");
 			int dim = floor(std::real(arg1.matrix()(0, 0)));
 			if((dim != 0 && dim != 1) || dim != std::real(arg1.matrix()(0, 0)))
@@ -753,26 +753,28 @@
 			}
 		} else if (name == "cwiseMin") {
 			if (arg1.matrix().size() == 1) {
-				typename Derived::RealScalar arg1scalar = std::real(arg1.matrix()(0, 0));
-				result.local() = arg0.matrix().cwiseMin(arg1scalar);
+				typename Derived::Scalar arg1scalar = arg1.matrix()(0, 0);
+				Derived arg1matrix = Derived::Constant(arg0.matrix().rows(), arg0.matrix().cols(), arg1scalar);
+				result.local() = arg0.matrix().cwiseMin(arg1matrix);
 				result.mapLocal();
 				return true;
 			} else if (arg0.matrix().cols() == arg1.matrix().cols() && arg0.matrix().rows() == arg1.matrix().rows()) {
 				result.local() = arg0.matrix().cwiseMin(arg1.matrix());
- 				result.mapLocal();
- 				return true;
+				result.mapLocal();
+				return true;
 			} else {
 				throw std::runtime_error("Invalid dimension argument for function '" + name + "(...)'.");
 			}
 		} else if (name == "cwiseMax") {
 			if (arg1.matrix().size() == 1) {
-				typename Derived::RealScalar arg1scalar = std::real(arg1.matrix()(0, 0));
-				result.local() = arg0.matrix().cwiseMax(arg1scalar);
-        			result.mapLocal();
- 				return true;
+				typename Derived::Scalar arg1scalar = arg1.matrix()(0, 0);
+				Derived arg1matrix = Derived::Constant(arg0.matrix().rows(), arg0.matrix().cols(), arg1scalar);
+				result.local() = arg0.matrix().cwiseMax(arg1matrix);
+				result.mapLocal();
+				return true;
 			} else if (arg0.matrix().cols() == arg1.matrix().cols() && arg0.matrix().rows() == arg1.matrix().rows()) {
 				result.local() = arg0.matrix().cwiseMax(arg1.matrix());
- 				result.mapLocal();
+				result.mapLocal();
 				return true;
 			} else {
 				throw std::runtime_error("Invalid dimension argument for function '" + name + "(...)'.");


Fix various thinkos in CArray.

Fix various thinkos in CArray.

--- src/6model/reprs/CArray.c
+++ src/6model/reprs/CArray.c
@@ -153,11 +153,12 @@
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
         "CArray representation does not fully indexed storage yet");
 }
-static void expand(PARROT_INTERP, CArrayBody *body, INTVAL min_size) {
+static void expand(PARROT_INTERP, CArrayREPRData *repr_data, CArrayBody *body, INTVAL min_size) {
     INTVAL next_size = 2 * body->allocated;
     if (min_size > next_size)
         next_size = min_size;
-    mem_sys_realloc(body->storage, next_size);
+    body->storage = mem_sys_realloc(body->storage, next_size * repr_data->elem_size);
+    body->allocated = next_size;
 }
 static void * at_pos_ref(PARROT_INTERP, STable *st, void *data, INTVAL index) {
     CArrayREPRData *repr_data = (CArrayREPRData *)st->REPR_data;
@@ -175,10 +176,12 @@
     CArrayREPRData *repr_data = (CArrayREPRData *)st->REPR_data;
     CArrayBody     *body      = (CArrayBody *)data;
     STable         *type_st   = STABLE(repr_data->elem_type);
-    if (body->allocated && index >= body->elems)
-        expand(interp, body, index + 1);
+    if (body->allocated && index >= body->allocated)
+        expand(interp, repr_data, body, index + 1);
     /* XXX make sure this is appropriate, once we support other than int/num elems. */
     type_st->REPR->copy_to(interp, type_st, value, ((char *)body->storage) + index * repr_data->elem_size);
+    if (index >= body->elems)
+        body->elems = index;
 }
 static void bind_pos_boxed(PARROT_INTERP, STable *st, void *data, INTVAL index, PMC *obj) {
     CArrayREPRData *repr_data = (CArrayREPRData *)st->REPR_data;


Remove an obviously-broken header, which still tries to refer to ScopedDecl.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@88837 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/clang/Analysis/Visitors/CFGVarDeclVisitor.h
+++ include/clang/Analysis/Visitors/CFGVarDeclVisitor.h
@@ -1,63 +0,0 @@
-//==- CFGVarDeclVisitor - Generic visitor of VarDecls in a CFG --*- C++ --*-==//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the template class CFGVarDeclVisitor, which provides
-// a generic way to visit all the VarDecl's in a CFG.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_ANALYSIS_CFG_VARDECL_VISITOR_H
-#define LLVM_CLANG_ANALYSIS_CFG_VARDECL_VISITOR_H
-
-#include "clang/Analysis/Visitors/CFGStmtVisitor.h"
-#include "clang/AST/Decl.h"
-#include "clang/AST/Stmt.h"
-
-namespace clang {
-
-template <typename ImplClass>
-class CFGVarDeclVisitor : public CFGStmtVisitor<ImplClass> {
-  const CFG& cfg;
-public:
-  CFGVarDeclVisitor(const CFG& c) : cfg(c) {}
-
-  void VisitStmt(Stmt* S) {
-    static_cast<ImplClass*>(this)->VisitChildren(S);
-  }
-
-  void VisitDeclRefExpr(DeclRefExpr* DR) {
-    static_cast<ImplClass*>(this)->VisitDeclChain(DR->getDecl());
-  }
-
-  void VisitDeclStmt(DeclStmt* DS) {
-    static_cast<ImplClass*>(this)->VisitDeclChain(DS->getDecl());
-  }
-
-  void VisitDeclChain(ScopedDecl* D) {
-    for (; D != NULL ; D = D->getNextDeclarator())
-      static_cast<ImplClass*>(this)->VisitScopedDecl(D);
-  }
-
-  void VisitScopedDecl(ScopedDecl* D) {
-    if (VarDecl* V = dyn_cast<VarDecl>(D))
-      static_cast<ImplClass*>(this)->VisitVarDecl(V);
-  }
-
-  void VisitVarDecl(VarDecl* D) {}
-
-  void VisitAllDecls() {
-    for (CFG::const_iterator BI = cfg.begin(), BE = cfg.end(); BI != BE; ++BI)
-      for (CFGBlock::const_iterator SI=BI->begin(),SE = BI->end();SI != SE;++SI)
-        static_cast<ImplClass*>(this)->BlockStmt_Visit(const_cast<Stmt*>(*SI));
-  }
-};
-
-} // end namespace clang
-
-#endif


Remove leftover declaration of DOMStorageContext::DeleteSessionOnlyData.

The implementation was removed by http://codereview.chromium.org/8820009.

BUG=NONE
TEST=NONE

Review URL: http://codereview.chromium.org/8919003

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114204 0039d316-1c4b-4281-b951-d872f2087c98

--- content/browser/in_process_webkit/dom_storage_context.h
+++ content/browser/in_process_webkit/dom_storage_context.h
@@ -81,11 +81,6 @@
   // date that's supplied. Protected origins, per the SpecialStoragePolicy,
   // are not deleted by this method.
   void DeleteDataModifiedSince(const base::Time& cutoff);
-
-  // Delete any local storage files which are allowed to be stored only until
-  // the end of the session. Protected origins, per the SpecialStoragePolicy,
-  // are not deleted by this method.
-  void DeleteSessionOnlyData();

   // Deletes a single local storage file.
   void DeleteLocalStorageFile(const FilePath& file_path);


Phase 3: t+

Phase 3: t+

--- cpan/libmarpa/dev/marpa.w
+++ cpan/libmarpa/dev/marpa.w
@@ -670,11 +670,11 @@
         return NULL;
     }
     g = my_malloc(sizeof(struct marpa_g));
-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* Set |t_is_ok| to a bad value, just in case */
     g->t_is_ok = 0;
     @<Initialize grammar elements@>@;
-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* Properly initialized, so set |t_is_ok| to its proper value */
     g->t_is_ok = I_AM_OK;
    return g;
@@ -1049,7 +1049,7 @@
 PRIVATE
 void event_new(GRAMMAR g, int type)
 {
-    @t}\7\4\4{@>
+    @t}\comment{@>
   /* may change base of dstack */
   GEV end_of_stack = G_EVENT_PUSH(g);
   end_of_stack->t_type = type;
@@ -1060,7 +1060,7 @@
 void int_event_new(GRAMMAR g, int type, int value)
 {
   /* may change base of dstack */
-    @t}\7\4\4{@>
+    @t}\comment{@>
   GEV end_of_stack = G_EVENT_PUSH(g);
   end_of_stack->t_type = type;
   end_of_stack->t_value =  value;
@@ -2275,7 +2275,7 @@
   if (diff)
     return diff;
   {
-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* Length is a key in-between LHS.  That way
       we only need to compare the RHS of
       rules of the same length */
@@ -3066,12 +3066,12 @@
     @<Fail if precomputed@>@;
     @<Fail if bad start symbol@>@;

-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* After this point, errors are not recoverable */

     @<Clear rule duplication tree@>@;

-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* Phase 1: census the external grammar */
     { /* Scope with only external grammar */
         @<Declare census variables@>@;
@@ -3079,14 +3079,14 @@
         @<Detect cycles@>@;
     }

-    @t}\7\4\4{@>
+    @t}\comment{@>
     //  Phase 2: rewrite the grammar into internal form
     @<Initialize IRL stack@>@;
     @<Initialize NSY stack@>@;
     @<Rewrite grammar |g| into CHAF form@>@;
     @<Augment grammar |g|@>@;

-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* Phase 3: memoize the internal grammar */
      if (!G_is_Trivial(g)) {
         @<Declare variables for the internal grammar
@@ -3240,7 +3240,7 @@
 {
   Marpa_Rule_ID rule_id;

-    @t}\7\4\4{@>
+    @t}\comment{@>
   /* AVL tree for RHS symbols */
   const MARPA_AVL_TREE rhs_avl_tree = _marpa_avl_create (sym_rule_cmp, NULL);
     /* Size of G is sum of RHS lengths, plus 1 for each rule, which here is necessary
@@ -3250,7 +3250,7 @@
                     (size_t)External_Size_of_G (g));
   struct sym_rule_pair *p_rh_sym_rule_pairs = p_rh_sym_rule_pair_base;

-    @t}\7\4\4{@>
+    @t}\comment{@>
   /* AVL tree for LHS symbols */
   const MARPA_AVL_TREE lhs_avl_tree = _marpa_avl_create (sym_rule_cmp, NULL);
   struct sym_rule_pair *const p_lh_sym_rule_pair_base =
@@ -3269,7 +3269,7 @@

       bv_bit_set (lhs_v, lhs_id);

-    @t}\7\4\4{@>
+    @t}\comment{@>
       /* Insert the LH Sym / XRL pair into the LH AVL tree */
       p_lh_sym_rule_pairs->t_symid = lhs_id;
         p_lh_sym_rule_pairs->t_ruleid = rule_id;
@@ -3316,7 +3316,7 @@
     RULEID *p_rule_data = rule_data_base;
     traverser = _marpa_avl_t_init (rhs_avl_tree);

-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* One extra "symbol" as an end marker */
     xrl_list_x_rh_sym =
       marpa_obs_new (obs_precompute, RULEID *, (size_t)pre_census_xsy_count + 1);
@@ -3341,7 +3341,7 @@
       marpa_obs_new (obs_precompute, RULEID, (size_t)xrl_count);
     RULEID *p_rule_data = rule_data_base;
     traverser = _marpa_avl_t_init (lhs_avl_tree);
-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* One extra "symbol" as an end marker */
     xrl_list_x_lh_sym =
       marpa_obs_new (obs_precompute, RULEID *, (size_t)pre_census_xsy_count + 1);
@@ -3371,7 +3371,7 @@
   for (symid = 0; symid < pre_census_xsy_count; symid++)
     {
       XSY symbol = XSY_by_ID (symid);
-    @t}\7\4\4{@>
+    @t}\comment{@>
           /* If marked by the user, leave the symbol
              as set by the user, and update the boolean vector */
       if (XSY_is_Locked_Terminal (symbol))
@@ -3384,7 +3384,7 @@
           bv_bit_clear (terminal_v, symid);
           continue;
         }
-    @t}\7\4\4{@>
+    @t}\comment{@>
       /* If not marked by the user, take the default
          from the boolean vector and mark the symbol,
          if necessary. */
@@ -3633,52 +3633,52 @@
   const XSY rh_xsy = XSY_by_ID (rhs_id);
   const XSYID separator_id = Separator_of_XRL (xrl);

-    @t}\7\4\4{@>
+    @t}\comment{@>
      /* A sequence rule is nullable if it can be zero length or
     if its RHS is nullable */
   XRL_is_Nullable (xrl) = Minimum_of_XRL (xrl) <= 0
     || XSY_is_Nullable (rh_xsy);@;

-    @t}\7\4\4{@>
+    @t}\comment{@>
      /* A sequence rule is nulling if its RHS is nulling */
   XRL_is_Nulling (xrl) = XSY_is_Nulling (rh_xsy);

-    @t}\7\4\4{@>
+    @t}\comment{@>
      /* A sequence rule is productive
      if it is nulling or if its RHS is productive */
   XRL_is_Productive (xrl) = XRL_is_Nullable (xrl) || XSY_is_Productive (rh_xsy);

-    @t}\7\4\4{@>
+    @t}\comment{@>
   // Initialize to used if accessible and RHS is productive
   XRL_is_Used (xrl) = XRL_is_Accessible (xrl) && XSY_is_Productive (rh_xsy);

-    @t}\7\4\4{@>
+    @t}\comment{@>
   // Touch-ups to account for the separator
   if (separator_id >= 0)
     {
       const XSY separator_xsy = XSY_by_ID (separator_id);

-    @t}\7\4\4{@>
+    @t}\comment{@>
         /* A non-nulling separator means a non-nulling rule */
       if (!XSY_is_Nulling (separator_xsy))
         {
           XRL_is_Nulling (xrl) = 0;
         }

-    @t}\7\4\4{@>
+    @t}\comment{@>
           /* A unproductive separator means a unproductive rule,
           unless it is nullable.  */
       if (_MARPA_UNLIKELY(!XSY_is_Productive (separator_xsy)))
         {
           XRL_is_Productive (xrl) = XRL_is_Nullable(xrl);

-    @t}\7\4\4{@>
+    @t}\comment{@>
           // Do not use a sequence rule with an unproductive separator
           XRL_is_Used(xrl) = 0;
         }
   }

-    @t}\7\4\4{@>
+    @t}\comment{@>
   // Do not use if nulling
   if (XRL_is_Nulling (xrl)) XRL_is_Used (xrl) = 0;
 }
@@ -3695,7 +3695,7 @@
 @<Mark valued symbols@> =
 if (0)
   {
-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* Commented out.  The LHS terminal user is a sophisticated
        user so it is probably the better course to allow her the
        choice.  */
@@ -4055,7 +4055,7 @@
     int second_factor_position = factor_positions[factor_position_ix+1];
     if (second_factor_position >= nullable_suffix_ix) {
         piece_end = second_factor_position-1;
-    @t}\7\4\4{@>
+    @t}\comment{@>
         /* The last factor is in the nullable suffix,
             so the virtual RHS must be nullable */
         @<Create a CHAF virtual symbol@>@;
@@ -6946,10 +6946,10 @@
   int insertion_point = alternative_insertion_point (r, new_alternative);
   if (insertion_point < 0)
     return insertion_point;
-    @t}\7\4\4{@>
+    @t}\comment{@>
   // may change base
   end_of_stack = MARPA_DSTACK_PUSH(*alternatives, ALT_Object);
-    @t}\7\4\4{@>
+    @t}\comment{@>
   // base will not change after this
   base_of_stack = MARPA_DSTACK_BASE(*alternatives, ALT_Object);
    for (ix = end_of_stack-base_of_stack; ix > insertion_point; ix--) {
@@ -7333,7 +7333,7 @@
   YS current_earley_set;
   JEARLEME current_earleme;

-    @t}\7\4\4{@>
+    @t}\comment{@>
   /* Initialized to -2 just in case.
     Should be set before returning;
    */
@@ -7359,7 +7359,7 @@
     @<Add predictions@>@;
     postdot_items_create(r, bv_ok_for_chain, current_earley_set);

-    @t}\7\4\4{@>
+    @t}\comment{@>
       /* If no terminals are expected, and there are no Earley items in
            uncompleted Earley sets, we can make no further progress.
            The parse is ``exhausted". */
@@ -8153,7 +8153,7 @@
      is not added to a LIM chain again for this Earley set */
   while (1)
     {
-    @t}\7\4\4{@>
+    @t}\comment{@>
       /* I know at this point that
        |predecessor_lim| is unpopulated, so I also know that
        |lim_to_process| is unpopulated.  This means I also know that
@@ -8183,7 +8183,7 @@
                     postdot_nsyid_of_lim_to_process);
       /* Make sure this LIM
          is not added to a LIM chain again for this Earley set */
-    @t}\7\4\4{@>
+    @t}\comment{@>
         /* |predecesssor_lim = NULL|,
        so that we are forced to break the LIM chain before it */
       if (!predecessor_lim)
@@ -8217,7 +8217,7 @@
 {
   const AHM new_top_aim = Top_AHM_of_LIM (predecessor_lim);
   const CIL predecessor_cil = CIL_of_LIM (predecessor_lim);
-    @t}\7\4\4{@>
+    @t}\comment{@>
   /* Initialize to be just the predcessor's list of AHM IDs.
        Overwrite if we need to add another. */
   CIL_of_LIM (lim_to_process) = predecessor_cil;
@@ -8706,14 +8706,13 @@
     UR_Const ur_node;
     const URS ur_node_stack = URS_of_R(r);
     ur_node_stack_reset(ur_node_stack);
-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* |start_yim| is never rejected */
     push_ur_if_new (per_ys_data, ur_node_stack, start_yim);
     while ((ur_node = ur_node_pop(ur_node_stack)))
     {
-        @t}\7\4\4{@>/* rejected YIM's are never put on the ur-node stack */
+        @t}\comment{@>/* rejected YIM's are never put on the ur-node stack */
         const YIM parent_earley_item = YIM_of_UR(ur_node);
-        const unsigned int source_type = Source_Type_of_YIM (parent_earley_item);
         MARPA_ASSERT(!YIM_was_Predicted(parent_earley_item))@;
         @<Push child Earley items from token sources@>@;
         @<Push child Earley items from completion sources@>@;
@@ -11543,9 +11542,9 @@
               return Step_Type_of_V (v) = MARPA_STEP_NULLING_SYMBOL;
           }

-    @t}\7\4\4{@>
+    @t}\comment{@>
           /* No tracing of nulling valuators, at least at this point */
-    @t}\7\4\4{@>
+    @t}\comment{@>
           /* Fall through */
         }
     }
@@ -11555,7 +11554,7 @@
 {
     AND and_nodes;

-    @t}\7\4\4{@>
+    @t}\comment{@>
     /* flag to indicate whether the arguments of
        a rule should be popped off the stack.  Coming
        into this loop that is always the case -- if
@@ -12672,7 +12671,7 @@
 {
   const MARPA_DSTACK dstack = &cilar->t_buffer;
   MARPA_DSTACK_CLEAR(*dstack);
-    @t}\7\4\4{@>
+    @t}\comment{@>
   /* Has same effect as
   |Count_of_CIL (cil_in_buffer) = 0|, except that it sets
   the |MARPA_DSTACK| up properly */
@@ -12688,7 +12687,7 @@
   CIL cil_in_buffer;
   MARPA_DSTACK dstack = &cilar->t_buffer;
   *MARPA_DSTACK_PUSH (*dstack, int) = new_item;
-    @t}\7\4\4{@>
+    @t}\comment{@>
 /* Note that the buffer CIL might have been moved
                    by the |MARPA_DSTACK_PUSH| */
   cil_in_buffer = MARPA_DSTACK_BASE (*dstack, int);


[S390] cio: css_probe_device() must be called enabled.

Move css_probe_device() behind giving up the lock for the old subchannel
in css_evaluate_known_subchannel() so we aren't disabled when we call it.

Signed-off-by: Cornelia Huck <94980dd689360e06f79e918bf71ea5fed7a2bc63@de.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>

--- drivers/s390/cio/css.c
+++ drivers/s390/cio/css.c
@@ -271,10 +271,6 @@
 		/* Reset intparm to zeroes. */
 		sch->schib.pmcw.intparm = 0;
 		cio_modify(sch);
-
-		/* Probe if necessary. */
-		if (action == UNREGISTER_PROBE)
-			ret = css_probe_device(sch->schid);
 		break;
 	case REPROBE:
 		device_trigger_reprobe(sch);
@@ -283,6 +279,9 @@
 		break;
 	}
 	spin_unlock_irqrestore(&sch->lock, flags);
+	/* Probe if necessary. */
+	if (action == UNREGISTER_PROBE)
+		ret = css_probe_device(sch->schid);

 	return ret;
 }


testcase/le_tc: AF_NETLINK domain tests fixes

add checking that AF_NETLINK is set, before test AF_NETLINK network tests

Change-Id: I7ad8c6d6a5b23cab8543e20d5678db1e9f3f8018
Signed-off-by: Olga Pokrovskaya <efe575e20354787032cc73436f9bd1ba2fde1bf7@samsung.com>

--- apps/examples/testcase/le_tc/network/tc_net_socket.c
+++ apps/examples/testcase/le_tc/network/tc_net_socket.c
@@ -561,6 +561,7 @@
 #endif
 #endif

+#ifdef AF_NETLINK
 /**
 * @testcase		tc_net_socket_af_netlink_sock_stream_n
 * @brief
@@ -578,6 +579,7 @@

 	close(fd);
 }
+#endif

 /**
 * @testcase		tc_net_socket_af_unspec_sock_stream_p
@@ -1044,6 +1046,7 @@
 #endif
 #endif

+#ifdef AF_NETLINK
 /**
 * @testcase		tc_net_socket_af_netlink_sock_dgram_p
 * @brief
@@ -1061,7 +1064,7 @@

 	close(fd);
 }
-
+#endif
 /**
 * @testcase		tc_net_socket_af_unspec_sock_dgram_p
 * @brief
@@ -1572,7 +1575,9 @@
 	tc_net_socket_af_unix_sock_stream_icmpv6_n();
 #endif
 #endif
+#ifdef AF_NETLINK
 	tc_net_socket_af_netlink_sock_stream_n();
+#endif
 	tc_net_socket_af_unspec_sock_stream_p();
 #ifdef AF_UNIX
 	tc_net_socket_af_unix_sock_stream_tcp_p();
@@ -1615,7 +1620,9 @@
 	tc_net_socket_af_unix_sock_dgram_icmpv6_n();
 #endif
 #endif
+#ifdef AF_NETLINK
 	tc_net_socket_af_netlink_sock_dgram_p();
+#endif
 	tc_net_socket_af_unspec_sock_dgram_p();
 #ifdef AF_LOCAL
 	tc_net_socket_af_local_sock_dgram_p();


Basic support for row colors on GTK3... Currently the specified colors are ignored and just sets the rules-hint property if both parameters are not DW_CLR_DEFAULT. Will try to set the odd-row-color and  even-row-color properties using the theme in the future.

--- gtk3/dw.c
+++ gtk3/dw.c
@@ -5970,6 +5970,33 @@
 }

 /*
+ * Sets the alternating row colors for container window (widget) handle.
+ * Parameters:
+ *          handle: The window (widget) handle.
+ *          oddcolor: Odd row background color in DW_RGB format or a default color index.
+ *                    DW_CLR_DEFAULT will disable coloring odd rows.
+ *          evencolor: Even row background color in DW_RGB format or a default color index.
+ *                    DW_CLR_DEFAULT will disable coloring even rows.
+ */
+void API dw_container_set_row_bg(HWND handle, unsigned long oddcolor, unsigned long evencolor)
+{
+   GtkWidget *cont;
+   int _locked_by_me = FALSE;
+   DW_MUTEX_LOCK;
+   cont = (GtkWidget *)g_object_get_data(G_OBJECT(handle), "_dw_user");
+
+   /* Make sure it is the correct tree type */
+   if(cont && GTK_IS_TREE_VIEW(cont) && g_object_get_data(G_OBJECT(cont), "_dw_tree_type") == GINT_TO_POINTER(_DW_TREE_TYPE_CONTAINER))
+   {
+      if(oddcolor == DW_CLR_DEFAULT && evencolor == DW_CLR_DEFAULT)
+         gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(cont), FALSE);
+      else
+         gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(cont), TRUE);
+   }
+   DW_MUTEX_UNLOCK;
+}
+
+/*
  * Sets the width of a column in the container.
  * Parameters:
  *          handle: Handle to window (widget) of container.
@@ -5983,7 +6010,7 @@

    DW_MUTEX_LOCK;
    cont = (GtkWidget *)g_object_get_data(G_OBJECT(handle), "_dw_user");
-
+
    /* Make sure it is the correct tree type */
    if(cont && GTK_IS_TREE_VIEW(cont) && g_object_get_data(G_OBJECT(cont), "_dw_tree_type") == GINT_TO_POINTER(_DW_TREE_TYPE_CONTAINER))
    {


regcache-rbtree: Fix reg_stride != 1

regcache-rbtree: Fix reg_stride != 1

There are a couple of calculations, which convert between register addresses and
block indices, in regcache_rbtree_sync() and regcache_rbtree_node_alloc() which
assume that reg_stride is 1. This will break the rb cache for configurations
which do not use a reg_stride of 1.

Also rename 'base' in regcache_rbtree_sync() to 'start' to avoid confusion with
'base_reg'.

Signed-off-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>

--- drivers/base/regmap/regcache-rbtree.c
+++ drivers/base/regmap/regcache-rbtree.c
@@ -325,8 +325,8 @@

 		if (i != map->rd_table->n_yes_ranges) {
 			range = &map->rd_table->yes_ranges[i];
-			rbnode->blklen = range->range_max - range->range_min
-				+ 1;
+			rbnode->blklen = (range->range_max - range->range_min) /
+				map->reg_stride	+ 1;
 			rbnode->base_reg = range->range_min;
 		}
 	}
@@ -418,30 +418,33 @@
 	struct regcache_rbtree_ctx *rbtree_ctx;
 	struct rb_node *node;
 	struct regcache_rbtree_node *rbnode;
+	unsigned int base_reg, top_reg;
+	unsigned int start, end;
 	int ret;
-	int base, end;

 	rbtree_ctx = map->cache;
 	for (node = rb_first(&rbtree_ctx->root); node; node = rb_next(node)) {
 		rbnode = rb_entry(node, struct regcache_rbtree_node, node);

-		if (rbnode->base_reg > max)
+		regcache_rbtree_get_base_top_reg(map, rbnode, &base_reg,
+			&top_reg);
+		if (base_reg > max)
 			break;
-		if (rbnode->base_reg + rbnode->blklen < min)
+		if (top_reg < min)
 			continue;

-		if (min > rbnode->base_reg)
-			base = min - rbnode->base_reg;
+		if (min > base_reg)
+			start = (min - base_reg) / map->reg_stride;
 		else
-			base = 0;
-
-		if (max < rbnode->base_reg + rbnode->blklen)
-			end = max - rbnode->base_reg + 1;
+			start = 0;
+
+		if (max < top_reg)
+			end = (max - base_reg) / map->reg_stride + 1;
 		else
 			end = rbnode->blklen;

 		ret = regcache_sync_block(map, rbnode->block, rbnode->base_reg,
-					  base, end);
+					  start, end);
 		if (ret != 0)
 			return ret;
 	}


[utils] Introduce the function(s) round_down_at[64]()

--- include/tilck/common/utils.h
+++ include/tilck/common/utils.h
@@ -122,3 +122,13 @@
 {
    return ((n + unit - 1) / unit) * unit;
 }
+
+CONSTEXPR static ALWAYS_INLINE uptr round_down_at(uptr n, uptr unit)
+{
+   return (n / unit) * unit;
+}
+
+CONSTEXPR static ALWAYS_INLINE u64 round_down_at64(u64 n, u64 unit)
+{
+   return (n / unit) * unit;
+}


comment cleanup

comment cleanup

--- haltest.c
+++ haltest.c
@@ -4,63 +4,49 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <errno.h>
+#include <string.h>

-
-/*
-libhal_ctx_init
-libhal_ctx_new
-libhal_ctx_set_dbus_connection
-libhal_device_get_property_string
-libhal_device_property_exists
-libhal_find_device_by_capability
-libhal_free_string
-libhal_free_string_array
-
-<[^_]
- [^]
- [^]
- [^]
- [^]
-,[^_]
-[^_]
-[^_]
-[^_]
-
-
-dbus_bus_get
-dbus_error_init
-
-error: libhal_ctx_init: %s: %s
-error: libhal_ctx_new
-error: libhal_ctx_set_dbus_connection: %s: %s
-
-
-info.product
-
- MAC
-block
-block.device
-block.storage_device
-net.80203
-net.address
-/org/freedesktop/Hal/devices/computer
-processor
-smbios.bios.release_date
-smbios.bios.version
-storage.model
-
-setfsent
-getfsent
-endfsent
-*/
-
+#include <fstab.h>

 char *
-get_prop(LibHalContext *ctx, const char *cap, const char *prop)
+get_prop(LibHalContext *ctx, const char *udi, const char *prop)
+{
+	DBusError derr;
+	char *value;
+	char *ret;
+
+	value = NULL;
+	dbus_error_init(&derr);
+
+	if (!libhal_device_property_exists(ctx, udi, prop, &derr)) {
+		fprintf(stderr, "device %s doesn't have property '%s'\n",
+			udi, prop);
+		return NULL;
+	}
+
+	value = libhal_device_get_property_string(ctx, udi, prop, &derr);
+	if (dbus_error_is_set(&derr)) {
+		fprintf(stderr, "get_property_string: an error occurred: %s\n",
+			derr.message);
+		dbus_error_free(&derr);
+		if (value)
+			libhal_free_string(value);
+		return NULL;
+	}
+
+	ret = strdup(value);
+	libhal_free_string(value);
+
+	return ret;
+}
+
+char *
+get_prop_for_cap(LibHalContext *ctx, const char *cap, const char *prop)
 {
 	DBusError derr;
 	int num;
 	char **devs;
+	char *value;

 	devs = NULL;

@@ -73,31 +59,13 @@
 	}

 	for (int i = 0; i < num; ++i) {
-		char *udi;
-		char *value;
+		value = get_prop(ctx, devs[i], prop);
+		fprintf(stdout, "%s (%s) %s: %s\n", cap, devs[i], prop, value);
+		free(value);
+	}

-		udi = devs[i];
-		value = NULL;
-
-		if (!libhal_device_property_exists(ctx, udi, prop, &derr)) {
-			fprintf(stderr, "device %s doesn't have property '%s'\n",
-				udi, prop);
-			continue;
-		}
-
-		value = libhal_device_get_property_string(ctx, udi, prop, &derr);
-		if (dbus_error_is_set(&derr)) {
-			fprintf(stderr, "get_property_string: an error occurred: %s\n",
-				derr.message);
-			dbus_error_free(&derr);
-			if (value)
-				libhal_free_string(value);
-			goto error;
-		}
-
-		fprintf(stdout, "%s (%s) %s: %s\n", cap, udi, prop, value);
-
-		libhal_free_string(value);
+	if (num == 0) {
+		fprintf(stderr, "no devs found for '%s'\n", cap);
 	}

 error:
@@ -141,19 +109,33 @@
 		return 1;
 	}

-	get_prop(ctx, "net.80203", "info.product");
-	get_prop(ctx, "block", "info.product");
-	get_prop(ctx, "processor", "info.product");

-	//libhal_find_device_by_capability(); // net.80203
-	//libhal_find_device_by_capability(); // block
-	//libhal_find_device_by_capability(); // processor
+        /*
+	  interesting strings from the anylogic 32-bit JNI license lib:

-	//if (libhal_device_property_exists()) { // info.product
-	//	libhal_device_get_property();
+          info.product
+          MAC
+          block
+          block.device
+          block.storage_device
+          net.80203
+          net.address
+          /org/freedesktop/Hal/devices/computer
+          processor
+          smbios.bios.release_date
+          smbios.bios.version
+          storage.model
+        */

-	//	libhal_free_string();
-	//}
+	get_prop_for_cap(ctx, "net.80203", "info.product");
+	get_prop_for_cap(ctx, "net.80203", "MAC");
+	get_prop_for_cap(ctx, "block", "storage.model");
+	get_prop_for_cap(ctx, "block.device", "storage.model");
+	get_prop_for_cap(ctx, "block.storage_device", "storage.model");
+	get_prop_for_cap(ctx, "processor", "info.product");
+
+	get_prop(ctx, "/org/freedesktop/Hal/devices/computer", "smbios.bios.release_date");
+	get_prop(ctx, "/org/freedesktop/Hal/devices/computer", "smbios.bios.version");

 	return 0;
 }


ServerPCICFGUncore has no virtual members and is not a base class so removing the virtual from the destructor

Change-Id: I8f9faa123257357580d526b6e2331330d2763d70

--- cpucounters.h
+++ cpucounters.h
@@ -408,7 +408,7 @@
     //! \param port QPI port id
     uint64 getOutgoingFlits(uint32 port);

-    virtual ~ServerPCICFGUncore();
+    ~ServerPCICFGUncore();

     //! \brief Program power counters (disables programming performance counters)
     //! \param mc_profile memory controller measurement profile. See description of profiles in pcm-power.cpp


xen: add missing definitions in include/xen/interface/vcpu.h which ia64/xen needs

Add xen handles realted definitions for xen vcpu which ia64/xen needs.
Pointer argumsnts for ia64/xen hypercall are passed in pseudo physical
address (guest physical address) so that it is required to convert
guest kernel virtual address into pseudo physical address.
The xen guest handle represents such arguments.

Signed-off-by: Isaku Yamahata <4b3abd66323411eeceff090ab3754dd766fc4b25@valinux.co.jp>
Signed-off-by: Jeremy Fitzhardinge <35cfe9f678a9e9bbdcf2f6e68cd105ce06d149b1@citrix.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- include/xen/interface/vcpu.h
+++ include/xen/interface/vcpu.h
@@ -85,6 +85,7 @@
 		 */
 		uint64_t time[4];
 };
+DEFINE_GUEST_HANDLE_STRUCT(vcpu_runstate_info);

 /* VCPU is currently running on a physical CPU. */
 #define RUNSTATE_running  0
@@ -119,6 +120,7 @@
 #define VCPUOP_register_runstate_memory_area 5
 struct vcpu_register_runstate_memory_area {
 		union {
+				GUEST_HANDLE(vcpu_runstate_info) h;
 				struct vcpu_runstate_info *v;
 				uint64_t p;
 		} addr;
@@ -134,6 +136,7 @@
 struct vcpu_set_periodic_timer {
 		uint64_t period_ns;
 };
+DEFINE_GUEST_HANDLE_STRUCT(vcpu_set_periodic_timer);

 /*
  * Set or stop a VCPU's single-shot timer. Every VCPU has one single-shot
@@ -145,6 +148,7 @@
 		uint64_t timeout_abs_ns;
 		uint32_t flags;			   /* VCPU_SSHOTTMR_??? */
 };
+DEFINE_GUEST_HANDLE_STRUCT(vcpu_set_singleshot_timer);

 /* Flags to VCPUOP_set_singleshot_timer. */
  /* Require the timeout to be in the future (return -ETIME if it's passed). */
@@ -164,5 +168,6 @@
     uint32_t offset; /* offset within page */
     uint32_t rsvd;   /* unused */
 };
+DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_vcpu_info);

 #endif /* __XEN_PUBLIC_VCPU_H__ */


fix doc build

fix doc build

--- ports/raspberrypi/bindings/rp2pio/StateMachine.c
+++ ports/raspberrypi/bindings/rp2pio/StateMachine.c
@@ -437,7 +437,7 @@
 //|         size, or use `memoryview.cast` to change the interpretation of an existing buffer.
 //|
 //|         To atomically change from one buffer to another, simply call
-//|         `StateMachine.continuous_write` again with a different buffer with the same element size.
+//|         `StateMachine.start_continuous_write` again with a different buffer with the same element size.
 //|         The call will only return once DMA has started putting the previous
 //|         buffer's data into the PIO FIFO.
 //|