Fix undefined assert and ret errors.  Try to get offset calculations before we start the fcall (therefore messing up registers at incorrect time).

--- platform/dosemu/glide2x.c
+++ platform/dosemu/glide2x.c
@@ -1,3 +1,4 @@
+#include <assert.h>
 #include <stdio.h>
 #include <string.h>

@@ -23,22 +24,24 @@
 #define __fcall(...) \
 ({ \
     unsigned int ret; \
-    asm(/* Backup regs */ \
-        "push %%eax;" \
-        "push %%ecx;" \
-        "push %%edx;" \
+    asm volatile ( \
+        /* Backup regs */ \
+        "push %%eax\n\t" \
+        "push %%ecx\n\t" \
+        "push %%edx\n\t" \
         /* Far return address */ \
-        "push %%cs;" \
-        "push $0;" \
-        "mov  %0, %%ecx;" \
-        "mov  %%es, %%edx;" \
+        "push %%cs\n\t" \
+        "push $0\n\t" \
+        "mov  %0, %%ecx\n\t" \
+        "mov  %%es, %%edx" \
         : : "g"((unsigned int) &fptr) : "memory"); \
     (*(fptr.thunk)) (__VA_ARGS__); \
     /* Restore regs and store return value*/ \
-    asm("pop %%ecx;" \
-        "pop %%edx;" \
-        "mov %%eax, ret;" \
-        "pop %%eax;" \
+    asm volatile ( \
+        "pop %%ecx\n\t" \
+        "pop %%edx\n\t" \
+        "mov %%eax, %0\n\t" \
+        "pop %%eax" \
         :"=m"(ret) : :"memory"); \
     ret; \
 })
@@ -70,32 +73,32 @@
 __fptr(void);
 static void __attribute__((__fastcall__)) thunk(struct fptr_void_t *fptr, unsigned int *stack)
 {
-    printf ("stack[0] = %08x [1] = %08x\n", stack[0], stack[1]);
-    asm (/* Move the near call address up one stack position
+    asm volatile (
+         /* Move the near call address up one stack position
           * into the gap we left */
-         "mov  %0, %%eax;"
-         "mov  %%eax, %1;"
+         "mov  %0, %%eax\n\t"
+         "mov  %%eax, %1\n\t"
          /* Set the return address to be label 2: instead which will
           * be a near ret in the host OS memory space */
-         "mov  $2f, %%eax;"
-         "add  %3,  %%eax;"
-         "mov  %%eax, %0;"
+         "mov  $2f, %%eax\n\t"
+         "add  %3,  %%eax\n\t"
+         "mov  %%eax, %0\n\t"
          /* entry point in hosts memory */
-         "push %4;"
+         "push %4\n\t"
          /* Far call to get us to label 1:" */
-         "push %2;"
-         "mov  $1f, %%eax;"
-         "add  %3,  %%eax;"
-         "push %%eax;"
-         "lret;"
+         "push %2\n\t"
+         "mov  $1f, %%eax\n\t"
+         "add  %3,  %%eax\n\t"
+         "push %%eax\n\t"
+         "lret\n\t"
          /* We have far called to this address from the above code and
           * are now in the hosts memory space */
-         "1:"
-         "ret;"
+         "1:\n\t"
+         "ret\n\t"
          /* Returned from hte linux function, now far return back to the
           * dos memory space */
-         "2:"
-         "lret;"
+         "2:\n\t"
+         "lret"
          /* We have changed some registers but don't care.  The fast call
           * will restore ecx, edx and eax will be set correctly on return */
          : "=m"(stack[0]), "=m"(stack[1])
@@ -147,16 +150,18 @@
      */
     return FXFALSE;
 /*
-    return __fcall (__faddr(char,filename),
-                    __faddr(Gu3dfInfo,file_info));
+    filename  = __faddr(char,filename);
+    file_info = __faddr(Gu3dfInfo,file_info);
+    return __fcall (filename, file_info);
 */
 ENDDECLARE

 DECLARE_STUB(GU3DFLOAD, FxBool, char *filename, Gu3dfInfo *file_info)
     return FXFALSE;
 /*
-    return __fcall (__faddr(char,filename),
-                    __faddr(Gu3dfInfo,file_info));
+    filename  = __faddr(char,filename);
+    file_info = __faddr(Gu3dfInfo,file_info);
+    return __fcall (filename, file_info);
 */
 ENDDECLARE

@@ -178,7 +183,8 @@
 ENDDECLARE

 DECLARE_THUNK(GUFOGGENERATEEXP, void, GrFog_t *table, int density)
-    __fcall (__faddr(GrFog_t,table), density);
+    table = __faddr(GrFog_t,table);
+    __fcall (table, density);
 ENDDECLARE

 DECLARE_STUB(GUFOGGENERATEEXP2, void, int a, int b)
@@ -194,9 +200,10 @@
 ENDDECLARE

 DECLARE_THUNK(GUDRAWTRIANGLEWITHCLIP, void, GrVertex *v1, GrVertex *v2, GrVertex *v3)
-    __fcall (__faddr(GrVertex,v1),
-             __faddr(GrVertex,v2),
-             __faddr(GrVertex,v3));
+    v1 = __faddr(GrVertex,v1);
+    v2 = __faddr(GrVertex,v2);
+    v3 = __faddr(GrVertex,v3);
+    __fcall (v1, v2, v3);
 ENDDECLARE

 DECLARE_STUB(GUAADRAWTRIANGLEWITHCLIP, void, int a, int b, int c)
@@ -248,7 +255,8 @@
 ENDDECLARE

 DECLARE_THUNK(GRSSTQUERYHARDWARE, FxBool, GrHwConfiguration *hwConfig)
-    return __fcall (__faddr(GrHwConfiguration,hwConfig));
+    hwConfig = __faddr(GrHwConfiguration,hwConfig);
+    return __fcall (hwConfig);
 ENDDECLARE

 DECLARE_THUNK(GRSSTSELECT, void, int which_sst)
@@ -304,7 +312,8 @@

 DECLARE_THUNK(GRTEXDOWNLOADMIPMAP, void, GrChipID_t tmu, FxU32 startAddress,
                                    FxU32 evenOdd, GrTexInfo *info)
-    __fcall (tmu, startAddress, evenOdd, __faddr(GrTexInfo,info));
+    info = __faddr(GrTexInfo,info);
+    __fcall (tmu, startAddress, evenOdd, info);
 ENDDECLARE

 DECLARE_STUB(GRTEXDOWNLOADTABLEPARTIAL, void, int a, int b, int c, int d, int e)
@@ -377,7 +386,9 @@
 ENDDECLARE

 DECLARE_THUNK(GUTEXDOWNLOADMIPMAP, void, GrMipMapId_t mmid, void *src, GuNccTable *table)
-    __fcall (mmid, __faddr(void,src), __faddr(GuNccTable,table));
+    src   = __faddr(void,src);
+    table = __faddr(GuNccTable,table);
+    __fcall (mmid, src, table);
 ENDDECLARE

 DECLARE_STUB(GUTEXDOWNLOADMIPMAPLEVEL, void, int a, int b, int c)
@@ -408,8 +419,9 @@
 ENDDECLARE

 DECLARE_THUNK(GRAADRAWLINE, void, GrVertex *v1, GrVertex *v2)
-    __fcall (__faddr(GrVertex,v1),
-             __faddr(GrVertex,v2));
+    v1 = __faddr(GrVertex,v1);
+    v2 = __faddr(GrVertex,v2);
+    __fcall (v1, v2);
 ENDDECLARE

 DECLARE_STUB(GRAADRAWTRIANGLE, void, int a, int b, int c, int d, int e, int f)
@@ -425,14 +437,16 @@
 ENDDECLARE

 DECLARE_THUNK(GRDRAWLINE, void, GrVertex *v1, GrVertex *v2)
-    __fcall (__faddr(GrVertex,v1),
-             __faddr(GrVertex,v2));
+    v1 = __faddr(GrVertex,v1);
+    v2 = __faddr(GrVertex,v2);
+    __fcall (v1, v2);
 ENDDECLARE

 DECLARE_THUNK(GRDRAWTRIANGLE, void, GrVertex *v1, GrVertex *v2, GrVertex *v3)
-    __fcall (__faddr(GrVertex,v1),
-             __faddr(GrVertex,v2),
-             __faddr(GrVertex,v3));
+    v1 = __faddr(GrVertex,v1);
+    v2 = __faddr(GrVertex,v2);
+    v3 = __faddr(GrVertex,v3);
+    __fcall (v1, v2, v3);
 ENDDECLARE

 DECLARE_STUB(GRDRAWPLANARPOLYGON, void, int a, int b, int c)
@@ -444,8 +458,9 @@
 DECLARE_STUB(GRDRAWPOLYGON, void, int a, int b, int c)
 ENDDECLARE

-DECLARE_THUNK(GRDRAWPOLYGONVERTEXLIST, void, int nverts, GrVertex vlist[])
-    __fcall (nverts, __faddr(GrVertex,vlist));
+DECLARE_THUNK(GRDRAWPOLYGONVERTEXLIST, void, int nverts, GrVertex *vlist)
+    vlist = __faddr(GrVertex,vlist);
+    __fcall (nverts, vlist);
 ENDDECLARE

 DECLARE_STUB(_GRCOLORCOMBINEDELTA0MODE, void, int a)
@@ -547,7 +562,8 @@
 ENDDECLARE

 DECLARE_THUNK(GRFOGTABLE, void, GrFog_t *ft)
-    __fcall (__faddr(GrFog_t,ft));
+    ft = __faddr(GrFog_t,ft);
+    __fcall (ft);
 ENDDECLARE

 /* FIXME? */
@@ -755,7 +771,8 @@
 ENDDECLARE

 DECLARE_THUNK(GRTEXSOURCE, void, GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info)
-    __fcall (tmu, startAddress, evenOdd, __faddr(GrTexInfo,info));
+    info = __faddr(GrTexInfo,info);
+    __fcall (tmu, startAddress, evenOdd, info);
 ENDDECLARE

 DECLARE_STUB(GRTEXMULTIBASE, void, int a, int b)
@@ -771,7 +788,8 @@
 ENDDECLARE

 DECLARE_THUNK(GRTEXDOWNLOADTABLE, void, GrChipID_t tmu, GrTexTable_t type, void *data)
-    __fcall (tmu, type, __faddr(void,data));
+    data = __faddr(void,data);
+    __fcall (tmu, type, data);
 ENDDECLARE

 DECLARE_STUB(GRTEXDOWNLOADMIPMAPLEVELPARTIAL, void, int a, int b, int c, int d,


Return SSA's codec info

Return SSA's codec info

git-svn-id: d8f21eb7283bfb39ebab2f8f9b4a259b233f9348@646 621663c8-3916-0410-8f58-edc14a8543d5

--- TextSubCodec.c
+++ TextSubCodec.c
@@ -388,13 +388,22 @@
 pascal ComponentResult TextSubCodecGetCodecInfo(TextSubGlobals glob, CodecInfo *info)
 {
 	OSErr err = noErr;
+	ComponentDescription desc;
+	short resid;
+
+	GetComponentInfo((Component)glob->self, &desc, 0, 0, 0);
+
+	if (desc.componentSubType == kSubFormatSSA)
+		resid = kSSASubCodecResource;
+	else
+		resid = kTextSubCodecResource;

 	if (info == NULL) {
 		err = paramErr;
 	} else {
 		CodecInfo **tempCodecInfo;

-		err = GetComponentResource((Component)glob->self, codecInfoResourceType, kTextSubCodecResource, (Handle *)&tempCodecInfo);
+		err = GetComponentResource((Component)glob->self, codecInfoResourceType, resid, (Handle *)&tempCodecInfo);
 		if (err == noErr) {
 			*info = **tempCodecInfo;
 			DisposeHandle((Handle)tempCodecInfo);


Let error message getter check for null pointer (#2634)

* check error message char pointer for null

* after a visit by clang-format-9

* return empty string in case of no error message (yet)

--- tiledb/sm/cpp_api/error.h
+++ tiledb/sm/cpp_api/error.h
@@ -90,7 +90,10 @@
   const std::string error_message() {
     const char* msg = nullptr;
     tiledb_error_message(error_.get(), &msg);
-    return std::string(msg);
+    if (msg == nullptr)
+      return std::string();
+    else
+      return std::string(msg);
   }

  private:
@@ -114,4 +117,4 @@

 }  // namespace tiledb

-#endif  // TILEDB_CPP_API_ERROR_H+#endif  // TILEDB_CPP_API_ERROR_H


Update AliAnalysisTaskNetLambdaMCTrad.h

Update AliAnalysisTaskNetLambdaMCTrad.h

--- PWGCF/EBYE/NetLambda/AliAnalysisTaskNetLambdaMCTrad.h
+++ PWGCF/EBYE/NetLambda/AliAnalysisTaskNetLambdaMCTrad.h
@@ -47,10 +47,11 @@
     TH2F*  f2fHistGenCentVsPtAntiLambda;
     TH2F*  f2fHistXiPlus;
     TH2F*  f2fHistXiMinus;
-    TH2F*  f2fHistLRecstat;
-    TH2F*  f2fHistARecstat;
-    TH2F*  f2fHistLGenstat;
-    TH2F*  f2fHistAGenstat;
+
+    TH2F*  f2fHistGenCentVsPtLambdaRap;
+    TH2F*  f2fHistGenCentVsPtAntiLambdaRap;
+    TH2F*  f2fHistXiPlusRap;
+    TH2F*  f2fHistXiMinusRap;

@@ -61,6 +62,9 @@
     TH2F*  f2fHistRecPrimariesCentVsPtLambdaFournegtight;
     TH2F*  f2fHistRecPrimariesCentVsPtLambdaFourposloose;
     TH2F*  f2fHistRecPrimariesCentVsPtLambdaFourpostight;
+
+    TH2F*  f2fHistRecPrimariesCentVsPtLambdaFourSigthreeRap;
+    TH2F*  f2fHistRecPrimariesCentVsPtAntiLambdaFourSigthreeRap;

     TH2F*  f2fHistRecPrimariesCentVsPtAntiLambdaFourSigthree;
@@ -74,19 +78,7 @@

     TH2F*  f2fHistRecSecCentVsPtLambdaFourSigthree;
-    TH2F*  f2fHistRecSecCentVsPtLambdaFourloose;
-    TH2F*  f2fHistRecSecCentVsPtLambdaFourtight;
     TH2F*  f2fHistRecSecCentVsPtAntiLambdaFourSigthree;
-    TH2F*  f2fHistRecSecCentVsPtAntiLambdaFourloose;
-    TH2F*  f2fHistRecSecCentVsPtAntiLambdaFourtight;
-
-
-    TH2F*  f2fHistRecMaterialCentVsPtLambdaFourSigthree;
-    TH2F*  f2fHistRecMaterialCentVsPtLambdaFourloose;
-    TH2F*  f2fHistRecMaterialCentVsPtLambdaFourtight;
-    TH2F*  f2fHistRecMaterialCentVsPtAntiLambdaFourSigthree;
-    TH2F*  f2fHistRecMaterialCentVsPtAntiLambdaFourloose;
-    TH2F*  f2fHistRecMaterialCentVsPtAntiLambdaFourtight;

     TH3F*  f3fHistLambdafromXiFourSigthree;
@@ -104,19 +96,18 @@
     TH3F*  f3fHistAntiLambdafromXiFourposloose;
     TH3F*  f3fHistAntiLambdafromXiFourpostight;

+
+    TH3F*  f3fHistLambdafromXiFourSigthreeRap;
+    TH3F*  f3fHistAntiLambdafromXiFourSigthreeRap;
+

-    TH3F*  f3fHistCentInvMassVsPtLambdaRecFourUntagloose;
-    TH3F*  f3fHistCentInvMassVsPtLambdaRecFourUntagtight;
     TH3F*  f3fHistCentInvMassVsPtLambdaRecFourSigthreeUntag;
-    TH3F*  f3fHistCentInvMassVsPtLambdaRecFourUntagCutloose;
-    TH3F*  f3fHistCentInvMassVsPtLambdaRecFourUntagCuttight;
     TH3F*  f3fHistCentInvMassVsPtLambdaRecFourSigthreeUntagCut;
     TH3F*  f3fHistCentInvMassVsPtAntiLambdaRecFourSigthreeUntag;
     TH3F*  f3fHistCentInvMassVsPtAntiLambdaRecFourSigthreeUntagCut;
-    TH3F*  f3fHistCentInvMassVsPtAntiLambdaRecFourUntagloose;
-    TH3F*  f3fHistCentInvMassVsPtAntiLambdaRecFourUntagCutloose;
-    TH3F*  f3fHistCentInvMassVsPtAntiLambdaRecFourUntagtight;
-    TH3F*  f3fHistCentInvMassVsPtAntiLambdaRecFourUntagCuttight;
+
+    TH3F*  f3fHistCentInvMassVsPtLambdaRecFourSigthree;
+    TH3F*  f3fHistCentInvMassVsPtAntiLambdaRecFourSigthree;

@@ -138,16 +129,8 @@

         THnSparse *fPtBinNplusNminusChTruth;

-        THnSparse *fPtBinNplusNminusChUNTagFourlooseBKG;
-        THnSparse *fPtBinNplusNminusChUNTagFourloose;
-        THnSparse *fPtBinNplusNminusChUNTagFourTightBKG;
-        THnSparse *fPtBinNplusNminusChUNTagFourTight;
-        THnSparse *fPtBinNplusNminusChUNTagFourBKG;
-        THnSparse *fPtBinNplusNminusChUNTagFour;
-        THnSparse *fPtBinNplusNminusChTagFour;
-
-
-
+        THnSparse *fPtBinNplusNminusChRec;
+        THnSparse *fPtBinNplusNminusChRecTag;

     Int_t    GetPtBin(Double_t pt);
     Double_t MyRapidity(Double_t rE, Double_t rPz) const;


Revert del() implementation

Revert del() implementation

--- impl/del.c
+++ impl/del.c
@@ -1,7 +1,7 @@
 /*
  * tkvdb
  *
- * Copyright (c) 2016-2021, Vladimir Misyurov
+ * Copyright (c) 2016-2020, Vladimir Misyurov
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -92,12 +92,15 @@
 #ifndef TKVDB_PARAMS_NODBFILE
 		prev->fnext[prev_off] = 0;
 #endif
-		prev->c.nsubnodes -= 1;
-
 		TKVDB_IMPL_NODE_FREE(tr, node);
 		return TKVDB_OK;
 	} else if (node->c.type & TKVDB_NODE_VAL) {
-		if (node->c.nsubnodes == 0) {
+		if (node->c.nsubnodes != 0) {
+			TKVDB_TRIGGERS_DELINTNODE(triggers, prev, node);
+
+			/* we have subnodes, so just clear value bit */
+			node->c.type &= ~TKVDB_NODE_VAL;
+		} else {
 			TKVDB_TRIGGERS_DELLEAF(triggers, prev, node);

 			/* no subnodes, delete node */
@@ -105,15 +108,10 @@
 #ifndef TKVDB_PARAMS_NODBFILE
 			prev->fnext[prev_off] = 0;
 #endif
+
 			prev->c.nsubnodes -= 1; /* XXX: not atomic */

 			TKVDB_IMPL_NODE_FREE(tr, node);
-		} else if (node->c.nsubnodes == 1) {
-			/*   */
-		} else {
-			TKVDB_TRIGGERS_DELINTNODE(triggers, prev, node);
-
-			node->c.type &= ~TKVDB_NODE_VAL;
 		}
 	} else {
 		return TKVDB_NOT_FOUND;


Use 32bit indexing for all the tensors involved in cwise operations

--- tensorflow/core/kernels/cwise_ops_sycl_common.h
+++ tensorflow/core/kernels/cwise_ops_sycl_common.h
@@ -62,7 +62,7 @@
   void operator()(const SYCLDevice& d, typename Functor::tout_type out,
                   typename Functor::tin_type in0,
                   typename Functor::tin_type in1, bool* error) {
-    To32Bit(out).device(d) = To32Bit(in0).binaryExpr(in1, typename Functor::func());
+    To32Bit(out).device(d) = To32Bit(in0).binaryExpr(To32Bit(in1), typename Functor::func());
   }

   void Left(const SYCLDevice& d, typename Functor::tout_type out,


changes to pal.h

changes to pal.h

--- impl/pal.h
+++ impl/pal.h
@@ -63,7 +63,7 @@
     typedef void *PVOID;
     typedef PVOID HANDLE;
     typedef char TCHAR;
-    typedef char *LPTSTR;
+    typedef char* LPTSTR;
     #define NO_ERROR 0
     #define INFINITE 0xFFFFFFFF
     #define WINAPI


Fixed wrong parsing of usb vendor/product id.
Keep it in human readable hex address..

git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@3243 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e

--- opensync/plugin/opensync_plugin_config.c
+++ opensync/plugin/opensync_plugin_config.c
@@ -102,6 +102,8 @@

 	osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, conn, cur, error);

+	unsigned int usbid;
+
 	for (; cur != NULL; cur = cur->next) {

 		if (cur->type != XML_ELEMENT_NODE)
@@ -112,9 +114,11 @@
 			continue;

 		if (!xmlStrcmp(cur->name, (const xmlChar *)"VendorID")) {
-			osync_plugin_connection_usb_set_vendorid(conn, atoi(str));
+			sscanf(str, "0x%x", &usbid);
+			osync_plugin_connection_usb_set_vendorid(conn, usbid);
 		} else if (!xmlStrcmp(cur->name, (const xmlChar *)"ProductID")) {
-			osync_plugin_connection_usb_set_productid(conn, atoi(str));
+			sscanf(str, "0x%x", &usbid);
+			osync_plugin_connection_usb_set_productid(conn, usbid);
 		} else if (!xmlStrcmp(cur->name, (const xmlChar *)"Interface")) {
 			osync_plugin_connection_usb_set_interface(conn, atoi(str));
 		} else {
@@ -513,7 +517,7 @@

 			interface = osync_plugin_connection_usb_get_interface(conn);
 			if (interface) {
-				str = g_strdup_printf("0x%x", interface);
+				str = g_strdup_printf("%u", interface);
 				xmlNewChild(typenode, NULL, (xmlChar*)"Interface", (xmlChar*)str);
 				g_free(str);
 			}


parse_message: fix VERBOSE line to compile with debugging on

--- wreck/wdns/msg/parse_message.c
+++ wreck/wdns/msg/parse_message.c
@@ -13,7 +13,7 @@
 	memset(m, 0, sizeof(*m));

 	if (len < WDNS_LEN_HEADER) {
-		VERBOSE("op=%p eop=%p\n", op, eop);
+		VERBOSE("packet too small len=%zd\n", len);
 		WDNS_ERROR(wdns_msg_err_len);
 	}


refactor LP filter into its own function

--- rtl_redsea.c
+++ rtl_redsea.c
@@ -60,6 +60,28 @@
   return yv[10];
 }

+double filter_lp_2400_iq(double input, int iq) {
+
+  /* Digital filter designed by mkfilter/mkshape/gencode   A.J. Fisher
+        Command line: mkfilter -Bu -Lp -o 5 -a 8.0000000000e-03
+                      0.0000000000e+00 -l */
+
+  static double gain = 1.080611891e+08;
+  static double xv[2][5+1], yv[2][5+1];
+
+  xv[iq][0] = xv[iq][1]; xv[iq][1] = xv[iq][2]; xv[iq][2] = xv[iq][3];
+  xv[iq][3] = xv[iq][4]; xv[iq][4] = xv[iq][5];
+  xv[iq][5] = input / gain;
+  yv[iq][0] = yv[iq][1]; yv[iq][1] = yv[iq][2]; yv[iq][2] = yv[iq][3];
+  yv[iq][3] = yv[iq][4]; yv[iq][4] = yv[iq][5];
+  yv[iq][5] = (xv[iq][0] + xv[iq][5]) + 5 * (xv[iq][1] + xv[iq][4])
+               + 10 * (xv[iq][2] + xv[iq][3])
+               + (  0.8498599655 * yv[iq][0]) + ( -4.3875359464 * yv[iq][1])
+               + (  9.0628533836 * yv[iq][2]) + ( -9.3625201736 * yv[iq][3])
+               + (  4.8373424748 * yv[iq][4]);
+  return yv[iq][5];
+}
+
 void biphase(double acc) {
   static double prev_acc = 0;
   static int    counter = 0;
@@ -111,22 +133,18 @@
   double acc          = 0;
   double prevsample   = 0;
   double sample_f     = 0;
-
-  double xv[2][6] = {{0}};
-  double yv[2][6] = {{0}};
-  double demod[2] = {0};
-
-  double lpf_gain = 1.080611891e+08;
+  double demod[2]     = {0};
+  int    c;
+  int    fmfreq       = 0;
+  int    bytesread;
+
+

 #ifdef DEBUG
   sbit = 0;
   dbit = 0;
   reading_frame = 0;
 #endif
-
-  int c;
-  int fmfreq = 0;
-  int bytesread;

   while ((c = getopt (argc, argv, "f:")) != -1)
     switch (c) {
@@ -171,7 +189,7 @@
       fwrite(outbuf, sizeof(int16_t), 1, U);
 #endif

-      /* Band-pass filter */
+      /* Subcarrier band-pass */
       sample_f = filter_bp_57k(sample[i] / 32768.0);

       /* DSB demodulate */
@@ -187,22 +205,9 @@
       fwrite(outbuf, sizeof(int16_t), 1, IQ);
 #endif

-      /* Butterworth lopass */
-      /* Digital filter designed by mkfilter/mkshape/gencode   A.J. Fisher
-        Command line: /www/usr/fisher/helpers/mkfilter -Bu -Lp -o 5 -a
-                      8.0000000000e-03 0.0000000000e+00 -l */
-      for (int iq=0;iq<=1;iq++) {
-
-        xv[iq][0] = xv[iq][1]; xv[iq][1] = xv[iq][2]; xv[iq][2] = xv[iq][3]; xv[iq][3] = xv[iq][4]; xv[iq][4] = xv[iq][5];
-        xv[iq][5] = demod[iq] / lpf_gain;
-        yv[iq][0] = yv[iq][1]; yv[iq][1] = yv[iq][2]; yv[iq][2] = yv[iq][3]; yv[iq][3] = yv[iq][4]; yv[iq][4] = yv[iq][5];
-        yv[iq][5] =   (xv[iq][0] + xv[iq][5]) + 5 * (xv[iq][1] + xv[iq][4]) + 10 * (xv[iq][2] + xv[iq][3])
-                     + (  0.8498599655 * yv[iq][0]) + ( -4.3875359464 * yv[iq][1])
-                     + (  9.0628533836 * yv[iq][2]) + ( -9.3625201736 * yv[iq][3])
-                     + (  4.8373424748 * yv[iq][4]);
-        demod[iq] = yv[iq][5];
-
-      }
+      /* Anti-alias & data-shaping low-pass */
+      demod[0] = filter_lp_2400_iq(demod[0], 0);
+      demod[1] = filter_lp_2400_iq(demod[1], 1);

 #ifdef DEBUG
       outbuf[0] = demod[0] * 32000;


SPARC: Fix ffi019 split load/store of HsInt64 into two parts to respect alignment constraints

--- rts/RtsAPI.c
+++ rts/RtsAPI.c
@@ -152,6 +152,31 @@
   return p;
 }

+
+#ifdef sparc_HOST_ARCH
+/* The closures returned by allocateLocal are only guaranteed to be 32 bit
+   aligned, because that's the size of pointers. SPARC v9 can't do
+   misaligned loads/stores, so we have to write the 64bit word in chunks         */
+
+HaskellObj
+rts_mkWord64 (Capability *cap, HsWord64 w_)
+{
+  StgWord64 w = (StgWord64)w_;
+  StgWord32 *tmp;
+
+  StgClosure *p = (StgClosure *)allocateLocal(cap,CONSTR_sizeW(0,2));
+  /* see mk_Int8 comment */
+  SET_HDR(p, W64zh_con_info, CCS_SYSTEM);
+
+  tmp    = (StgWord32*)&(p->payload[0]);
+
+  tmp[0] = (StgWord32)((StgWord64)w >> 32);
+  tmp[1] = (StgWord32)w;	/* truncate high 32 bits */
+  return p;
+}
+
+#else
+
 HaskellObj
 rts_mkWord64 (Capability *cap, HsWord64 w)
 {
@@ -165,6 +190,9 @@
   return p;
 }

+#endif
+
+
 HaskellObj
 rts_mkFloat (Capability *cap, HsFloat f)
 {
@@ -364,6 +392,26 @@
 }

+#ifdef sparc_HOST_ARCH
+/* The closures returned by allocateLocal are only guaranteed to be 32 bit
+   aligned, because that's the size of pointers. SPARC v9 can't do
+   misaligned loads/stores, so we have to write the 64bit word in chunks         */
+
+HsWord64
+rts_getWord64 (HaskellObj p)
+{
+    HsInt32* tmp;
+    // See comment above:
+    // ASSERT(p->header.info == I64zh_con_info ||
+    //        p->header.info == I64zh_static_info);
+    tmp = (HsInt32*)&(UNTAG_CLOSURE(p)->payload[0]);
+
+    HsInt64 i	= (HsWord64)((HsWord64)(tmp[0]) << 32) | (HsWord64)tmp[1];
+    return i;
+}
+
+#else
+
 HsWord64
 rts_getWord64 (HaskellObj p)
 {
@@ -374,6 +422,9 @@
     tmp = (HsWord64*)&(UNTAG_CLOSURE(p)->payload[0]);
     return *tmp;
 }
+
+#endif
+

 HsFloat
 rts_getFloat (HaskellObj p)


correctly producing new size arrays

correctly producing new size arrays

--- testexplode.c
+++ testexplode.c
@@ -2,73 +2,111 @@
 #include <stdio.h>
 #include <inttypes.h>

-void explode_entry(uint32_t numLevels, uint32_t numSizes, uint32_t levi, uint32_t* levels, uint32_t* si, uint32_t* startsi, uint32_t** sizes) {
+void explode_entry(uint32_t numLevels, uint32_t numSizes, uint32_t levi, uint32_t* levels, uint64_t* si, uint64_t* startsi, uint64_t** sizes, uint64_t* explodedsize, uint64_t* exploded) {
   if (levi == numLevels) {
     printf(".");
   }
   else {
     uint32_t coli = levels[levi];
-    uint32_t repeat = sizes[coli][si[coli]];
+    uint64_t repeat = sizes[coli][si[coli]];
     si[coli]++;
+
+    if (exploded != NULL)
+      exploded[(*explodedsize)] = repeat;
+    (*explodedsize)++;

     for (uint32_t j = 0;  j < numSizes;  j++)
       startsi[levi * numSizes + j] = si[j];

     printf("[");
-    for (uint32_t i = 0;  i < repeat;  i++) {
+    for (uint64_t i = 0;  i < repeat;  i++) {
       for (uint32_t j = 0;  j < numSizes;  j++)
         if (j != coli)
           si[j] = startsi[levi * numSizes + j];

-      explode_entry(numLevels, numSizes, levi + 1, levels, si, startsi, sizes);
+      explode_entry(numLevels, numSizes, levi + 1, levels, si, startsi, sizes, explodedsize, exploded);
     }
     printf("]");
   }
 }

-void explode(uint64_t numEntries, uint32_t numLevels, uint32_t numSizes, uint32_t* levels, uint32_t** sizes) {
-  uint32_t* indexes = malloc((numLevels + numSizes + numLevels*numSizes) * sizeof(uint32_t));
+// explode takes several 64-bit size arrays and produces a new 64-bit size array (if exploded is not NULL)
+// returns the number of 64-bit elements needed for that new size array
+uint64_t explode(uint64_t numEntries, uint32_t numLevels, uint32_t numSizes, uint32_t* levels, uint64_t** sizes, uint64_t* exploded) {
+  // numEntries is 64-bit because it can index a large number of events
+  // si and startsi are 64-bit because they can index a large sizes array
+  // everything else is 32-bit because they index a nesting level
+  uint32_t* indexes = malloc((numLevels + 2*numSizes + 2*numLevels*numSizes) * sizeof(uint32_t));

   uint32_t* levels2 = &indexes[0];
   for (uint32_t i = 0;  i < numLevels;  i++) levels2[i] = levels[i];

-  uint32_t* si = &indexes[numLevels];
+  uint64_t* si = (uint64_t*)&indexes[numLevels];
   for (uint32_t i = 0;  i < numSizes;  i++) si[i] = 0;

-  uint32_t* startsi = &indexes[numLevels + numSizes];
+  uint64_t* startsi = (uint64_t*)&indexes[numLevels + 2*numSizes];

-  for (uint64_t i = 0;  i < numEntries;  i++) {
-    explode_entry(numLevels, numSizes, 0, levels2, si, startsi, sizes);
+  uint64_t explodedsize = 0;
+  for (uint64_t entry = 0;  entry < numEntries;  entry++) {
+    explode_entry(numLevels, numSizes, 0, levels2, si, startsi, sizes, &explodedsize, exploded);
     printf("\n");
   }

   free(indexes);
+  return explodedsize;
 }

 int main(int argc, char** argv) {
+  uint64_t exploded_size;
+  uint64_t* exploded = NULL;
+
   printf("trick\n");
-  uint32_t trick_size[] = {0, 1, 1, 2, 0, 2};
+  uint64_t trick_size[] = {0, 1, 1, 2, 0, 2};
   uint32_t levels1[] = {0, 0};
-  uint32_t* sizes1[] = {trick_size};
-  explode(3, 2, 1, levels1, sizes1);
+  uint64_t* sizes1[] = {trick_size};
+  exploded_size = explode(3, 2, 1, levels1, sizes1, NULL);
+  exploded = malloc(exploded_size * sizeof(uint64_t));
+  explode(3, 2, 1, levels1, sizes1, exploded);
+  printf("@size = ");
+  for (uint64_t i = 0;  i < exploded_size;  i++) printf("%ld ", exploded[i]);
+  printf("\n\n");
+  free(exploded);

-  uint32_t xs2_size[] = {4};
-  uint32_t xss_size[] = {3, 2, 2, 2};
+  uint64_t xs2_size[] = {4};
+  uint64_t xss_size[] = {3, 2, 2, 2};

   printf("xs2 \\otimes xs2\n");
   uint32_t levels2[] = {0, 1};
-  uint32_t* sizes2[] = {xs2_size, xs2_size};
-  explode(1, 2, 2, levels2, sizes2);
+  uint64_t* sizes2[] = {xs2_size, xs2_size};
+  exploded_size = explode(1, 2, 2, levels2, sizes2, NULL);
+  exploded = malloc(exploded_size * sizeof(uint64_t));
+  explode(1, 2, 2, levels2, sizes2, exploded);
+  printf("@size = ");
+  for (uint64_t i = 0;  i < exploded_size;  i++) printf("%ld ", exploded[i]);
+  printf("\n\n");
+  free(exploded);

   printf("xss \\otimes xs2\n");
   uint32_t levels3[] = {0, 0, 1};
-  uint32_t* sizes3[] = {xss_size, xs2_size};
-  explode(1, 3, 2, levels3, sizes3);
+  uint64_t* sizes3[] = {xss_size, xs2_size};
+  exploded_size = explode(1, 3, 2, levels3, sizes3, NULL);
+  exploded = malloc(exploded_size * sizeof(uint64_t));
+  explode(1, 3, 2, levels3, sizes3, exploded);
+  printf("@size = ");
+  for (uint64_t i = 0;  i < exploded_size;  i++) printf("%ld ", exploded[i]);
+  printf("\n\n");
+  free(exploded);

   printf("xss[0] \\otimes xs2 \\otimes xss[1]\n");
   uint32_t levels4[] = {0, 1, 0};
-  uint32_t* sizes4[] = {xss_size, xs2_size};
-  explode(1, 3, 2, levels4, sizes4);
+  uint64_t* sizes4[] = {xss_size, xs2_size};
+  exploded_size = explode(1, 3, 2, levels4, sizes4, NULL);
+  exploded = malloc(exploded_size * sizeof(uint64_t));
+  explode(1, 3, 2, levels4, sizes4, exploded);
+  printf("@size = ");
+  for (uint64_t i = 0;  i < exploded_size;  i++) printf("%ld ", exploded[i]);
+  printf("\n\n");
+  free(exploded);

   return 0;
 }


fix pointer tagging bug in removeIndirections (fixes stableptr003)

--- rts/Stable.c
+++ rts/Stable.c
@@ -195,9 +195,11 @@
          get_itbl(q)->type == IND_OLDGEN ||
          get_itbl(q)->type == IND_PERM ||
          get_itbl(q)->type == IND_OLDGEN_PERM ) {
+      q = ((StgInd *)q)->indirectee;
       tag = GET_CLOSURE_TAG(q);
-      q = UNTAG_CLOSURE(((StgInd *)q)->indirectee);
+      q = UNTAG_CLOSURE(q);
   }
+
   return TAG_CLOSURE(tag,q);
 }


Moved Double_t -> Float_t

Moved Double_t -> Float_t

--- PWGLF/SPECTRA/PiKaPr/TOF/PbPb502/task/AliAnTOFtrack.h
+++ PWGLF/SPECTRA/PiKaPr/TOF/PbPb502/task/AliAnTOFtrack.h
@@ -33,9 +33,9 @@
   UShort_t fTrkCutMask;              //Mask for Track cuts information
   UShort_t fDCAXYIndex;              //Binned version of the XY impact parameters
   UShort_t fDCAZIndex;               //Binned version of the Z impact parameters
-  Double_t fLength;                  //Track length
+  Float_t fLength;                   //Track length
   Float_t fLengthRatio;              //Ratio of length of the track matched and the one from a distant cluster
-  Double_t fTOFTime;                 //Time measured by TOF
+  Float_t fTOFTime;                  //Time measured by TOF
   Float_t fTOFMismatchTime;          //Time measured by TOF from a distant cluster
   Float_t fTOFExpTime[kExpSpecies];  //Expected time for all species
   Float_t fTOFExpSigma[kExpSpecies]; //Expected sigmas for all species
@@ -43,8 +43,8 @@
   Int_t fTOFchan;                    //Channel of the matched track
   Float_t fEta;                      //Eta distribution of the track
   Float_t fPhi;                      //Phi distribution of the track
-  Double_t fPt;                      //Transverse momentum
-  Double_t fPTPC;                    //Momentum in the TPC
+  Float_t fPt;                       //Transverse momentum
+  Float_t fPTPC;                     //Momentum in the TPC
   Int_t fNTOFClusters;               //Number of clusters matchable to the one matched
   Float_t fTPCSignal;                //Signal in the TPC


Move declaration of the return list to the top of the function for C90

--- psutil/_psutil_linux.c
+++ psutil/_psutil_linux.c
@@ -259,6 +259,7 @@
     unsigned int len = sizeof(cpu_set_t);
     long pid;
     int i;
+    PyObject* ret_list;

     if (!PyArg_ParseTuple(args, "i", &pid)) {
         return NULL;
@@ -269,7 +270,7 @@
         return PyErr_SetFromErrno(PyExc_OSError);
     }

-    PyObject* ret_list = PyList_New(0);
+    ret_list = PyList_New(0);

     for (i = 0; i < CPU_SETSIZE; ++i)
     {


Fixed comment

Fixed comment

--- Pod/Classes/CoreData/DRYCoreDataTableViewDataSource.h
+++ Pod/Classes/CoreData/DRYCoreDataTableViewDataSource.h
@@ -12,7 +12,7 @@
 @protocol DRYCoreDataTableViewDataSource <NSObject>

 /**
- Called by the DRYCoreDataTableViewController when an update is detected for the given cell at the given indexpath. Your implementation of this method will typically use the fetched results controller to get the updated data. You should probably call this method from within the tableView:cellForRowAtIndexPath: method after dequeueing a cell.
+ Called by the DRYCoreDataTableViewController when an update is detected, represented by the given data for the given cell.
  */
 - (void)configureCell:(UITableViewCell *)cell withData:(id)data;


PROTON-1619: remove pn_connection_driver_log definitions

removed definitions: pn_connection_driver_log, pn_connection_driver_logf, pn_connection_driver_vlogf

--- proton-c/src/core/connection_driver.c
+++ proton-c/src/core/connection_driver.c
@@ -166,14 +166,6 @@
   va_end(ap);
 }

-void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg) {
-  pn_transport_log(d->transport, msg);
-}
-
-void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap) {
-  pn_transport_vlogf(d->transport, fmt, ap);
-}
-
 pn_connection_driver_t* pn_event_batch_connection_driver(pn_event_batch_t *batch) {
   return (batch->next_event == batch_next) ?
     (pn_connection_driver_t*)((char*)batch - offsetof(pn_connection_driver_t, batch)) :


By shortening statements.

By shortening statements.

--- src/luaconv.c
+++ src/luaconv.c
@@ -258,16 +258,14 @@
 PyObject *get_pobject(lua_State *L, lua_Object userdata) {
     if (!is_wrapped_object(L, userdata))
         lua_error(L, "#2 container for invalid pyobject!");
-    py_object *pobj = (py_object *) lua_getuserdata(L, userdata);
-    return pobj->object;
+    return ((py_object *) lua_getuserdata(L, userdata))->object;
 }

 /*get py object from wrap table */
 py_object *get_py_object(lua_State *L, lua_Object userdata) {
     if (!is_wrapped_object(L, userdata))
         lua_error(L, "#3 container for invalid pyobject!");
-    py_object *pobj = (py_object *) lua_getuserdata(L, userdata);
-    return pobj;
+    return ((py_object *) lua_getuserdata(L, userdata));
 }

 static void lnumber_convert(InterpreterObject *interpreter, lua_Object lobj, PyObject **ret) {


Remove the get_term() function. It pretty much can't work for
FreeBSD, and makes ugly diffs with the other crt1.c's. Leave
behind a comment (words supplied by Thomas Moestl) that explain
the issue.

OK'ed by:	tmm

--- lib/csu/sparc64/crt1.c
+++ lib/csu/sparc64/crt1.c
@@ -65,50 +65,28 @@
 char **environ;
 const char *__progname = "";

-/*
- * Grab %g1 before it gets used for anything by the compiler.
- * Sparc ELF psABI specifies a termination routine (if any) will be in
- * %g1
- */
-static __inline fptr
-get_term(void)
-{
-	fptr retval;
-
-#if 0
-#ifdef	__GNUC__
-	__asm__ volatile("mov %%g1,%0" : "=r"(retval));
-#else
-	retval = (fptr)0; /* XXXX Fix this for other compilers */
-#endif
-#else
-	retval = (fptr)0; /* XXXX temporary */
-#endif
-	return(retval);
-}
-
 /* The entry function. */
 /*
- * %o0 holds ps_strings pointer.  For Solaris compat and/or shared
- * libraries, if %g1 is not 0, it is a routine to pass to atexit().
- * (By passing the pointer in the usual argument register, we avoid
- * having to do any inline assembly, except to recover %g1.)
+ * %o0 holds ps_strings pointer.
  *
  * Note: kernel may (is not set in stone yet) pass ELF aux vector in %o1,
  * but for now we do not use it here.
+ *
+ * The SPARC compliance definitions specifies that the kernel pass the
+ * address of a function to be executed on exit in %g1. We do not make
+ * use of it as it is quite broken, because gcc can use this register
+ * as a temporary, so it is not safe from C code. Its even more broken
+ * for dynamic executables since rtld runs first.
  */
 /* ARGSUSED */
 void
 _start(char **ap, void (*cleanup)(void), struct Struct_Obj_Entry *obj __unused,
     struct ps_strings *ps_strings __unused)
 {
-	void (*term)(void);
 	int argc;
 	char **argv;
 	char **env;
 	const char *s;
-
-	term = get_term();

 	argc = *(long *)(void *)ap;
 	argv = ap + 1;
@@ -122,13 +100,6 @@
 	}

 	__sparc_utrap_setup();
-
-	/*
-	 * If the kernel or a shared library wants us to call
-	 * a termination function, arrange to do so.
-	 */
-	if (term)
-		atexit(term);

 	if (&_DYNAMIC != NULL)
 		atexit(cleanup);


remove debug

remove debug

--- src/maestro.c
+++ src/maestro.c
@@ -1521,7 +1521,7 @@
    SeqNodeDataPtr nodeDataPtr = NULL;
    int status = 1; /* starting with error condition */
    DIR *dirp = NULL;
-   SeqUtil_setDebug(1);
+   SeqUtil_setDebug(0);
    printf( "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" );
    printf( "maestro: node=%s signal=%s flow=%s loop_args=%s\n", _node, _signal, _flow, SeqLoops_getLoopArgs(_loops));


Scope reduction for waitingMsg

Scope reduction for waitingMsg

--- src/maestro.c
+++ src/maestro.c
@@ -2697,7 +2697,7 @@
 {

    int undoneIteration = 0, isWaiting = 0, depWildcard=0, ret=0;
-   char *waitingMsg = NULL, *currentIndexPtr = NULL;
+   char *currentIndexPtr = NULL;

    dep->ext = SeqLoops_indexToExt(dep->index);
    depWildcard = ( strstr(dep->ext,"+*") != NULL);
@@ -2798,6 +2798,7 @@
    }

    if( undoneIteration ) {
+      char *waitingMsg = NULL;
       /* Take this next line out */
       isWaiting = 1;
       if ( depWildcard ) {
@@ -2806,6 +2807,7 @@
          waitingMsg = formatWaitingMsg(  dep->exp_scope, dep->exp, dep->node_name, dep->ext, dep->datestamp );
       }
       setWaitingState( _nodeDataPtr, waitingMsg, dep->status );
+      free( waitingMsg );
    }

    /* if( undoneIteration || writeStatus != 0 )
@@ -2814,7 +2816,6 @@
     *    retval = 0;
     */

-   free( waitingMsg );

    return isWaiting;
 }


Bug 661438: Fix up gmacros.h a bit

Bug 661438: Fix up gmacros.h a bit

The macro here should be G_DEPRECATED, not G_GNUC_DEPRECATED.

--- glib/gmacros.h
+++ glib/gmacros.h
@@ -290,7 +290,7 @@
 #if    __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 #define G_DEPRECATED __attribute__((__deprecated__))
 #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
-#define G_GNUC_DEPRECATED __declspec(deprecated)
+#define G_DEPRECATED __declspec(deprecated)
 #else
 #define G_DEPRECATED
 #endif


GOptionContext: Improve help in simple cases

Only add [OPTION...] to the usage line if the context
has options. And shorten "Application Options" to just
"Options" if we don't have to differentiate from other
kinds of options.

--- glib/goption.c
+++ glib/goption.c
@@ -854,8 +854,11 @@
         }
     }

-  g_string_append_printf (string, "%s\n  %s %s",
-                          _("Usage:"), g_get_prgname(), _("[OPTION...]"));
+  g_string_append_printf (string, "%s\n  %s", _("Usage:"), g_get_prgname());
+  if (context->help_enabled ||
+      context->main_group->n_entries > 0 ||
+      context->groups != NULL)
+    g_string_append_printf (string, " %s", _("[OPTION...]"));

   if (rest_description)
     {
@@ -1040,7 +1043,10 @@
     {
       list = context->groups;

-      g_string_append (string,  _("Application Options:"));
+      if (context->help_enabled || list)
+        g_string_append (string,  _("Application Options:"));
+      else
+        g_string_append (string, _("Options:"));
       g_string_append (string, "\n");
       if (context->main_group)
         for (i = 0; i < context->main_group->n_entries; i++)


mark the thread cache fast path as likely

--- alloc.c
+++ alloc.c
@@ -279,7 +279,7 @@
         return ptr;
     }

-    if (slot) {
+    if (likely(slot)) {
         cache->bin[bin] = slot->next;
         cache->bin_size[bin] -= size;
         return slot;
@@ -550,7 +550,7 @@
     cache->bin[bin] = slot;
     cache->bin_size[bin] += size;

-    if (cache->bin_size[bin] > CACHE_SIZE) {
+    if (unlikely(cache->bin_size[bin] > CACHE_SIZE)) {
         cache->bin_size[bin] = size;
         while (cache->bin_size[bin] < CACHE_SIZE / 2) {
             slot = slot->next;


move setting the arena into arena_chunk_alloc

--- alloc.c
+++ alloc.c
@@ -252,9 +252,14 @@
             chunk_free(&arena->chunks, chunk, CHUNK_SIZE);
             return NULL;
         }
-        return chunk;
-    }
-    return chunk_alloc(NULL, CHUNK_SIZE, CHUNK_SIZE);
+    } else {
+        chunk = chunk_alloc(NULL, CHUNK_SIZE, CHUNK_SIZE);
+        if (unlikely(!chunk)) {
+            return NULL;
+        }
+    }
+    ((struct chunk *)chunk)->arena = arena - arenas;
+    return chunk;
 }

 static void arena_chunk_free(struct arena *arena, void *chunk) {
@@ -299,7 +304,6 @@
         if (unlikely(!chunk)) {
             return NULL;
         }
-        chunk->arena = arena - arenas;
         chunk->small = true;

         struct slab *slab = (struct slab *)ALIGNMENT_CEILING((uintptr_t)chunk->data, SLAB_SIZE);
@@ -509,7 +513,6 @@
         mutex_unlock(&arena->mutex);
         return NULL;
     }
-    chunk->arena = cache->arena_index;
     chunk->small = false;

     void *base = (char *)chunk + LARGE_CHUNK_HEADER;


- Fix tiny oopsie with function name

- Fix tiny oopsie with function name

--- include/coffee/core/base/renderer/eventapplication.h
+++ include/coffee/core/base/renderer/eventapplication.h
@@ -160,7 +160,7 @@
         r.installEventHandler(EventHandlerD{resumeFunction<Renderer,Data>, resume_str, &ev});

 #if defined(__EMSCRIPTEN__)
-        emscripten_set_main_loop(emscripten_looper<Renderer,Data>, &ev, 0, 0);
+        emscripten_set_main_loop_arg(emscripten_looper<Renderer,Data>, &ev, 0, 0);
 #endif

         if(!(*ev.renderer).init(visual, &err))


BindIndexInfo - Mipmap input output bind index 추가 #2

--- SOCEngine/SOCEngine/Rendering/Shading/BindIndexInfo.h
+++ SOCEngine/SOCEngine/Rendering/Shading/BindIndexInfo.h
@@ -87,5 +87,8 @@
 		VoxelMap_Albedo					= 0,
 		VoxelMap_Normal					= 1,
 		VoxelMap_Emission				= 2,
+
+		VoxelMipmap_InputVoxelMap		= 0,
+		VoxelMipmap_OutputVoxelMap		= 1
 	};
 }


Voxelization_Common - StoreVoxelMapAtomicColorAvg 개선

--- SOCEngine/SOCEngine/ShaderCodes/Voxelization_Common.h
+++ SOCEngine/SOCEngine/ShaderCodes/Voxelization_Common.h
@@ -52,32 +52,75 @@
 	}while(true);
 }

+uint encUnsignedNibble(uint m, uint n)
+{
+  return	(m & 0xFEFEFEFE)		|
+			(n & 0x00000001)		|
+			(n & 0x00000002) << 7U	|
+			(n & 0x00000004) << 14U	|
+			(n & 0x00000008) << 21U;
+}
+
+uint decUnsignedNibble(uint m)
+{
+  return	(m & 0x00000001)		|
+			(m & 0x00000100) >> 7U	|
+			(m & 0x00010000) >> 14U	|
+			(m & 0x01000000) >> 21U;
+}
+
 void StoreVoxelMapAtomicColorAvg(RWTexture3D<uint> voxelMap, int3 idx, float4 value)
 {
-	uint newValue = Float4ColorToUint(value);
-	uint prevStoredValue = 0;
-	uint currentStoredValue = 0;
+	uint newValue			= Float4ColorToUint(value);
+	uint prevStoredValue	= 0;
+	uint currentStoredValue	= 0;

-	// while̳ for ׷ ̹   ٰ  --;
+	uint counter = 0;
 	[allow_uav_condition]do
 	{
 		InterlockedCompareExchange(voxelMap[idx], prevStoredValue, newValue, currentStoredValue);

 		if(prevStoredValue == currentStoredValue)
 			break;
-
 		prevStoredValue = currentStoredValue;

-		float4 curFlt4 = ToFloat4(currentStoredValue);
-		curFlt4.xyz = curFlt4.xyz * curFlt4.w;
+		float4 rval = ToFloat4(currentStoredValue & 0xFEFEFEFE);
+		uint n = decUnsignedNibble(currentStoredValue);

-		float4 reCompute = curFlt4 + value;
-		reCompute.xyz /= (reCompute.w);
+		rval = rval * n + value;
+		rval /= ++n;
+		rval = round(rval / 2) * 2;
+		newValue = encUnsignedNibble(ToUint(rval), n);

-		newValue = ToUint(reCompute);
+	}while(counter++ < 16);
+}

-	}while(true);
-}
+//void StoreVoxelMapAtomicColorAvg(RWTexture3D<uint> voxelMap, int3 idx, float4 value)
+//{
+//	uint newValue = Float4ColorToUint(value);
+//	uint prevStoredValue = 0;
+//	uint currentStoredValue = 0;
+//
+//	// while̳ for ׷ ̹   ٰ  --;
+//	[allow_uav_condition]do
+//	{
+//		InterlockedCompareExchange(voxelMap[idx], prevStoredValue, newValue, currentStoredValue);
+//
+//		if(prevStoredValue == currentStoredValue)
+//			break;
+//
+//		prevStoredValue = currentStoredValue;
+//
+//		float4 curFlt4 = ToFloat4(currentStoredValue);
+//		curFlt4.xyz = curFlt4.xyz * curFlt4.w;
+//
+//		float4 reCompute = curFlt4 + value;
+//		reCompute.xyz /= (reCompute.w);
+//
+//		newValue = ToUint(reCompute);
+//
+//	}while(true);
+//}

 void StoreVoxelMapAtomicAddNormalOneValue(RWTexture3D<uint> voxelMap, int3 idx, float value)
 {


change format error string to use globals directly

--- rmw/src/error_handling.c
+++ rmw/src/error_handling.c
@@ -64,8 +64,7 @@
       "[rmw|error_handling.c:" RMW_STRINGIFY(__LINE__)
       "] failed to allocate memory for the error message in the error state struct\n");
 #endif
-    free(__rmw_error_state);
-    __rmw_error_state = NULL;
+    rmw_reset_error();  // This will free any allocations done so far.
     return;
   }
   // Cast the const away to set ->message initially.
@@ -81,14 +80,14 @@
 }

 static void
-format_error_string(char * dst, const rmw_error_state_t * error_state)
+format_error_string()
 {
   size_t bytes_it_would_have_written = SNPRINTF(
     NULL, 0,
     __error_format_string,
-    error_state->message, error_state->file, error_state->line_number);
-  dst = (char *)rmw_allocate(bytes_it_would_have_written + 1);
-  if (!dst) {
+    __rmw_error_state->message, __rmw_error_state->file, __rmw_error_state->line_number);
+  __rmw_error_string = (char *)rmw_allocate(bytes_it_would_have_written + 1);
+  if (!__rmw_error_string) {
 #if RMW_REPORT_ERROR_HANDLING_ERRORS
     // rmw_allocate failed, but fwrite might work?
     SAFE_FWRITE_TO_STDERR(
@@ -98,18 +97,18 @@
     return;
   }
   SNPRINTF(
-    dst, bytes_it_would_have_written + 1,
+    __rmw_error_string, bytes_it_would_have_written + 1,
     __error_format_string,
-    error_state->message, error_state->file, error_state->line_number);
+    __rmw_error_state->message, __rmw_error_state->file, __rmw_error_state->line_number);
   // The Windows version of snprintf does not null terminate automatically in all cases.
-  dst[bytes_it_would_have_written] = '\0';
+  __rmw_error_string[bytes_it_would_have_written] = '\0';
 }

 const char *
 rmw_get_error_string()
 {
   if (!__rmw_error_string) {
-    format_error_string(__rmw_error_string, __rmw_error_state);
+    format_error_string();
   }
   return __rmw_error_string;
 }


remove temp files after an error with <CsScore bin="...">

--- Top/one_file.c
+++ Top/one_file.c
@@ -436,6 +436,8 @@
         sprintf(sys, "%s %s %s", prog, extname, ST(sconame));
         if (UNLIKELY(system(sys) != 0)) {
           csoundErrorMsg(csound, Str("External generation failed"));
+          remove(extname);
+          remove(ST(sconame));
           return FALSE;
         }
         remove(extname);


Set default adapter on registration

Set default adapter on registration

--- src/manager.c
+++ src/manager.c
@@ -376,6 +376,13 @@
 			DBUS_TYPE_INVALID);

 	adapters = g_slist_append(adapters, adapter);
+
+	if (default_adapter_id < 0) {
+		int new_default = hci_get_route(NULL);
+
+		if (new_default >= 0)
+			manager_set_default_adapter(new_default);
+	}
 }

 static void manager_remove_adapter(struct btd_adapter *adapter)
@@ -445,7 +452,7 @@
 	if (ret < 0)
 		return ret;

-	if (manager_get_default_adapter() < 0)
+	if (default_adapter_id < 0)
 		manager_set_default_adapter(id);

 	return 0;


Free raw map object data once we are done with it.

--- src/mapdata.c
+++ src/mapdata.c
@@ -911,6 +911,8 @@
             /* Save it into the struct */
             tmp2[k * nvars + l].count = sz / 0x44;
             tmp2[k * nvars + l].objs = gobj;
+
+            free(obj);
         }
     }

@@ -1123,6 +1125,8 @@
             /* Save it into the struct */
             tmp2[k * nvars + l].count = sz / 0x44;
             tmp2[k * nvars + l].objs = gobj;
+
+            free(obj);
         }
     }


Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_AND

--- extensions/ringopengl/opengl11/ring_opengl11.c
+++ extensions/ringopengl/opengl11/ring_opengl11.c
@@ -1683,6 +1683,11 @@
 RING_FUNC(ring_get_gl_clear)
 {
 	RING_API_RETNUMBER(GL_CLEAR);
+}
+
+RING_FUNC(ring_get_gl_and)
+{
+	RING_API_RETNUMBER(GL_AND);
 }

 RING_API void ringlib_init(RingState *pRingState)
@@ -2022,4 +2027,5 @@
 	ring_vm_funcregister("get_gl_4_bytes",ring_get_gl_4_bytes);
 	ring_vm_funcregister("get_gl_double",ring_get_gl_double);
 	ring_vm_funcregister("get_gl_clear",ring_get_gl_clear);
-}
+	ring_vm_funcregister("get_gl_and",ring_get_gl_and);
+}


refactored function to take single integer instead of vector

--- fraction.h
+++ fraction.h
@@ -61,10 +61,11 @@
 	return factors;
 }

-// getnFactors() - given a vector of prime factors, consolidate into numFactors factors
-// and return a set of vectors representing possible solutions:
-std::set<std::vector<int>> getnFactors(std::vector<int> primeFactors, int numFactors) {
-
+// getnFactors() - factorize a number x into numFactors factors.
+// return a set of vectors representing possible solutions
+std::set<std::vector<int>> getnFactors(int x, int numFactors) {
+
+	std::vector<int> primes = factorize(x);
     std::set<std::vector<int>> results;
     std::vector<int> currentFactors(numFactors,1);

@@ -87,7 +88,7 @@
         return;
     }; // ends recursivePart

-    recursivePart(primeFactors, numFactors);
+    recursivePart(primes, numFactors);

     return results;
 }


isl923x: Set OTG enable debounce time to 150ms

The default setting is to wait 1.3s from receiving the command, to
enable the OTG output: that's too long, and makes time to active
base very long when running on battery.

BRANCH=none
BUG=b:76396020
TEST=Probe POGO 1/5 and one of the USB lines, check that time from
     connect to active USB is reduced to 580 ms (from 1920 ms).

Change-Id: Iee00fd27978434ccac052e60a94534919dc29f43
Signed-off-by: Nicolas Boichat <f3daba1cdc403799935674d3cd4b0e5bd1804232@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/981853
Reviewed-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>

--- driver/charger/isl923x.c
+++ driver/charger/isl923x.c
@@ -319,6 +319,7 @@

 	if (raw_write16(ISL923X_REG_CONTROL2,
 			reg |
+			ISL923X_C2_OTG_DEBOUNCE_150 |
 			ISL923X_C2_PROCHOT_DEBOUNCE_1000 |
 			ISL923X_C2_ADAPTER_DEBOUNCE_150))
 		goto init_fail;


isl9241: set BC12 charge minimum voltage

BUG=b:169350714
BRANCH=none
TEST=make buildall

Signed-off-by: Keith Short <f6d578f97033c25f1206cb57d52f358974c82954@chromium.org>
Change-Id: I87cd85b92b53fca6206d437012787c049fb075bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2441388
Reviewed-by: Abe Levkoy <2e1ad7039298f93262cf06bbb457275fb3e2ecb5@chromium.org>

--- driver/charger/isl9241.h
+++ driver/charger/isl9241.h
@@ -20,6 +20,9 @@
 #define INPUT_I_MAX	6140
 #define INPUT_I_MIN	4
 #define	INPUT_I_STEP	4
+
+/* Default minimum VIN voltage controlled by ISL9241_REG_VIN_VOLTAGE */
+#define ISL9241_BC12_MIN_VOLTAGE	4096

 /* Registers */


refactor tiny things

refactor tiny things

--- src/mcp9808.c
+++ src/mcp9808.c
@@ -79,8 +79,9 @@
 	mcp9808_t* s = TO_S(_s);
 	int error;

-	if((error = ioctl(s->file, I2C_SLAVE, s->address)) < 0)
+	if((error = ioctl(s->file, I2C_SLAVE, s->address)) < 0) {
 		DEBUG("error: ioctl() failed\n");
+	}

 	return error;
 }
@@ -122,7 +123,7 @@
 	DEBUG("device: init using address %#x and i2cbus %s\n", address, i2c_device_filepath);

 	void *_s = malloc(sizeof(mcp9808_t));
-	if(_s == NULL)  {
+	if(_s == NULL) {
 		DEBUG("error: malloc returns NULL pointer\n");
 		return NULL;
 	}
@@ -162,6 +163,7 @@
 	DEBUG("device: manuf_id: 0x%04x, device_id: 0x%04x\n", s->manuf_id, s->device_id);

 	DEBUG("device: open ok\n");
+
 	return _s;
 }


trim leading non-alpha chars from mesage file output

--- src/message.c
+++ src/message.c
@@ -68,6 +68,10 @@

     if ( messagelevel == -1 ) {
         init();
+    }
+
+    while( ( ! isalpha(file[0]) ) && ( file[0] != '\0') ) {
+        file++;
     }

     switch (level) {


Deleting midwife.c

Deleting midwife.c

--- src/midwife.c
+++ src/midwife.c
@@ -1,191 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200809L
-#endif
-
-#ifndef __cplusplus
-# include <stdbool.h>
-# include <iso646.h>
-#endif
-
-#include <string.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-
-
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
-# define NORETURN _Noreturn
-#elif defined(__cplusplus) && __cplusplus >= 201103L
-# define NORETURN [[noreturn]]
-#elif defined(__GNUC__) && __GNUC__ > 2 ||      \
-  (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)
-# define NORETURN __attribute__((noreturn))
-#elif !defined(NORETURN)
-# define NORETURN
-#endif
-
-static NORETURN void die (const char *arg);
-static void die(const char *arg) {
-  fputs(arg, stderr);
-  exit(127);
-}
-
-static char *program_name;
-int parseHex(char a);
-int parseHex(char a) {
-  if ('0' <= a && a <= '9') {
-    return a - '0';
-  } else if ('a' <= a && a <= 'f') {
-    int value = a - 'a';
-    return value + 10;
-  } else if ('A' <= a && a <= 'F') {
-    int value = a - 'A';
-    return value + 10;
-  } else {
-    die("Bad %- escape\n");
-  }
-}
-
-
-int parseArgs(char *string, char ** buffer, char *dest);
-int parseArgs(char *string, char ** buffer, char *dest) {
-  char *cursor = dest;
-  size_t numArg = 0;
-  const char *ptr = string;
-  buffer[numArg++] = dest;
-  while(true) {
-    char value = *ptr++;
-    int result;
-    switch (value) {
-      case '&': *cursor++ = '\0';
-        buffer[numArg++] = cursor;
-        break;
-      case '+': *cursor++ = ' ';
-        break;
-      case '%':
-        result = 16 * parseHex(*ptr++);
-        result += parseHex(*ptr++);
-        *cursor++ = (result > 127) ? result - 256 : result;
-        break;
-      case '\0':
-        *cursor = '\0';
-        buffer[numArg] = (char *)0;
-        return 0;
-      default: *cursor++ = value;
-        break;
-    }
-  }
-}
-void usage(void);
-void usage(void) {
-  fprintf(stderr, "usage: %s (percent-encoded argument) filename ...\n",
-          program_name);
-}
-#if 0
-void debugPrint(char ** buffer);
-void debugPrint(char ** buffer) {
-  char *string;
-  while ((string = *buffer++)) {
-    fputs(string, stderr);
-  }
-}
-#endif
-
-char * parseLines (char * numLines, char *fileName) {
-  char *ptr = 0;
-  char *end;
-  {
-    FILE *fileptr = fopen(fileName, "r");
-    if ((FILE*)0 == fileptr) {
-      die("Cannot open input file\n");
-    }
-    errno = 0;
-    unsigned long int numlines = strtoul(numLines, &end, 10);
-    if (0 != errno || '\0' != *end) {
-      die("bad number of lines");
-    }
-
-    size_t length;
-    off_t linesize;
-    for (size_t i = 0; i < numlines; ++i) {
-      linesize = getline(&ptr, &length, fileptr);
-    }
-    fclose(fileptr);
-  }
-  char *begin = strstr(ptr, "-*-");
-  if (NULL == begin) {
-    die("missing -*- start token");
-  }
-  else {
-    begin += 3;
-    char * end = strlen(begin) + begin - 1;
-    for (char* i = end; i != begin; --i) {
-      if (0 == strncmp(i, "-*-", 3)) { break; }
-    }
-    if (end == begin) {
-      die("missing -*- end token");
-    }
-  }
-  *end = '\0';
-  return begin;
-}
-
-/*!re2c */
-
-int main(int argc, char **argv) {
-  char * dest[128];
-  char **buffer;
-  program_name = argv[0];
-  size_t bufsize;
-  if (argc < 3) {
-    usage();
-    return 127;
-  }
-  char *extras = 0;
-
-  size_t numextraargs = 1;
-  {
-    char *ptr = argv[1];
-    char value;
-    if (0 == strncmp(ptr, "-n", 2)) {
-      extras = parseLines(ptr + 2, argv[2]);
-      numextraargs = 3;
-    } else {
-      while ((value = *ptr++)) {
-        if ('&' == value) {
-          ++numextraargs;
-        }
-      }
-    }
-  }
-
-
-  /* Subtract one argument for our own name
-   * and another for the command string */
-  bufsize = (argc + numextraargs - 1);
-  buffer = bufsize <= 128 ? dest : (char**)calloc(bufsize, sizeof(char *));
-  if (0 == buffer) {
-    die("Error allocating memory\n");
-  }
-  /* Parse arguments */
-  if (extras) {
-    buffer[0] = "/bin/sh";
-    buffer[1] = "-c";
-    buffer[2] = extras;
-  } else {
-    char *result = argv[1];
-    int value = parseArgs(argv[1], buffer, result);
-    if (value) {
-      return value;
-    }
-  }
-  fflush(stderr);
-  memcpy(buffer + numextraargs, argv + 2, sizeof(char *) * (argc - 1));
-  execv(buffer[0], buffer);
-  die("Failed to exec!\n");
-}


deflate_compress: replace COST_SHIFT with BIT_COST

This is a bit easier to understand, and the compiler will optimize the
mulitplications to shifts anyway.

--- lib/deflate_compress.c
+++ lib/deflate_compress.c
@@ -211,14 +211,18 @@
 };

 /*
- * COST_SHIFT is a scaling factor that makes it possible to consider fractional
- * bit costs.  A token requiring 'n' bits to represent has cost n << COST_SHIFT.
- *
- * Note: this is only useful as a statistical trick for when the true costs are
- * unknown.  In reality, each token in DEFLATE requires a whole number of bits
- * to output.
- */
-#define COST_SHIFT	3
+ * BIT_COST is a scaling factor that allows the compressor to consider
+ * fractional bit costs when deciding which literal/match sequence to use.  This
+ * is useful when the true symbol costs are unknown.  For example, if the
+ * compressor thinks that a symbol has 6.5 bits of entropy, it can set its cost
+ * to 6.5 bits rather than have to use 6 or 7 bits.  Although in the end each
+ * symbol will use a whole number of bits due to the Huffman coding, considering
+ * fractional bits can be helpful due to the limited information.
+ *
+ * BIT_COST should be a power of 2.  A value of 8 or 16 works well.  A higher
+ * value isn't very useful since the calculations are approximate anyway.
+ */
+#define BIT_COST	8

 /*
  * The NOSTAT_BITS value for a given alphabet is the number of bits assumed to
@@ -2332,7 +2336,7 @@
 	/* Literals  */
 	for (i = 0; i < DEFLATE_NUM_LITERALS; i++) {
 		u32 bits = (lens->litlen[i] ? lens->litlen[i] : LITERAL_NOSTAT_BITS);
-		c->p.n.costs.literal[i] = bits << COST_SHIFT;
+		c->p.n.costs.literal[i] = bits * BIT_COST;
 	}

 	/* Lengths  */
@@ -2341,21 +2345,21 @@
 		unsigned litlen_sym = 257 + length_slot;
 		u32 bits = (lens->litlen[litlen_sym] ? lens->litlen[litlen_sym] : LENGTH_NOSTAT_BITS);
 		bits += deflate_extra_length_bits[length_slot];
-		c->p.n.costs.length[i] = bits << COST_SHIFT;
+		c->p.n.costs.length[i] = bits * BIT_COST;
 	}

 	/* Offset slots  */
 	for (i = 0; i < ARRAY_LEN(deflate_offset_slot_base); i++) {
 		u32 bits = (lens->offset[i] ? lens->offset[i] : OFFSET_NOSTAT_BITS);
 		bits += deflate_extra_offset_bits[i];
-		c->p.n.costs.offset_slot[i] = bits << COST_SHIFT;
+		c->p.n.costs.offset_slot[i] = bits * BIT_COST;
 	}
 }

 static forceinline u32
 deflate_default_literal_cost(unsigned literal)
 {
-	STATIC_ASSERT(COST_SHIFT == 3);
+	STATIC_ASSERT(BIT_COST == 8);
 	/* 66 is 8.25 bits/symbol  */
 	return 66;
 }
@@ -2363,28 +2367,28 @@
 static forceinline u32
 deflate_default_length_slot_cost(unsigned length_slot)
 {
-	STATIC_ASSERT(COST_SHIFT == 3);
+	STATIC_ASSERT(BIT_COST == 8);
 	/* 60 is 7.5 bits/symbol  */
-	return 60 + ((u32)deflate_extra_length_bits[length_slot] << COST_SHIFT);
+	return 60 + ((u32)deflate_extra_length_bits[length_slot] * BIT_COST);
 }

 static forceinline u32
 deflate_default_offset_slot_cost(unsigned offset_slot)
 {
-	STATIC_ASSERT(COST_SHIFT == 3);
+	STATIC_ASSERT(BIT_COST == 8);
 	/* 39 is 4.875 bits/symbol  */
-	return 39 + ((u32)deflate_extra_offset_bits[offset_slot] << COST_SHIFT);
+	return 39 + ((u32)deflate_extra_offset_bits[offset_slot] * BIT_COST);
 }

 /*
  * Set default symbol costs for the first block's first optimization pass.
  *
  * It works well to assume that each symbol is equally probable.  This results
- * in each symbol being assigned a cost of (-log2(1.0/num_syms) * (1 <<
- * COST_SHIFT)) where 'num_syms' is the number of symbols in the corresponding
- * alphabet.  However, we intentionally bias the parse towards matches rather
- * than literals by using a slightly lower default cost for length symbols than
- * for literals.  This often improves the compression ratio slightly.
+ * in each symbol being assigned a cost of (-log2(1.0/num_syms) * BIT_COST)
+ * where 'num_syms' is the number of symbols in the corresponding alphabet.
+ * However, we intentionally bias the parse towards matches rather than literals
+ * by using a slightly lower default cost for length symbols than for literals.
+ * This often improves the compression ratio slightly.
  */
 static void
 deflate_set_default_costs(struct libdeflate_compressor *c)


migrate: absttl

migrate: absttl

--- src/migrate.c
+++ src/migrate.c
@@ -850,6 +850,7 @@
     mstime_t ttl;

     int replace;
+    int absttl;
     int non_blocking;

     list *fragments;
@@ -1003,7 +1004,7 @@
     dbAdd(args->db, args->key, args->obj);

     if (args->ttl != 0) {
-        setExpire(c, args->db, args->key, mstime() + args->ttl);
+        setExpire(c, args->db, args->key, args->absttl ? args->ttl : args->ttl + mstime());
     }
     signalModifiedKey(args->db, args->key);
     server.dirty++;
@@ -1139,13 +1140,16 @@
     addReply(c, shared.syntaxerr);
 }

-// RESTORE key ttl serialized-value [REPLACE] [ASYNC]
+// RESTORE key ttl serialized-value [REPLACE] [ASYNC] [ABSTTL]
 void restoreCommand(client *c) {
     int replace = 0;
+    int absttl = 0;
     int non_blocking = 0;
     for (int j = 4; j < c->argc; j++) {
         if (strcasecmp(c->argv[j]->ptr, "replace") == 0) {
             replace = 1;
+        } else if (strcasecmp(c->argv[j]->ptr, "absttl") == 0) {
+            absttl = 1;
         } else if (strcasecmp(c->argv[j]->ptr, "async") == 0) {
             non_blocking = 1;
         } else {
@@ -1177,6 +1181,7 @@

     args->ttl = ttl;
     args->replace = replace;
+    args->absttl = absttl;

     restoreGenericCommandAddFragment(args, c->argv[3]);


docs: fixup broken xref

docs: fixup broken xref

--- gst/gstelement.c
+++ gst/gstelement.c
@@ -206,7 +206,7 @@
    * usually be emitted from the context of the streaming thread. Also keep in
    * mind that if you add new elements to the pipeline in the signal handler
    * you will need to set them to the desired target state with
-   * gst_element_set() or gst_element_sync_state_with_parent().
+   * gst_element_set_state() or gst_element_sync_state_with_parent().
    */
   gst_element_signals[PAD_ADDED] =
       g_signal_new ("pad-added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
@@ -2233,7 +2233,7 @@
  *
  * This function returns %GST_STATE_CHANGE_NO_PREROLL if the element
  * successfully changed its state but is not able to provide data yet.
- * This mostly happens for live sources that only produce data in
+ * This mostly happens for live sources that only produce data in
  * %GST_STATE_PLAYING. While the state change return is equivalent to
  * %GST_STATE_CHANGE_SUCCESS, it is returned to the application to signal that
  * some sink elements might not be able to complete their state change because


migrate: set thread.arena=0

migrate: set thread.arena=0

--- src/migrate.c
+++ src/migrate.c
@@ -15,8 +15,21 @@
                          // pipe_fds[1]: written by worker thread
 } migrateCommandThread;

-static void* migrateCommandThreadMain(void* privdata) {
-    migrateCommandThread* p = privdata;
+static void *migrateCommandThreadMain(void *privdata) {
+#if defined(USE_JEMALLOC)
+    do {
+        unsigned arena_ind = 0;
+        int ret = je_mallctl("thread.arena", NULL, NULL, &arena_ind,
+                             sizeof(arena_ind));
+        if (ret != 0) {
+            serverLog(LL_WARNING,
+                      "Call je_mallctl to set thread.arena=%d failed: %s",
+                      (int)arena_ind, strerror(ret));
+        }
+    } while (0);
+#endif
+
+    migrateCommandThread *p = privdata;

     // TODO: Not finished yet.
     UNUSED(p);


Remove some useless references to socket addresses.

--- src/miknode.c
+++ src/miknode.c
@@ -31,8 +31,6 @@
 	for (i = li; i; i = i->ai_next) {
 		err = bind(s, i->ai_addr, i->ai_addrlen);
 		if (!err) {
-			h->ai_addr = i->ai_addr;
-			h->ai_addrlen = i->ai_addrlen;
 			bound = 1;
 			break;
 		}
@@ -70,8 +68,6 @@
 	while (socks < 2) {
 		memset(portstr, 0, MIK_PORT_MAX);
 		sprintf(portstr, "%u", port);
-		h.ai_addr = 0;
-		h.ai_addrlen = 0;

 		h.ai_socktype = SOCK_STREAM;
 		if (mik_testbind(*t, &h, portstr) > 0)


Modify sending and receiving to honor bare state.

If a peer is in the state MIK_BARE, none of the miknet protocol should be
used; everything should be left up to the programmer. This includes
separating packets. One exception is that per call to miknode_poll(),
miknet will only receive MIK_PACK_MAX bytes per peer.

--- src/miknode.c
+++ src/miknode.c
@@ -240,7 +240,6 @@

 	char buffer[MIK_META_SZ] = {0};
 	int size = recv(p->tcp, buffer, MIK_META_SZ, MSG_PEEK);
-	mikmeta_t data = mik_read_meta(buffer);

 	if (size < 0) {
 		mik_debug(ERR_SOCKET);
@@ -254,23 +253,38 @@
 		p->node->peerc--;
 		mikpeer_close(p);
 	} else {
-		if (data.len > MIK_PACK_MAX)
-			return ERR_WOULD_FAULT;
-
-		recv(p->tcp, buffer, MIK_META_SZ, 0);
-
-		void *tmp = try_alloc(NULL, data.len);
-		recv(p->tcp, tmp, data.len, 0);
-
+		void *tmp = NULL;
 		mikpack_t event = {0};
-		event.type = data.type;
-		event.channel = data.channel;
-		event.len = data.len;
+		mikmeta_t data = mik_read_meta(buffer);
+
+		if (p->state == MIK_CONN) {
+			if (data.len > MIK_PACK_MAX)
+				return ERR_WOULD_FAULT;
+
+			recv(p->tcp, buffer, MIK_META_SZ, 0);
+
+			tmp = try_alloc(NULL, data.len);
+			recv(p->tcp, tmp, data.len, 0);
+
+			p->recvd += MIK_META_SZ + data.len;
+
+			event.channel = data.channel;
+			event.len = data.len;
+		} else if (p->state == MIK_BARE) {
+			char buffer[MIK_PACK_MAX] = {0};
+			int len = recv(p->tcp, buffer, MIK_PACK_MAX, 0);
+
+			tmp = try_alloc(NULL, len);
+			memcpy(tmp, buffer, len);
+
+			event.len = len;
+		}
+
+		event.type = MIK_DATA;
 		event.peer = p->index;
 		event.data = tmp;

 		p->node->packs = mikvec_add(p->node->packs, event);
-		p->recvd += MIK_META_SZ + event.len;
 	}

 	return 0;
@@ -310,14 +324,21 @@

 	i = 0;
 	while (i < n->commands.size) {
+		int usemiknet = 0;
+		if (n->peers[n->commands.data[i].peer].state == MIK_CONN) {
+			usemiknet = 1;
+		}
+
+		int prefix = usemiknet ? MIK_META_SZ : 0;
 		int sock = n->peers[n->commands.data[i].peer].tcp;
 		int len = n->commands.data[i].len;
-		char buffer[MIK_META_SZ + len];
-
-		mik_write_meta(n->commands.data[i], buffer);
-		memcpy(buffer + MIK_META_SZ, n->commands.data[i].data, len);
-
-		int sent = send(sock, buffer, MIK_META_SZ + len, 0);
+		char buffer[prefix + len];
+
+		if (usemiknet)
+			mik_write_meta(n->commands.data[i], buffer);
+		memcpy(buffer + prefix, n->commands.data[i].data, len);
+
+		int sent = send(sock, buffer, prefix + len, 0);
 		if (sent < 0)
 			mik_debug(ERR_SOCKET);


ACPI, APEI, EINJ, Refine the fix of resource conflict

Current fix for resource conflict is to remove the address region <param1 &
param2, ~param2+1> from trigger resource, which is highly relies on valid user
input. This patch is trying to avoid such potential issues by fetching the
exact address region from trigger action table entry.

Signed-off-by: Xiao, Hui <7d86078428be6cb9bfaba1627acd54975d9315d2@linux.intel.com>
Signed-off-by: Huang Ying <b1ed892af366400004b51f70e40351e33707b6c4@intel.com>
Signed-off-by: Len Brown <b060cfa1096cc6e8be83699ddb4ed8a77dd63af5@intel.com>

--- drivers/acpi/apei/einj.c
+++ drivers/acpi/apei/einj.c
@@ -194,6 +194,26 @@
 	return 0;
 }

+static struct acpi_generic_address *einj_get_trigger_parameter_region(
+	struct acpi_einj_trigger *trigger_tab, u64 param1, u64 param2)
+{
+	int i;
+	struct acpi_whea_header *entry;
+
+	entry = (struct acpi_whea_header *)
+		((char *)trigger_tab + sizeof(struct acpi_einj_trigger));
+	for (i = 0; i < trigger_tab->entry_count; i++) {
+		if (entry->action == ACPI_EINJ_TRIGGER_ERROR &&
+		entry->instruction == ACPI_EINJ_WRITE_REGISTER_VALUE &&
+		entry->register_region.space_id ==
+			ACPI_ADR_SPACE_SYSTEM_MEMORY &&
+		(entry->register_region.address & param2) == (param1 & param2))
+			return &entry->register_region;
+		entry++;
+	}
+
+	return NULL;
+}
 /* Execute instructions in trigger error action table */
 static int __einj_error_trigger(u64 trigger_paddr, u32 type,
 				u64 param1, u64 param2)
@@ -205,6 +225,7 @@
 	struct resource *r;
 	u32 table_size;
 	int rc = -EIO;
+	struct acpi_generic_address *trigger_param_region = NULL;

 	r = request_mem_region(trigger_paddr, sizeof(*trigger_tab),
 			       "APEI EINJ Trigger Table");
@@ -266,12 +287,17 @@
 	if (param_extension && (type & 0x0038) && param2) {
 		struct apei_resources addr_resources;
 		apei_resources_init(&addr_resources);
-		rc = apei_resources_add(&addr_resources,
-					param1 & param2,
-					~param2 + 1, true);
-		if (rc)
-			goto out_fini;
-		rc = apei_resources_sub(&trigger_resources, &addr_resources);
+		trigger_param_region = einj_get_trigger_parameter_region(
+			trigger_tab, param1, param2);
+		if (trigger_param_region) {
+			rc = apei_resources_add(&addr_resources,
+				trigger_param_region->address,
+				trigger_param_region->bit_width/8, true);
+			if (rc)
+				goto out_fini;
+			rc = apei_resources_sub(&trigger_resources,
+					&addr_resources);
+		}
 		apei_resources_fini(&addr_resources);
 		if (rc)
 			goto out_fini;


tests: filters: filter_mirror_h: Fix test data

+ remove the G1 case that needs proper support for buffer comparsion

Signed-off-by: Cyril Hrubis <b1e90efd3b808b8e0bcf2a9a55fd8b9a779bfd81@ucw.cz>

--- tests/filters/filter_mirror_h.c
+++ tests/filters/filter_mirror_h.c
@@ -39,8 +39,7 @@

 	/* Test with allocated destination */
 	c = gp_pixmap_alloc(t->w, t->h, t->pixel_type);
-
-	if (c == NULL) {
+	if (!c) {
 		tst_err("Failed to allocate pixmap");
 		return TST_UNTESTED;
 	}
@@ -89,8 +88,8 @@
 	},

 	.src = {
-		0, 1,
-		2, 3,
+		3, 2,
+		1, 0,
 	}
 };

@@ -101,8 +100,8 @@
 	.pixel_type = GP_PIXEL_G8,

 	.res = (const char[]) {
-		0,   1,  2,  3,  4,  5,  6,  7,  8,  9,
-		10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+		19, 18, 17, 16, 15, 14, 13, 12, 11, 10,
+		 9,  8,  7,  6,  5,  4,  3,  2,  1,  0,
 	},

 	.src = {
@@ -124,9 +123,9 @@
 	},

 	.src = {
-		0, 1,
-		2, 3,
-		4, 5,
+		5, 4,
+		3, 2,
+		1, 0,
 	}
 };

@@ -144,9 +143,9 @@
 	},

 	.src = {
-		0, 1, 2,
-		3, 4, 5,
-		6, 7, 8,
+		8, 7, 6,
+		5, 4, 3,
+		2, 1, 0,
 	}
 };

@@ -171,27 +170,6 @@
 	}
 };

-/* Now tests with pixel types that are not byte aligned */
-//TODO: Fix comparsion
-struct testcase testcase_G1_16x2 = {
-	.w = 3,
-	.h = 2,
-
-	.pixel_type = GP_PIXEL_G1,
-
-	.offset = 4,
-
-	.res = (const char[]) {
-		0x0f, 0xaa, 0xf0,
-		0xff, 0xff, 0xff,
-	},
-
-	.src = {
-		 0x0f,  0xff,  0xf0,
-		 0xff,  0xaa,  0xff,
-	}
-};
-
 static int abort_callback_fn(gp_progress_cb GP_UNUSED(*self))
 {
 	return 1;
@@ -207,8 +185,7 @@
 	gp_pixmap *c;

 	c = gp_pixmap_alloc(10, 10, GP_PIXEL_G8);
-
-	if (c == NULL) {
+	if (!c) {
 		tst_err("Failed to allocate pixmap");
 		return TST_UNTESTED;
 	}
@@ -221,7 +198,7 @@
 	}

 	if (errno != ECANCELED) {
-		tst_msg("Errno wasn't set to ECANCELED");
+		tst_msg("Errno wasn't set to ECANCELED but %i", errno);
 		return TST_FAILED;
 	}

@@ -238,8 +215,7 @@
 		tst_msg("Trying pixel %s", gp_pixel_type_name(pixel_type));

 		c = gp_pixmap_alloc(10, 10, pixel_type);
-
-		if (c == NULL) {
+		if (!c) {
 			tst_err("Failed to allocate pixmap");
 			return TST_UNTESTED;
 		}
@@ -279,10 +255,6 @@
 		 .tst_fn = test_mirror_h,
 		 .data = &testcase_3x3},

-		{.name = "Mirror h G1 16x2",
-		 .tst_fn = test_mirror_h,
-		 .data = &testcase_G1_16x2},
-
 		{.name = "Mirror h Callback Abort",
 		 .tst_fn = test_abort},


ACPI, APEI, EINJ, limit the range of einj_param

On the platforms with ACPI4.x support, parameter extension
is not always doable, which means only parameter extension
is enabled, einj_param can take effect.

v2->v1: stopping early in einj_get_parameter_address for einj_param

Signed-off-by: Chen Gong <1b6cd78b57df009d087b682fa5d09a04e6a050ac@linux.intel.com>
Acked-by: Tony Luck <e7984595ec0368ff920a7b3521dc7093683f6f26@intel.com>
Signed-off-by: Len Brown <b060cfa1096cc6e8be83699ddb4ed8a77dd63af5@intel.com>


sata_sil24: separate out sil24_do_softreset()

Separate out sil24_do_softreset() which takes @pmp as its last
argument.  This will be used to implement sil24_pmp_softreset().

Signed-off-by: Tejun Heo <ccfba69985e72fbcd9ba8bbb6db43d42971ad06d@gmail.com>
Signed-off-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>

--- drivers/ata/sata_sil24.c
+++ drivers/ata/sata_sil24.c
@@ -578,8 +578,8 @@
 	return rc;
 }

-static int sil24_softreset(struct ata_port *ap, unsigned int *class,
-			   unsigned long deadline)
+static int sil24_do_softreset(struct ata_port *ap, unsigned int *class,
+			      int pmp, unsigned long deadline)
 {
 	unsigned long timeout_msec = 0;
 	struct ata_taskfile tf;
@@ -605,7 +605,8 @@
 		timeout_msec = jiffies_to_msecs(deadline - jiffies);

 	ata_tf_init(ap->device, &tf);	/* doesn't really matter */
-	rc = sil24_exec_polled_cmd(ap, 0, &tf, 0, PRB_CTRL_SRST, timeout_msec);
+	rc = sil24_exec_polled_cmd(ap, pmp, &tf, 0, PRB_CTRL_SRST,
+				   timeout_msec);
 	if (rc == -EBUSY) {
 		reason = "timeout";
 		goto err;
@@ -627,6 +628,12 @@
  err:
 	ata_port_printk(ap, KERN_ERR, "softreset failed (%s)\n", reason);
 	return -EIO;
+}
+
+static int sil24_softreset(struct ata_port *ap, unsigned int *class,
+			   unsigned long deadline)
+{
+	return sil24_do_softreset(ap, class, 0, deadline);
 }

 static int sil24_hardreset(struct ata_port *ap, unsigned int *class,


PM / QoS: fix wrong error-checking condition

dev_pm_qos_add_request() can return 0, 1, or a negative error code,
therefore the correct error test is "if (error < 0)." Checking just for
non-zero return code leads to erroneous setting of the req->dev pointer
to NULL, which then leads to a repeated call to
dev_pm_qos_add_ancestor_request() in st1232_ts_irq_handler(). This in turn
leads to an Oops, when the I2C host adapter is unloaded and reloaded again
because of the inconsistent state of its QoS request list.

Signed-off-by: Guennadi Liakhovetski <50875182aae23d69ca7738697596f18a14e926fc@gmx.de>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <27ffc44a8ec6a212fba98cfc3246c6ce8ab131e0@intel.com>

--- drivers/base/power/qos.c
+++ drivers/base/power/qos.c
@@ -451,7 +451,7 @@
 	if (ancestor)
 		error = dev_pm_qos_add_request(ancestor, req, value);

-	if (error)
+	if (error < 0)
 		req->dev = NULL;

 	return error;


dmaengine: jz4740: Remove chancnt affectations

chanctnt is already filled by dma_async_device_register, which uses the channel
list to know how much channels there is.

Since it's already filled, we can safely remove it from the drivers' probe
function.

Signed-off-by: Maxime Ripard <2d324f4ca95610bde432fa2af2f28cd21110687d@free-electrons.com>
Signed-off-by: Vinod Koul <5cf69c63beb17bf38d63aa0e923ee8256af0e205@intel.com>


gpio/omap: fix build error when OF_GPIO is not defined.

The OMAP GPIO driver check if the chip has an associated
Device Tree node using the struct gpio_chip of_node member.

But this is only build if CONFIG_OF_GPIO is defined which
leads to the following error when using omap1_defconfig:

linux/drivers/gpio/gpio-omap.c: In function 'omap_gpio_chip_init':
linux/drivers/gpio/gpio-omap.c:1080:17: error: 'struct gpio_chip' has no member named 'of_node'
linux/drivers/gpio/gpio-omap.c: In function 'omap_gpio_irq_map':
linux/drivers/gpio/gpio-omap.c:1116:16: error: 'struct gpio_chip' has no member named 'of_node'

Reported-by: Kevin Hilman <f9849b02abe18c1ece6bd40346458ed53f49d31b@linaro.org>
Signed-off-by: Javier Martinez Canillas <039000e09e601bba70626bd0fbe59654c9cf8cac@collabora.co.uk>
Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>


vfs: fix handling of lock allocation failure in lease-break case

Bruce Fields notes that commit 778fc546f749 ("locks: fix tracking of
inprogress lease breaks") introduced a possible error pointer
dereference on failure to allocate memory.  locks_conflict() will
dereference the passed-in new lease lock structure that may be an error pointer.

This means an open (without O_NONBLOCK set) on a file with a lease
applied (generally only done when Samba or nfsd (with v4) is running)
could crash if a kmalloc() fails.

So instead of playing games with IS_ERROR() all over the place, just
check the allocation failure early.  That makes the code more
straightforward, and avoids this possible bad pointer dereference.

Based-on-patch-by: J. Bruce Fields <51738506c1b2ccb0761f23bdc612c93babf738ea@redhat.com>
Cc: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- fs/locks.c
+++ fs/locks.c
@@ -1205,6 +1205,8 @@
 	int want_write = (mode & O_ACCMODE) != O_RDONLY;

 	new_fl = lease_alloc(NULL, want_write ? F_WRLCK : F_RDLCK);
+	if (IS_ERR(new_fl))
+		return PTR_ERR(new_fl);

 	lock_flocks();

@@ -1220,12 +1222,6 @@
 	for (fl = flock; fl && IS_LEASE(fl); fl = fl->fl_next)
 		if (fl->fl_owner == current->files)
 			i_have_this_lease = 1;
-
-	if (IS_ERR(new_fl) && !i_have_this_lease
-			&& ((mode & O_NONBLOCK) == 0)) {
-		error = PTR_ERR(new_fl);
-		goto out;
-	}

 	break_time = 0;
 	if (lease_break_time > 0) {
@@ -1284,8 +1280,7 @@

 out:
 	unlock_flocks();
-	if (!IS_ERR(new_fl))
-		locks_free_lock(new_fl);
+	locks_free_lock(new_fl);
 	return error;
 }


gpio: zynq: Remove .owner field for driver

There is no need to init .owner field.

Based on the patch from Peter Griffin <peter.griffin@linaro.org>
"mmc: remove .owner field for drivers using module_platform_driver"

This patch removes the superflous .owner field for drivers which
use the module_platform_driver API, as this is overriden in
platform_driver_register anyway."

Signed-off-by: Michal Simek <b20e59da6aeb5cea6c82b021069d69f63616c55d@xilinx.com>
Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>


msm: kgsl: Change the order of GPU global mappings

Move frequently accessed memories like read write pointers,
memstore and mmu setstate memory together. This helps
TLB prefetcher to always keep these entries in TLB.
If they are far apart they are going in and out of TLB
and causing XPU violations.

CRs-Fixed: 548223
Change-Id: I4aa72481ebab839745e4ad9b4dc9912925100dad
Signed-off-by: Tarun Karra <130908656622cf304523d334877ef0f505f9a71e@codeaurora.org>

--- drivers/gpu/msm/adreno.c
+++ drivers/gpu/msm/adreno.c
@@ -633,11 +633,11 @@

 	kgsl_mmu_unmap(pagetable, &device->memstore);

+	kgsl_mmu_unmap(pagetable, &adreno_dev->pwron_fixup);
+
+	kgsl_mmu_unmap(pagetable, &device->mmu.setstate_memory);
+
 	kgsl_mmu_unmap(pagetable, &adreno_dev->profile.shared_buffer);
-
-	kgsl_mmu_unmap(pagetable, &adreno_dev->pwron_fixup);
-
-	kgsl_mmu_unmap(pagetable, &device->mmu.setstate_memory);
 }

 static int adreno_setup_pt(struct kgsl_device *device,
@@ -649,24 +649,29 @@

 	result = kgsl_mmu_map_global(pagetable, &rb->buffer_desc);

+	/*
+	 * ALERT: Order of these mapping is important to
+	 * Keep the most used entries like memptrs, memstore
+	 * and mmu setstate memory by TLB prefetcher.
+	 */
+
 	if (!result)
 		result = kgsl_mmu_map_global(pagetable, &rb->memptrs_desc);

 	if (!result)
 		result = kgsl_mmu_map_global(pagetable, &device->memstore);
+
+	if (!result)
+		result = kgsl_mmu_map_global(pagetable,
+			&adreno_dev->pwron_fixup);
+
+	if (!result)
+		result = kgsl_mmu_map_global(pagetable,
+			&device->mmu.setstate_memory);

 	if (!result)
 		result = kgsl_mmu_map_global(pagetable,
 			&adreno_dev->profile.shared_buffer);
-
-	if (!result)
-		result = kgsl_mmu_map_global(pagetable,
-			&adreno_dev->pwron_fixup);
-
-
-	if (!result)
-		result = kgsl_mmu_map_global(pagetable,
-			&device->mmu.setstate_memory);

 	if (result) {
 		/* On error clean up what we have wrought */
@@ -679,8 +684,8 @@
 	 * For the IOMMU, this will be used to restrict access to the
 	 * mapped registers.
 	 */
-	device->mh.mpu_range = device->mmu.setstate_memory.gpuaddr +
-				device->mmu.setstate_memory.size;
+	device->mh.mpu_range = adreno_dev->profile.shared_buffer.gpuaddr +
+				adreno_dev->profile.shared_buffer.size;

 	return 0;
 }


flow box: Fix bad children allocation with RTL locales

If the position of the children is always relative to the box
then we should not take the allocation of the box into account
when flipping the children for RTL text direction.

This patch also removes unused assignments to child_allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=754559

--- gtk/gtkflowbox.c
+++ gtk/gtkflowbox.c
@@ -1606,21 +1606,12 @@
   gint i, this_line_size;
   GSequenceIter *iter;

-  child_allocation.x = 0;
-  child_allocation.y = 0;
-  child_allocation.width = 0;
-  child_allocation.height = 0;
-
   gtk_widget_set_allocation (widget, allocation);
   window = gtk_widget_get_window (widget);
   if (window != NULL)
     gdk_window_move_resize (window,
                             allocation->x, allocation->y,
                             allocation->width, allocation->height);
-
-  child_allocation.x = 0;
-  child_allocation.y = 0;
-  child_allocation.width = allocation->width;

   min_items = MAX (1, priv->min_children_per_line);

@@ -1938,7 +1929,7 @@
         }

       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
-        child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
+        child_allocation.x = allocation->width - child_allocation.x - child_allocation.width;
       gtk_widget_size_allocate (child, &child_allocation);

       item_offset += this_item_size;


msm: kgsl: Fix compilation error when debugfs is disabled

The code does not compile when debugfs is disabled. Fix
this.

Change-Id: Ieab5ded22fd98c28edaa4ceb227df0ef342c2087
Signed-off-by: Olav Haugan <fbf4ddd114d5f0aa83cb721b7dacab8a264ccf22@codeaurora.org>

--- drivers/gpu/msm/adreno.h
+++ drivers/gpu/msm/adreno.h
@@ -55,8 +55,6 @@
 #define KGSL_START_OF_PROFILE_IDENTIFIER	0x2DEFADE1
 #define KGSL_END_OF_PROFILE_IDENTIFIER	0x2DEFADE2
 #define KGSL_PWRON_FIXUP_IDENTIFIER	0x2AFAFAFA
-
-void adreno_debugfs_init(struct kgsl_device *device);

 #define ADRENO_ISTORE_START 0x5000 /* Istore offset */


change mod 644

change mod 644


Remove ONLY_R5RS_PARENTHESES condition

Remove ONLY_R5RS_PARENTHESES condition

--- src/miniscm.c
+++ src/miniscm.c
@@ -1393,10 +1393,8 @@
 #define TOK_SHARP   10
 #define TOK_VEC     11

-#ifndef ONLY_R5RS_PARENTHESES
 #define TOK_PAREN_SQUARE 16
 #define TOK_PAREN_CURLY  32
-#endif

 /* get new character from input file */
 int inchar(void)
@@ -1662,7 +1660,6 @@
 		return TOK_LPAREN;
 	case ')':
 		return TOK_RPAREN;
-#ifndef ONLY_R5RS_PARENTHESES
 	case '[':
 		return TOK_LPAREN | TOK_PAREN_SQUARE;
 	case ']':
@@ -1671,7 +1668,6 @@
 		return TOK_LPAREN | TOK_PAREN_CURLY;
 	case '}':
 		return TOK_RPAREN | TOK_PAREN_CURLY;
-#endif
 	case '.':
 		if ((c = inchar()) == '.') {
 			backchar(c);
@@ -1703,12 +1699,10 @@
 	case '#':
 		if ((c = inchar()) == '(') {
 			return TOK_VEC;
-#ifndef ONLY_R5RS_PARENTHESES
 		} else if (c == '[') {
 			return TOK_VEC | TOK_PAREN_SQUARE;
 		} else if (c == '{') {
 			return TOK_VEC | TOK_PAREN_CURLY;
-#endif
 		} else {
 			backchar(c);
 			return TOK_SHARP;
@@ -7184,11 +7178,7 @@
 			} else if (tok == TOK_DOT) {
 				Error_0("syntax error -- illegal dot expression");
 			} else {
-#ifndef ONLY_R5RS_PARENTHESES
 				code = mk_integer((int32_t)w);
-#else
-				code = NIL;
-#endif
 				s_save(OP_RDLIST, NIL, code);
 				s_goto(OP_RDSEXPR);
 			}
@@ -7214,19 +7204,11 @@
 			tok = token();
 			s_goto(OP_RDSEXPR);
 		case TOK_ATOM:
-#ifndef ONLY_R5RS_PARENTHESES
 			s_return(mk_atom(readstr("()[]{};\t\n\r ")));
-#else
-			s_return(mk_atom(readstr("();\t\n\r ")));
-#endif
 		case TOK_DQUOTE:
 			s_return(readstrexp());
 		case TOK_SHARP:
-#ifndef ONLY_R5RS_PARENTHESES
 			if ((x = mk_const(readstr("()[]{};\t\n\r "))) == NIL) {
-#else
-			if ((x = mk_const(readstr("();\t\n\r "))) == NIL) {
-#endif
 				Error_0("Undefined sharp expression");
 			} else {
 				s_return(x);
@@ -7242,14 +7224,10 @@
 		if (tok == TOK_EOF) {
 			s_return(EOF_OBJ);
 		} else if ((tok & 0x0f) == TOK_RPAREN) {
-#ifndef ONLY_R5RS_PARENTHESES
 			if (ivalue(code) == (tok >> 4)) {
 				s_return(non_alloc_rev(NIL, args));
 			}
 			Error_0("syntax error -- unexpected parenthesis");
-#else
-			s_return(non_alloc_rev(NIL, args));
-#endif
 		} else if (tok == TOK_DOT) {
 			s_save(OP_RDDOT, args, code);
 			tok = token();
@@ -7262,14 +7240,10 @@
 	case OP_RDDOT:
 		tok = token();
 		if ((tok & 0x0f) == TOK_RPAREN) {
-#ifndef ONLY_R5RS_PARENTHESES
 			if (ivalue(code) == (tok >> 4)) {
 				s_return(non_alloc_rev(value, args));
 			}
 			Error_0("syntax error -- unexpected parenthesis");
-#else
-			s_return(non_alloc_rev(value, args));
-#endif
 		} else {
 			Error_0("syntax error -- illegal dot expression");
 		}


hwmon: (applesmc) Use pr_fmt and pr_<level>

Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats

Signed-off-by: Joe Perches <16a9a54ddf4259952e3c118c763138e83693d7fd@perches.com>
Signed-off-by: Henrik Rydberg <b7088a9c70345a9ab94cacab3cc3888d0a7dc884@euromail.se>
Signed-off-by: Guenter Roeck <32ce62c5480002985aec58d7044038218061ef55@ericsson.com>

--- drivers/hwmon/applesmc.c
+++ drivers/hwmon/applesmc.c
@@ -25,6 +25,8 @@
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

 #include <linux/delay.h>
 #include <linux/platform_device.h>
@@ -251,8 +253,7 @@
 		}
 	}

-	printk(KERN_WARNING "applesmc: wait status failed: %x != %x\n",
-						val, inb(APPLESMC_CMD_PORT));
+	pr_warn("wait status failed: %x != %x\n", val, inb(APPLESMC_CMD_PORT));

 	return -EIO;
 }
@@ -271,8 +272,7 @@
 		if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == 0x0c)
 			return 0;
 	}
-	printk(KERN_WARNING "applesmc: command failed: %x -> %x\n",
-		cmd, inb(APPLESMC_CMD_PORT));
+	pr_warn("command failed: %x -> %x\n", cmd, inb(APPLESMC_CMD_PORT));
 	return -EIO;
 }

@@ -286,8 +286,8 @@
 	int i;

 	if (len > APPLESMC_MAX_DATA_LENGTH) {
-		printk(KERN_ERR	"applesmc_read_key: cannot read more than "
-					"%d bytes\n", APPLESMC_MAX_DATA_LENGTH);
+		pr_err("%s(): cannot read more than %d bytes\n",
+		       __func__, APPLESMC_MAX_DATA_LENGTH);
 		return -EINVAL;
 	}

@@ -329,8 +329,8 @@
 	int i;

 	if (len > APPLESMC_MAX_DATA_LENGTH) {
-		printk(KERN_ERR	"applesmc_write_key: cannot write more than "
-					"%d bytes\n", APPLESMC_MAX_DATA_LENGTH);
+		pr_err("%s(): cannot write more than %d bytes\n",
+		       __func__, APPLESMC_MAX_DATA_LENGTH);
 		return -EINVAL;
 	}

@@ -470,7 +470,7 @@
 		msleep(INIT_WAIT_MSECS);
 	}

-	printk(KERN_WARNING "applesmc: failed to init the device\n");
+	pr_warn("failed to init the device\n");

 out:
 	mutex_unlock(&applesmc_lock);
@@ -616,8 +616,7 @@
 		if (ret)
 			goto out;
 		data_length = clamp_val(query[0], 0, 10);
-		printk(KERN_INFO "applesmc: light sensor data length set to "
-			"%d\n", data_length);
+		pr_info("light sensor data length set to %d\n", data_length);
 	}

 	ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length);
@@ -1383,18 +1382,18 @@
 {
 	int i = 0;
 	struct dmi_match_data* dmi_data = id->driver_data;
-	printk(KERN_INFO "applesmc: %s detected:\n", id->ident);
+	pr_info("%s detected:\n", id->ident);
 	applesmc_accelerometer = dmi_data->accelerometer;
-	printk(KERN_INFO "applesmc:  - Model %s accelerometer\n",
-				applesmc_accelerometer ? "with" : "without");
+	pr_info(" - Model %s accelerometer\n",
+		applesmc_accelerometer ? "with" : "without");
 	applesmc_light = dmi_data->light;
-	printk(KERN_INFO "applesmc:  - Model %s light sensors and backlight\n",
-					applesmc_light ? "with" : "without");
+	pr_info(" - Model %s light sensors and backlight\n",
+		applesmc_light ? "with" : "without");

 	applesmc_temperature_set =  dmi_data->temperature_set;
 	while (temperature_sensors_sets[applesmc_temperature_set][i] != NULL)
 		i++;
-	printk(KERN_INFO "applesmc:  - Model with %d temperature sensors\n", i);
+	pr_info(" - Model with %d temperature sensors\n", i);
 	return 1;
 }

@@ -1445,7 +1444,7 @@
 	sysfs_remove_group(&pdev->dev.kobj, &accelerometer_attributes_group);

 out:
-	printk(KERN_WARNING "applesmc: driver init failed (ret=%d)!\n", ret);
+	pr_warn("driver init failed (ret=%d)!\n", ret);
 	return ret;
 }

@@ -1625,7 +1624,7 @@
 	int i;

 	if (!dmi_check_system(applesmc_whitelist)) {
-		printk(KERN_WARNING "applesmc: supported laptop not found!\n");
+		pr_warn("supported laptop not found!\n");
 		ret = -ENODEV;
 		goto out;
 	}
@@ -1659,15 +1658,13 @@
 	/* create fan files */
 	count = applesmc_get_fan_count();
 	if (count < 0)
-		printk(KERN_ERR "applesmc: Cannot get the number of fans.\n");
+		pr_err("Cannot get the number of fans\n");
 	else
-		printk(KERN_INFO "applesmc: %d fans found.\n", count);
+		pr_info("%d fans found\n", count);

 	if (count > 4) {
 		count = 4;
-		printk(KERN_WARNING "applesmc: More than 4 fans found,"
-		       " but at most 4 fans are supported"
-		       " by the driver.\n");
+		pr_warn("A maximum of 4 fans are supported by this driver\n");
 	}

 	while (fans_handled < count) {
@@ -1683,11 +1680,8 @@
 	     i++) {
 		if (temperature_attributes[i] == NULL ||
 		    label_attributes[i] == NULL) {
-			printk(KERN_ERR "applesmc: More temperature sensors "
-				"in temperature_sensors_sets (at least %i)"
-				"than available sysfs files in "
-				"temperature_attributes (%i), please report "
-				"this bug.\n", i, i-1);
+			pr_err("More temperature sensors in temperature_sensors_sets (at least %i) than available sysfs files in temperature_attributes (%i), please report this bug\n",
+			       i, i-1);
 			goto out_temperature;
 		}
 		ret = sysfs_create_file(&pdev->dev.kobj,
@@ -1731,7 +1725,7 @@
 		goto out_light_ledclass;
 	}

-	printk(KERN_INFO "applesmc: driver successfully loaded.\n");
+	pr_info("driver successfully loaded\n");

 	return 0;

@@ -1764,7 +1758,7 @@
 out_region:
 	release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
 out:
-	printk(KERN_WARNING "applesmc: driver init failed (ret=%d)!\n", ret);
+	pr_warn("driver init failed (ret=%d)!\n", ret);
 	return ret;
 }

@@ -1789,7 +1783,7 @@
 	platform_driver_unregister(&applesmc_driver);
 	release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);

-	printk(KERN_INFO "applesmc: driver unloaded.\n");
+	pr_info("driver unloaded\n");
 }

 module_init(applesmc_init);


pathbar: Fix gcc warning

pathbar: Fix gcc warning

--- gtk/gtkpathbar.c
+++ gtk/gtkpathbar.c
@@ -770,6 +770,8 @@
     case GDK_SCROLL_UP:
       gtk_path_bar_scroll_up (GTK_PATH_BAR (widget));
       break;
+    case GDK_SCROLL_SMOOTH:
+      break;
     }

   return TRUE;


tests/lstat.c: use libtests

tests/lstat.c: use libtests

* tests/lstat.c: Use SKIP_MAIN_UNDEFINED.

--- tests/lstat.c
+++ tests/lstat.c
@@ -1,10 +1,41 @@
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "tests.h"
 #include <sys/syscall.h>

-#undef TEST_SYSCALL_NAME
 #ifdef __NR_lstat
+
 # define TEST_SYSCALL_NAME lstat
 # define SAMPLE_SIZE ((kernel_ulong_t) 43147718418)
+# include "lstatx.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_lstat")
+
 #endif
-
-#include "lstatx.c"


lv_conf_templ.h minor updates

lv_conf_templ.h minor updates

--- lv_conf_templ.h
+++ lv_conf_templ.h
@@ -48,7 +48,7 @@
 #define LV_VDB2_ADR         0       /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate automatically into RAM; LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`)*/

 /* Enable anti-aliasing (lines, and radiuses will be smoothed) */
-#define LV_ANTIALIAS        (LV_VDB_SIZE != 0)       /*1: Enable anti-aliasing*/
+#define LV_ANTIALIAS        1       /*1: Enable anti-aliasing*/

 /*Screen refresh settings*/
 #define LV_REFR_PERIOD      50    /*Screen refresh period in milliseconds*/


Fixed a realloc bug in array

Fixed a realloc bug in array

--- array.h
+++ array.h
@@ -249,12 +249,19 @@
     }

     ~Array() {
-      free(ar);
+      if (ar) {
+        free(ar);
+      }
       ar = nullptr;
     }
     void resize(size_t new_size) {
       _length = new_size;
-      ar = (T*) realloc(ar, _length * sizeof(T));
+      if (new_size) {
+        ar = (T*) realloc(ar, _length * sizeof(T));
+      } else {
+        free(ar);
+        ar = nullptr;
+      }
     }
     size_t len() const {
       return _length;


applyLoop in stencil always overflows due to unrolling...

todo: prohibit unrolling

--- stencil.c
+++ stencil.c
@@ -89,6 +89,12 @@
     return COEFF1 * m[0] + COEFF2 * (m[-1] + m[1] + m[-xsize] + m[xsize]);
 }

+TYPE apply3(TYPE *m, int xsize, Stencil* s)
+{
+    return m[0];
+}
+
+
 typedef void (*apply_loop)(int, TYPE*, TYPE*, apply_func, Stencil*);

 void applyLoop(int size, TYPE* src, TYPE* dst, apply_func af, Stencil* s)
@@ -154,6 +160,10 @@
     case 3:
     case 6:
         af = apply2;
+        s = 0;
+        break;
+    case 7:
+        af = apply3;
         s = 0;
         break;
     }


scanf %m not supported by Mac OS X

scanf %m not supported by Mac OS X

--- src/misc/io.c
+++ src/misc/io.c
@@ -57,8 +57,6 @@
 	int delta;
 	bool ok = false;

-	char* keyword;
-
 	while (true) {

 		// skip lines not starting with '#'
@@ -74,7 +72,9 @@
 			pos += delta;
 		}

-		if (1 == sscanf(header + pos, "# %ms\n%n", &keyword, &delta)) {
+		char keyword[32];
+
+		if (1 == sscanf(header + pos, "# %31s\n%n", keyword, &delta)) {

 			pos += delta;

@@ -109,8 +109,6 @@

 				ok = true;
 			}
-
-			free(keyword);
 		}
 	}


hwmon: (w83627hf) Add pwm_enable sysfs interface

Adds support for pwm_enable sysfs interface for the w83627hf driver.

Signed-off-by: Dominik Geyer <c3dd414c967a4867bdee1d9a5b9bb93844394947@gmx.de>
Signed-off-by: Jean Delvare <49ad6a9f5aa17024c23048df346d55bda6837e01@linux-fr.org>

--- drivers/hwmon/w83627hf.c
+++ drivers/hwmon/w83627hf.c
@@ -209,6 +209,13 @@
 #define W83627HF_REG_PWM1 0x5A
 #define W83627HF_REG_PWM2 0x5B

+static const u8 W83627THF_REG_PWM_ENABLE[] = {
+	0x04,		/* FAN 1 mode */
+	0x04,		/* FAN 2 mode */
+	0x12,		/* FAN AUX mode */
+};
+static const u8 W83627THF_PWM_ENABLE_SHIFT[] = { 2, 4, 1 };
+
 #define W83627THF_REG_PWM1		0x01	/* 697HF/637HF/687THF too */
 #define W83627THF_REG_PWM2		0x03	/* 697HF/637HF/687THF too */
 #define W83627THF_REG_PWM3		0x11	/* 637HF/687THF too */
@@ -366,6 +373,9 @@
 	u32 alarms;		/* Register encoding, combined */
 	u32 beep_mask;		/* Register encoding, combined */
 	u8 pwm[3];		/* Register value */
+	u8 pwm_enable[3];	/* 1 = manual
+				   2 = thermal cruise (also called SmartFan I)
+				   3 = fan speed cruise */
 	u8 pwm_freq[3];		/* Register value */
 	u16 sens[3];		/* 1 = pentium diode; 2 = 3904 diode;
 				   4 = thermistor */
@@ -955,6 +965,42 @@
 static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO|S_IWUSR, show_pwm, store_pwm, 0);
 static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO|S_IWUSR, show_pwm, store_pwm, 1);
 static SENSOR_DEVICE_ATTR(pwm3, S_IRUGO|S_IWUSR, show_pwm, store_pwm, 2);
+
+static ssize_t
+show_pwm_enable(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	int nr = to_sensor_dev_attr(devattr)->index;
+	struct w83627hf_data *data = w83627hf_update_device(dev);
+	return sprintf(buf, "%d\n", data->pwm_enable[nr]);
+}
+
+static ssize_t
+store_pwm_enable(struct device *dev, struct device_attribute *devattr,
+	  const char *buf, size_t count)
+{
+	int nr = to_sensor_dev_attr(devattr)->index;
+	struct w83627hf_data *data = dev_get_drvdata(dev);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+	u8 reg;
+
+	if (!val || (val > 3))	/* modes 1, 2 and 3 are supported */
+		return -EINVAL;
+	mutex_lock(&data->update_lock);
+	data->pwm_enable[nr] = val;
+	reg = w83627hf_read_value(data, W83627THF_REG_PWM_ENABLE[nr]);
+	reg &= ~(0x03 << W83627THF_PWM_ENABLE_SHIFT[nr]);
+	reg |= (val - 1) << W83627THF_PWM_ENABLE_SHIFT[nr];
+	w83627hf_write_value(data, W83627THF_REG_PWM_ENABLE[nr], reg);
+	mutex_unlock(&data->update_lock);
+	return count;
+}
+
+static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR, show_pwm_enable,
+						  store_pwm_enable, 0);
+static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR, show_pwm_enable,
+						  store_pwm_enable, 1);
+static SENSOR_DEVICE_ATTR(pwm3_enable, S_IRUGO|S_IWUSR, show_pwm_enable,
+						  store_pwm_enable, 2);

 static ssize_t
 show_pwm_freq(struct device *dev, struct device_attribute *devattr, char *buf)
@@ -1223,6 +1269,11 @@
 	&sensor_dev_attr_pwm1_freq.dev_attr.attr,
 	&sensor_dev_attr_pwm2_freq.dev_attr.attr,
 	&sensor_dev_attr_pwm3_freq.dev_attr.attr,
+
+	&sensor_dev_attr_pwm1_enable.dev_attr.attr,
+	&sensor_dev_attr_pwm2_enable.dev_attr.attr,
+	&sensor_dev_attr_pwm3_enable.dev_attr.attr,
+
 	NULL
 };

@@ -1364,6 +1415,19 @@
 				&sensor_dev_attr_pwm2_freq.dev_attr))
 		 || (err = device_create_file(dev,
 				&sensor_dev_attr_pwm3_freq.dev_attr)))
+			goto ERROR4;
+
+	if (data->type != w83627hf)
+		if ((err = device_create_file(dev,
+				&sensor_dev_attr_pwm1_enable.dev_attr))
+		 || (err = device_create_file(dev,
+				&sensor_dev_attr_pwm2_enable.dev_attr)))
+			goto ERROR4;
+
+	if (data->type == w83627thf || data->type == w83637hf
+	 || data->type == w83687thf)
+		if ((err = device_create_file(dev,
+				&sensor_dev_attr_pwm3_enable.dev_attr)))
 			goto ERROR4;

 	data->hwmon_dev = hwmon_device_register(dev);
@@ -1655,6 +1719,7 @@
 {
 	struct w83627hf_data *data = dev_get_drvdata(dev);
 	int i, num_temps = (data->type == w83697hf) ? 2 : 3;
+	int num_pwms = (data->type == w83697hf) ? 2 : 3;

 	mutex_lock(&data->update_lock);

@@ -1707,6 +1772,15 @@
 					break;
 			}
 		}
+		if (data->type != w83627hf) {
+			for (i = 0; i < num_pwms; i++) {
+				u8 tmp = w83627hf_read_value(data,
+					W83627THF_REG_PWM_ENABLE[i]);
+				data->pwm_enable[i] =
+					((tmp >> W83627THF_PWM_ENABLE_SHIFT[i])
+					& 0x03) + 1;
+			}
+		}
 		for (i = 0; i < num_temps; i++) {
 			data->temp[i] = w83627hf_read_value(
 						data, w83627hf_reg_temp[i]);


popover: Fix documentation blurb

popover: Fix documentation blurb

The grabbing behavior is no longer exclusively controlled by the caller,
mention gtk_popover_set_modal().

--- gtk/gtkpopover.c
+++ gtk/gtkpopover.c
@@ -30,8 +30,14 @@
  * The position of a popover relative to the widget it is attached to
  * can also be changed through gtk_popover_set_position().
  *
- * By default, no grabs are performed on #GtkPopover<!-- -->s, if a
- * modal behavior is desired, a GTK+ grab can be added with gtk_grab_add()
+ * By default, #GtkPopover performs a GTK+ grab, in order to ensure
+ * input events get redirected to it while it is shown, and also so
+ * the popover is dismissed on the expected situations (clicks outside
+ * the popover, or the Esc key being pressed). If no such modal behavior
+ * is desired on a popover, gtk_popover_set_modal() may be called on it
+ * to tweak its behavior.
+ *
+ * Since: 3.12
  */

 #include "config.h"


Error check for too small VDB

Error check for too small VDB

--- lv_obj/lv_obj.h
+++ lv_obj/lv_obj.h
@@ -33,6 +33,14 @@

 #if LV_VDB_SIZE == 0 && LV_ANTIALIAS != 0
 #error "LV: If LV_VDB_SIZE == 0 the antialaissing must be disabled"
+#endif
+
+#if LV_VDB_SIZE != 0 && LV_VDB_SIZE < LV_HOR_RES && LV_ANTIALIAS == 0
+#error "LV: Small Virtual Display Buffer (lv_conf.h: LV_VDB_SIZE >= LV_HOR_RES)"
+#endif
+
+#if LV_VDB_SIZE != 0 && LV_VDB_SIZE < 2 *LV_HOR_RES && LV_ANTIALIAS != 0
+#error "LV: Small Virtual Display Buffer (lv_conf.h: LV_VDB_SIZE >= (2 * LV_HOR_RES))"
 #endif

 /*New defines*/