benchmark: Use defines for buf sizes

benchmark: Use defines for buf sizes

Signed-off-by: Ola Jeppsson <793f970c52ded1276b9264c742f19d1888cbaf73@adapteva.com>

--- benchmark/benchmark.c
+++ benchmark/benchmark.c
@@ -25,6 +25,13 @@

 typedef uint64_t platform_clock_t;

+/* Arrays */
+#define MAX_OUTPUTS 1 /* Points to same memory */
+#define MAX_INPUTS 3
+#define MAX_PARAMS (MAX_OUTPUTS + MAX_INPUTS)
+
+#define MAX_ELEMS 655360
+
 #if defined(HAVE_CLOCK_GETTIME)
 static platform_clock_t platform_clock(void)
 {
@@ -87,7 +94,7 @@

     struct p_bench_specification spec;
     char *raw_mem = NULL;
-    spec.current_size = default_initial_size;
+    spec.current_size = MAX_ELEMS;

     setup_memory(&spec.mem, &raw_mem, spec.current_size);
     printf(";name, size, duration (ns)\n");
@@ -152,9 +159,12 @@
     mem->i3_w.p_void = p;
     p += size * sizeof(uint64_t);

+#if 0
+    /* TODO: Do we really need 4 inputs? */
     setup_prandom_chars(p, size * sizeof(uint64_t), seed, false);
     mem->i4_w.p_void = p;
     p += size * sizeof(uint64_t);
+#endif
 }

 static void setup_memory(struct p_bench_raw_memory *mem, char **raw,
@@ -164,10 +174,9 @@
     assert(size > 0);
     assert(raw != NULL);

-    size_t raw_output_size = sizeof(uintmax_t) * size * max_output;
+    size_t raw_output_size = MAX_OUTPUTS * MAX_ELEMS * sizeof(uintmax_t);
     size_t raw_size =
-        raw_output_size +
-        (sizeof(float) + sizeof(double) + sizeof(uintmax_t)) * size * 2;
+        raw_output_size + MAX_INPUTS * MAX_ELEMS * (sizeof(uintmax_t));

     if (*raw == NULL) {
         *raw = malloc(raw_size);


Test ID attribute indexing

Test ID attribute indexing

--- expat/tests/runtests.c
+++ expat/tests/runtests.c
@@ -1479,6 +1479,7 @@
 typedef struct elementInfo {
     const char *name;
     int attr_count;
+    const char *id_name;
     AttrInfo *attributes;
 } ElementInfo;

@@ -1489,8 +1490,7 @@
 {
     ElementInfo *info = (ElementInfo *)userData;
     AttrInfo *attr;
-    int count;
-    int i;
+    int count, id, i;

     while (info->name != NULL) {
         if (!strcmp(name, info->name))
@@ -1503,6 +1503,15 @@
     count = XML_GetSpecifiedAttributeCount(parser);
     if (info->attr_count * 2 != count) {
         fail("Not got expected attribute count");
+        return;
+    }
+    id = XML_GetIdAttributeIndex(parser);
+    if (id == -1 && info->id_name != NULL) {
+        fail("ID not present");
+        return;
+    }
+    if (id != -1 && strcmp(atts[id], info->id_name)) {
+        fail("ID does not have the correct name");
         return;
     }
     for (i = 0; i < info->attr_count; i++) {
@@ -1526,20 +1535,28 @@

 START_TEST(test_attributes)
 {
-    const char *text = "<tag1 a='1' b='2'><tag2 c='3'/></tag1>";
-    AttrInfo tag1_info[] = {
-        { "a", "1" },
-        {"b", "2" },
+    const char *text =
+        "<!DOCTYPE doc [\n"
+        "<!ELEMENT doc (tag)>\n"
+        "<!ATTLIST doc id ID #REQUIRED>\n"
+        "]>"
+        "<doc a='1' id='one' b='2'>"
+        "<tag c='3'/>"
+        "</doc>";
+    AttrInfo doc_info[] = {
+        { "a",  "1" },
+        { "b",  "2" },
+        { "id", "one" },
         { NULL, NULL }
     };
-    AttrInfo tag2_info[] = {
-        { "c", "3" },
+    AttrInfo tag_info[] = {
+        { "c",  "3" },
         { NULL, NULL }
     };
     ElementInfo info[] = {
-        { "tag1", 2, tag1_info },
-        { "tag2", 1, tag2_info },
-        { NULL, 0, NULL }
+        { "doc", 3, "id", doc_info },
+        { "tag", 1, NULL, tag_info },
+        { NULL, 0, NULL, NULL }
     };

     XML_SetStartElementHandler(parser, counting_start_element_handler);


Extended the neat property struct to contain a value

--- neat_api.h
+++ neat_api.h
@@ -23,9 +23,26 @@
  * TODO: naming
  */

+enum neat_value_type {
+    TYPE_BOOL = 0,
+    TYPE_INT,
+    TYPE_FLOAT,
+    TYPE_STRING,
+};
+
+typedef enum neat_value_type neat_value_type;
+
 // A list of properties as requested by the application
 struct neat_prop_request {
     char* property;
+
+    union {
+        int int_value;
+        float float_value;
+        char* string_value;
+    } data;
+
+    neat_value_type type;

     LIST_ENTRY(neat_prop_request) property_list;
 };


change include header path for pods

change include header path for pods

--- QiniuSDK/QiniuSDK.h
+++ QiniuSDK/QiniuSDK.h
@@ -8,7 +8,8 @@

 #import <Foundation/Foundation.h>

-#import "Common/QNUrlSafeBase64.h"
-#import "Http/QNResponseInfo.h"
-#import "Storage/QNUploadOption.h"
-#import "Storage/QNUploadManager.h"
+#import "QNUrlSafeBase64.h"
+#import "QNResponseInfo.h"
+#import "QNUploadOption.h"
+#import "QNUploadManager.h"
+#import "QNFileRecorder.h"


git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5714 35acf78f-673a-0410-8e92-d51de3d6d3f4

--- boards/NONSTANDARD_STM32F4_BARTHESS1/board.c
+++ boards/NONSTANDARD_STM32F4_BARTHESS1/board.c
@@ -53,6 +53,7 @@
 void boardInit(void) {
 }

+#if HAL_USE_SDC
 /**
  * @brief   Insertion monitor function.
  *
@@ -79,3 +80,4 @@
   (void)sdcp;
   return FALSE;
 }
+#endif /* HAL_USE_SDC */


SimpleRenderable::setMaterial virtual.

SimpleRenderable::setMaterial virtual.

--- OgreMain/include/OgreSimpleRenderable.h
+++ OgreMain/include/OgreSimpleRenderable.h
@@ -73,7 +73,7 @@
         /// Named constructor
         SimpleRenderable(const String& name);

-        void setMaterial( const String& matName );
+        virtual void setMaterial( const String& matName );
         virtual const MaterialPtr& getMaterial(void) const;

         virtual void setRenderOperation( const RenderOperation& rend );


optimize symbols as keys

optimize symbols as keys

--- ext/bson/bson_native.c
+++ ext/bson/bson_native.c
@@ -285,6 +285,9 @@
     case T_STRING:
       bson_byte_buffer_put_bson_key(b, key, validating_keys);
       break;
+    case T_SYMBOL:
+      bson_byte_buffer_put_bson_key(b, rb_sym_to_s(key), validating_keys);
+      break;
     default:
       rb_bson_byte_buffer_put_cstring(buffer, rb_funcall(key, rb_intern("to_bson_key"),1,validating_keys));
   }


Some instantiate() routines require nonzero sample rate. ladspa_mbeq (the multi-band eq) is one of these.

Original commit message from CVS:
Some instantiate() routines require nonzero sample rate. ladspa_mbeq (the
multi-band eq) is one of these.

--- ext/ladspa/gstladspa.c
+++ ext/ladspa/gstladspa.c
@@ -429,10 +429,11 @@
     }
   }

-  ladspa->samplerate = 0;
+  /* nonzero default needed to instantiate() some plugins */
+  ladspa->samplerate = 44100;
+
   ladspa->buffersize = 64;
   ladspa->numbuffers = 16;
-  ladspa->newcaps = FALSE;
   ladspa->activated = FALSE;
   ladspa->bufpool = NULL;
   ladspa->inplace_broken = LADSPA_IS_INPLACE_BROKEN(ladspa->descriptor->Properties);
@@ -441,13 +442,8 @@
     /* get mode (no sink pads) */
     GST_DEBUG (0, "mono get mode with 1 src pad");

-    ladspa->newcaps = TRUE;
-    ladspa->samplerate = 44100;
-    ladspa->buffersize = 64;
-
     gst_pad_set_connect_function (ladspa->srcpads[0], gst_ladspa_connect_get);
     gst_pad_set_get_function (ladspa->srcpads[0], gst_ladspa_get);
-
   } else if (sinkcount==1){
     /* with one sink we can use the chain function */
     GST_DEBUG (0, "chain mode");
@@ -471,7 +467,7 @@
     g_warning("%d sink pads, %d src pads not yet supported", sinkcount, srccount);
   }

-  gst_ladspa_instantiate(ladspa);
+  gst_ladspa_instantiate (ladspa);
 }

 static void
@@ -569,6 +565,7 @@
     case ARG_SAMPLERATE:
       ladspa->samplerate = g_value_get_int (value);
       ladspa->newcaps=TRUE;
+      gst_ladspa_instantiate (ladspa);
       break;
     case ARG_BUFFERSIZE:
       ladspa->buffersize = g_value_get_int (value);


Fix up a possible memory leak in open_auth.

The leak could occur if an invalid type was passed
in for flags.

Signed-off-by: Chris Lalancette <60b62644009db6b194cc0445b64e9b27bb26433a@redhat.com>

--- ext/libvirt/_libvirt.c
+++ ext/libvirt/_libvirt.c
@@ -225,7 +225,7 @@
 {
     VALUE uri;
     VALUE cb;
-    VALUE flags;
+    VALUE flags_val;
     char *uri_c;
     virConnectPtr conn;
     virConnectAuthPtr auth;
@@ -234,11 +234,18 @@
     int auth_alloc;
     VALUE tmp;
     int exception = 0;
-
-    rb_scan_args(argc, argv, "03", &uri, &cb, &flags);
+    unsigned int flags;
+
+    rb_scan_args(argc, argv, "03", &uri, &cb, &flags_val);

     /* handle the optional URI */
     uri_c = get_string_or_nil(uri);
+
+    /* handle the optional flags */
+    if (NIL_P(flags_val))
+        flags = 0;
+    else
+        flags = NUM2UINT(flags_val);

     /* handle the optional auth */
     if (!NIL_P(cb)) {
@@ -306,11 +313,7 @@
         auth_alloc = 0;
     }

-    /* handle the optional flags */
-    if (NIL_P(flags))
-        flags = INT2FIX(0);
-
-    conn = virConnectOpenAuth(uri_c, auth, NUM2INT(flags));
+    conn = virConnectOpenAuth(uri_c, auth, flags);

     if (auth_alloc) {
         free(auth->credtype);


Document Client connection specific functions

--- ext/mosquitto/client.c
+++ ext/mosquitto/client.c
@@ -856,6 +856,22 @@
     return (void *)mosquitto_connect(args->mosq, args->host, args->port, args->keepalive);
 }

+/*
+ * call-seq:
+ *   client.connect("localhost", 1883, 10) -> Boolean
+ *
+ * Connect to an MQTT broker.
+ *
+ * @param host [String] the hostname or ip address of the broker to connect to.
+ * @param port [Integer] the network port to connect to. Usually 1883 (or 8883 for TLS)
+ * @param keepalive [Integer] the number of seconds after which the broker should send a PING message
+ *                            to the client if no other messages have been exchanged in that time.
+ * @return [true] on success
+ * @raise [Mosquitto::Error, SystemCallError] on invalid input params or system call errors
+ * @example
+ *   client.connect("localhost", 1883, 10) -> Boolean
+ *
+ */
 static VALUE rb_mosquitto_client_connect(VALUE obj, VALUE host, VALUE port, VALUE keepalive)
 {
     struct nogvl_connect_args args;
@@ -887,6 +903,24 @@
     return (void *)mosquitto_connect_bind(args->mosq, args->host, args->port, args->keepalive, args->bind_address);
 }

+/*
+ * call-seq:
+ *   client.connect_bind("localhost", 1883, 10, "10.0.0.3") -> Boolean
+ *
+ * Connect to an MQTT broker. This extends the functionality of Mosquitto::Client#connect by adding the bind_address
+ * parameter. Use this function if you need to restrict network communication over a particular interface.
+ *
+ * @param host [String] the hostname or ip address of the broker to connect to.
+ * @param port [Integer] the network port to connect to. Usually 1883 (or 8883 for TLS)
+ * @param keepalive [Integer] the number of seconds after which the broker should send a PING message
+ *                            to the client if no other messages have been exchanged in that time.
+ * @param bind_address [String] the hostname or ip address of the local network interface to bind to
+ * @return [true] on success
+ * @raise [Mosquitto::Error, SystemCallError] on invalid input params or system call errors
+ * @example
+ *   client.connect_bind("localhost", 1883, 10, "10.0.0.3") -> Boolean
+ *
+ */
 static VALUE rb_mosquitto_client_connect_bind(VALUE obj, VALUE host, VALUE port, VALUE keepalive, VALUE bind_address)
 {
     struct nogvl_connect_args args;
@@ -920,6 +954,25 @@
     return mosquitto_connect_async(args->mosq, args->host, args->port, args->keepalive);
 }

+/*
+ * call-seq:
+ *   client.connect_async("localhost", 1883, 10) -> Boolean
+ *
+ * Connect to an MQTT broker. This is a non-blocking call. If you use
+ * Mosquitto::Client#connect_async your client must use the threaded interface
+ * Mosquitto::Client#loop_start. If you need to use Mosquitto::Client#loop, you must use
+ * Mosquitto::Client#connect to connect the client.
+ *
+ * @param host [String] the hostname or ip address of the broker to connect to.
+ * @param port [Integer] the network port to connect to. Usually 1883 (or 8883 for TLS)
+ * @param keepalive [Integer] the number of seconds after which the broker should send a PING message
+ *                            to the client if no other messages have been exchanged in that time.
+ * @return [true] on success
+ * @raise [Mosquitto::Error, SystemCallError] on invalid input params or system call errors
+ * @example
+ *   client.connect_async("localhost", 1883, 10) -> Boolean
+ *
+ */
 static VALUE rb_mosquitto_client_connect_async(VALUE obj, VALUE host, VALUE port, VALUE keepalive)
 {
     struct nogvl_connect_args args;
@@ -951,6 +1004,30 @@
     return mosquitto_connect_bind_async(args->mosq, args->host, args->port, args->keepalive, args->bind_address);
 }

+/*
+ * call-seq:
+ *   client.connect_bind_async("localhost", 1883, 10, "10.0.0.3") -> Boolean
+ *
+ * Connect to an MQTT broker. This is a non-blocking call. If you use
+ * Mosquitto::Client#connect_async your client must use the threaded interface
+ * Mosquitto::Client#loop_start. If you need to use Mosquitto::Client#loop, you must use
+ * Mosquitto::Client#connect to connect the client.
+ *
+ * This extends the functionality of Mosquitto::Client#connect_async by adding the
+ * bind_address parameter. Use this function if you need to restrict network
+ * communication over a particular interface.
+ *
+ * @param host [String] the hostname or ip address of the broker to connect to.
+ * @param port [Integer] the network port to connect to. Usually 1883 (or 8883 for TLS)
+ * @param keepalive [Integer] the number of seconds after which the broker should send a PING message
+ *                            to the client if no other messages have been exchanged in that time.
+ * @param bind_address [String] the hostname or ip address of the local network interface to bind to
+ * @return [true] on success
+ * @raise [Mosquitto::Error, SystemCallError] on invalid input params or system call errors
+ * @example
+ *   client.connect_bind_async("localhost", 1883, 10, "10.0.0.3") -> Boolean
+ *
+ */
 static VALUE rb_mosquitto_client_connect_bind_async(VALUE obj, VALUE host, VALUE port, VALUE keepalive, VALUE bind_address)
 {
     struct nogvl_connect_args args;
@@ -983,6 +1060,22 @@
     return mosquitto_reconnect((struct mosquitto *)ptr);
 }

+/*
+ * call-seq:
+ *   client.reconnect -> Boolean
+ *
+ * Reconnect to a broker.
+ *
+ * This function provides an easy way of reconnecting to a broker after a connection has been lost.
+ * It uses the values that were provided in the Mosquitto::Client#connect call.
+ *
+ * @return [true] on success
+ * @note It must not be called before Mosquitto::Client#connect
+ * @raise [Mosquitto::Error, SystemCallError] on invalid input params or system call errors
+ * @example
+ *   client.reconnect
+ *
+ */
 static VALUE rb_mosquitto_client_reconnect(VALUE obj)
 {
     int ret;
@@ -1005,6 +1098,18 @@
     return (VALUE)mosquitto_disconnect((struct mosquitto *)ptr);
 }

+/*
+ * call-seq:
+ *   client.disconnect-> Boolean
+ *
+ * Disconnect from the broker.
+ *
+ * @return [true] on success
+ * @raise [Mosquitto::Error, SystemCallError] on invalid input params or if the client is not connected
+ * @example
+ *   client.disconnect
+ *
+ */
 static VALUE rb_mosquitto_client_disconnect(VALUE obj)
 {
     int ret;


shout2send: accept audio/webm as well as video/webm

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

--- ext/shout2/gstshout2.c
+++ ext/shout2/gstshout2.c
@@ -70,7 +70,7 @@
 #define DEFAULT_PROTOCOL     SHOUT2SEND_PROTOCOL_HTTP

 #ifdef SHOUT_FORMAT_WEBM
-#define WEBM_CAPS "; video/webm"
+#define WEBM_CAPS "; video/webm; audio/webm"
 #else
 #define WEBM_CAPS ""
 #endif


Update drv_rtc.c

Update drv_rtc.c

将rt_int32_t改为time_t。

--- bsp/bluetrum/libraries/hal_drivers/drv_rtc.c
+++ bsp/bluetrum/libraries/hal_drivers/drv_rtc.c
@@ -189,27 +189,27 @@
     switch (cmd)
     {
     case RT_DEVICE_CTRL_RTC_GET_TIME:
-        *(rt_uint32_t *)args = get_rtc_time_stamp();
-        LOG_D("RTC: get rtc_time %x", *(rt_uint32_t *)args);
+        *(time_t *)args = get_rtc_time_stamp();
+        LOG_D("RTC: get rtc_time %x", *(time_t *)args);
         break;

     case RT_DEVICE_CTRL_RTC_SET_TIME:
-        if (set_rtc_time_stamp(*(rt_uint32_t *)args))
+        if (set_rtc_time_stamp(*(time_t *)args))
         {
             result = -RT_ERROR;
         }
-        LOG_D("RTC: set rtc_time %x", *(rt_uint32_t *)args);
+        LOG_D("RTC: set rtc_time %x", *(time_t *)args);
         break;
     case RT_DEVICE_CTRL_RTC_SET_ALARM:
-        if (set_rtc_alarm_stamp(*(rt_uint32_t *)args))
+        if (set_rtc_alarm_stamp(*(time_t *)args))
         {
             result = -RT_ERROR;
         }
-        LOG_D("RTC: set alarm_stamp %x", *(rt_uint32_t *)args);
+        LOG_D("RTC: set alarm_stamp %x", *(time_t *)args);
         break;
     case RT_DEVICE_CTRL_RTC_GET_ALARM:
-        *(rt_uint32_t *)args = get_rtc_alarm_stamp();
-        LOG_D("RTC: get alarm_stamp %x", *(rt_uint32_t *)args);
+        *(time_t *)args = get_rtc_alarm_stamp();
+        LOG_D("RTC: get alarm_stamp %x", *(time_t *)args);
         break;
     }


Remove debug #ifdef in USB HC init

Remove debug #ifdef in USB HC init

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@10431 6f19259b-4bc3-4df7-8a09-765794883524

--- Omap35xxPkg/PciEmulation/PciEmulation.c
+++ Omap35xxPkg/PciEmulation/PciEmulation.c
@@ -62,14 +62,13 @@
   EFI_STATUS Status;
   UINT8      Data = 0;

-#if 0
    // Take USB host out of force-standby mode
- MmioWrite32 (UHH_SYSCONFIG, UHH_SYSCONFIG_MIDLEMODE_NO_STANDBY
+  MmioWrite32 (UHH_SYSCONFIG, UHH_SYSCONFIG_MIDLEMODE_NO_STANDBY
                             | UHH_SYSCONFIG_CLOCKACTIVITY_ON
                             | UHH_SYSCONFIG_SIDLEMODE_NO_STANDBY
                             | UHH_SYSCONFIG_ENAWAKEUP_ENABLE
                             | UHH_SYSCONFIG_AUTOIDLE_ALWAYS_RUN);
- MmioWrite32 (UHH_HOSTCONFIG, UHH_HOSTCONFIG_P3_CONNECT_STATUS_DISCONNECT
+  MmioWrite32 (UHH_HOSTCONFIG, UHH_HOSTCONFIG_P3_CONNECT_STATUS_DISCONNECT
                              | UHH_HOSTCONFIG_P2_CONNECT_STATUS_DISCONNECT
                              | UHH_HOSTCONFIG_P1_CONNECT_STATUS_DISCONNECT
                              | UHH_HOSTCONFIG_ENA_INCR_ALIGN_DISABLE
@@ -79,24 +78,10 @@
                              | UHH_HOSTCONFIG_AUTOPPD_ON_OVERCUR_EN_ON
                              | UHH_HOSTCONFIG_P1_ULPI_BYPASS_ULPI_MODE);

- // USB reset (GPIO 147 - Port 5 pin 19) output high
- MmioAnd32(GPIO5_BASE + GPIO_OE, ~BIT19);
- MmioWrite32 (GPIO5_BASE + GPIO_SETDATAOUT, BIT19);
-
- // Get the Power IC protocol.
- Status = gBS->LocateProtocol(&gEmbeddedExternalDeviceProtocolGuid, NULL, (VOID **)&gTPS65950);
- ASSERT_EFI_ERROR(Status);
-
- //Enable power to the USB host.
- Status = gTPS65950->Read(gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);
- ASSERT_EFI_ERROR(Status);
-
- //LEDAON & LEDAPWM control the power to the USB host so enable those bits.
- Data |= (LEDAON | LEDAPWM);
-
- Status = gTPS65950->Write(gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);
- ASSERT_EFI_ERROR(Status);
-#else
+  // USB reset (GPIO 147 - Port 5 pin 19) output high
+  MmioAnd32(GPIO5_BASE + GPIO_OE, ~BIT19);
+  MmioWrite32 (GPIO5_BASE + GPIO_SETDATAOUT, BIT19);
+
   // Get the Power IC protocol.
   Status = gBS->LocateProtocol(&gEmbeddedExternalDeviceProtocolGuid, NULL, (VOID **)&gTPS65950);
   ASSERT_EFI_ERROR(Status);
@@ -110,43 +95,8 @@

   Status = gTPS65950->Write(gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);
   ASSERT_EFI_ERROR(Status);
-
-  // USB reset (GPIO 147 - Port 5 pin 19) output low
-  MmioAnd32 (GPIO5_BASE + GPIO_OE, ~BIT19);
-  MmioWrite32 (GPIO5_BASE + GPIO_CLEARDATAOUT, BIT19);
-
-  // Turn on functional & interface clocks to the USBHOST power domain
-  MmioOr32 (CM_FCLKEN_USBHOST, CM_FCLKEN_USBHOST_EN_USBHOST2_ENABLE | CM_FCLKEN_USBHOST_EN_USBHOST1_ENABLE);
-  MmioOr32 (CM_ICLKEN_USBHOST, CM_ICLKEN_USBHOST_EN_USBHOST_ENABLE);
-  // Wait for clock to become active
-  while (0 == (MmioRead32 (CM_CLKSTST_USBHOST) & 1));
-
-
-
-  // Take USB host out of force-standby mode
-  MmioWrite32 (UHH_SYSCONFIG,  UHH_SYSCONFIG_MIDLEMODE_NO_STANDBY
-                             | UHH_SYSCONFIG_CLOCKACTIVITY_ON
-                             | UHH_SYSCONFIG_ENAWAKEUP_ENABLE
-                             | UHH_SYSCONFIG_SOFTRESET
-                             );
-   while ((MmioRead32 (UHH_SYSSTATUS) & UHH_SYSSTATUS_RESETDONE) != UHH_SYSSTATUS_RESETDONE);
-
-  MmioWrite32 (UHH_SYSCONFIG,  UHH_SYSCONFIG_CLOCKACTIVITY_ON
-                             | UHH_SYSCONFIG_SIDLEMODE_NO_STANDBY
-                             | UHH_SYSCONFIG_ENAWAKEUP_ENABLE
-                             );
-
-
-  MmioWrite32 (UHH_HOSTCONFIG,  UHH_HOSTCONFIG_ENA_INCR16_ENABLE
-                              | UHH_HOSTCONFIG_ENA_INCR8_ENABLE
-                              | UHH_HOSTCONFIG_ENA_INCR4_ENABLE
-                              );
-
-  // USB reset output high
-  MmioWrite32 (GPIO5_BASE + GPIO_SETDATAOUT, BIT19);
-
-#endif
-}
+}
+

 EFI_STATUS
 PciIoPollMem (


Add an attempt at Windows LFS compatibility with MSVC7 (untested).

git-svn-id: cb1f56016b938a9eb977ee3833dcaa0292d8bc39@471329 13f79535-47bb-0310-9956-ffa450edef68

--- charmonize.c
+++ charmonize.c
@@ -13,6 +13,8 @@
 #include "Charmonizer/Probe/LargeFiles.h"
 #include "Charmonizer/Probe/UnusedVars.h"
 #include "Charmonizer/Probe/VariadicMacros.h"
+
+char *cc_command, *cc_flags, *os_name, *verbosity_str;

 /* Process command line args, set up Charmonizer, etc.
  */
@@ -31,6 +33,11 @@
 extract_delim_and_verify(char *source, size_t source_len,
                          const char *tag_name);

+/* Write some stuff to the end of charmony.h
+ */
+static void
+write_charmony_postamble(void);
+
 /* Print a message to stderr and exit.
  */
 void
@@ -48,8 +55,15 @@
     chaz_UnusedVars_run();
     chaz_VariadicMacros_run();

+    /* write custom postamble */
+    write_charmony_postamble();
+
     /* clean up */
     chaz_Probe_clean_up();
+    free(cc_command);
+    free(cc_flags);
+    free(os_name);
+    free(verbosity_str);

     return 0;
 }
@@ -57,7 +71,6 @@
 void
 init(int argc, char **argv)
 {
-    char *cc_command, *cc_flags, *os_name, *verbosity_str;
     char *infile_str;
     size_t infile_len;

@@ -83,10 +96,6 @@

     /* clean up */
     free(infile_str);
-    free(cc_command);
-    free(cc_flags);
-    free(os_name);
-    free(verbosity_str);
 }

 static char*
@@ -138,6 +147,20 @@
     return retval;
 }

+static void
+write_charmony_postamble(void)
+{
+    FILE *charmony_fh = chaz_Probe_get_charmony_fh();
+
+    if (strcmp(os_name, "mswin32") == 0) {
+        fprintf(charmony_fh,
+            "#ifndef LUCY_HAS_LARGE_FILE_SUPPORT\n"
+            "  #include \"win32lfs.h\"\n"
+            "#endif /* LUCY_HAS_LARGE_FILE_SUPPORT */\n"
+        );
+    }
+}
+
 void
 die(char* format, ...)
 {


Fix GDAL1 build issue

Fix GDAL1 build issue

--- ogr_fdw_common.c
+++ ogr_fdw_common.c
@@ -182,8 +182,11 @@
 			CPLError(CE_Failure, CPLE_AssertionFailed, "Cannot handle OGR geometry type '%d'", gtype);
 	}

+#if GDAL_VERSION_MAJOR >= 2
 	if ( wkbHasZ(gtype) )
 		stringbuffer_append(buf, "Z");
+#endif
+
 #if GDAL_VERSION_MAJOR >= 2 && GDAL_VERSION_MINOR >= 1
 	if ( wkbHasM(gtype) )
 		stringbuffer_append(buf, "M");


ovirt-disk: Fix content type property name

Instead of using underscore, which is not accepted, make use of a dash,
avoiding error messages like the following:

GLib-CRITICAL **: g_param_spec_internal: assertion '!(flags & G_PARAM_STATIC_NAME) || is_canonical (name)' failed

Signed-off-by: Eduardo Lima (Etrunko) <025eb0974a9f48eaca88b86d8c2bcaf361e95a91@redhat.com>

--- govirt/ovirt-disk.c
+++ govirt/ovirt-disk.c
@@ -77,7 +77,7 @@
     gboolean parsed_ok;
     OvirtResourceClass *parent_class;
     OvirtXmlElement disk_elements[] = {
-        { .prop_name = "content_type",
+        { .prop_name = "content-type",
           .xml_path = "content_type",
         },
         { NULL , }
@@ -103,7 +103,7 @@
     object_class->get_property = ovirt_disk_get_property;
     object_class->set_property = ovirt_disk_set_property;

-    param_spec = g_param_spec_enum("type",
+    param_spec = g_param_spec_enum("content-type",
                                    "Content Type",
                                    "The actual content residing on the disk",
                                    OVIRT_TYPE_DISK_CONTENT_TYPE,


TARGET_OS_IPHONE may be defined to 0

TARGET_OS_IPHONE may be defined to 0

--- Source/GDataDefines.h
+++ Source/GDataDefines.h
@@ -131,7 +131,7 @@
 // reliance on NSEnumerator for 10.4
 //
 #ifndef GDATA_FOREACH
-  #if defined(TARGET_OS_IPHONE) || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+  #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
     #define GDATA_FOREACH(element, collection) \
       for (element in collection)
     #define GDATA_FOREACH_KEY(key, dict) \


Autocomplete : upper-case accented caracters added in the function strip_accents.

--- source/autocomplete/autocomplete.h
+++ source/autocomplete/autocomplete.h
@@ -435,16 +435,26 @@
     std::string strip_accents(std::string str) const {
         std::vector< std::pair<std::string, std::string> > vec_str;
         vec_str.push_back(std::make_pair("à","a"));
+        vec_str.push_back(std::make_pair("À","a"));
         vec_str.push_back(std::make_pair("â","a"));
+        vec_str.push_back(std::make_pair("Â","a"));
         vec_str.push_back(std::make_pair("æ","ae"));
         vec_str.push_back(std::make_pair("é","e"));
+        vec_str.push_back(std::make_pair("É","e"));
         vec_str.push_back(std::make_pair("è","e"));
+        vec_str.push_back(std::make_pair("È","e"));
         vec_str.push_back(std::make_pair("ê","e"));
+        vec_str.push_back(std::make_pair("Ê","e"));
         vec_str.push_back(std::make_pair("ô","o"));
+        vec_str.push_back(std::make_pair("Ô","o"));
         vec_str.push_back(std::make_pair("û","u"));
+        vec_str.push_back(std::make_pair("Û","u"));
         vec_str.push_back(std::make_pair("ù","u"));
+        vec_str.push_back(std::make_pair("Ù","u"));
         vec_str.push_back(std::make_pair("ç","c"));
+        vec_str.push_back(std::make_pair("Ç","c"));
         vec_str.push_back(std::make_pair("ï","i"));
+        vec_str.push_back(std::make_pair("Ï","i"));
         vec_str.push_back(std::make_pair("œ","oe"));

         auto vec = vec_str.begin();


Write decoded and converted video frames to output buffer

--- Aurio/Aurio.FFmpeg.Proxy32/proxy.c
+++ Aurio/Aurio.FFmpeg.Proxy32/proxy.c
@@ -927,7 +927,13 @@

 static int convert_video_frame(ProxyInstance *pi) {
 	/* convert frame to target format */
-	int ret = sws_scale(pi->sws, pi->frame->data, pi->frame->linesize, 0, pi->video_codec_ctx->height, pi->video_picture.data, pi->video_picture.linesize);
+	/* Instead of writing the converted image into the AVPicture and then transferring it to the output
+	 * buffer, it gets directly written into the output buffer to save the memory transfer. The additional
+	 * variable is required because sws_scale expects an array of buffers, with the first buffer allocated.
+	 * The AVPicture could actually be completely omitted by passing an array  int linesize[1] = { rgbstride },
+	 * with e.g. rgbstride = 960 for a 320px wide picture. */
+	uint8_t *output_buffer_workaround = pi->output_buffer;
+	int ret = sws_scale(pi->sws, pi->frame->data, pi->frame->linesize, 0, pi->video_codec_ctx->height, &output_buffer_workaround, pi->video_picture.linesize);
 	if (ret < 0) {
 		fprintf(stderr, "Could not convert frame\n");
 	}
@@ -938,7 +944,7 @@

 		for (int y = 0; y < pi->video_codec_ctx->height; y += pi->video_codec_ctx->height / 20) {
 			for (int x = 0; x < pi->video_codec_ctx->width; x += pi->video_codec_ctx->width / 64) {
-				printf("%c", QUANT_STEPS[(pi->video_picture.data[0][y * pi->video_picture.linesize[0] + x * 3 /* blue channel */]) / 40]);
+				printf("%c", QUANT_STEPS[(pi->output_buffer[y * pi->video_picture.linesize[0] + x * 3 /* blue channel */]) / 40]);
 			}
 			printf("\n");
 		}


Removed inline from sel4_flush_cache in hardware dataport template

--- camkes/templates/seL4HardwareMMIO.template.c
+++ camkes/templates/seL4HardwareMMIO.template.c
@@ -126,7 +126,7 @@
     };

     /*- if arch == 'arm' -*/
-    static inline int sel4_flush_cache(seL4_CPtr frame_cap, seL4_Word start, seL4_Word end) {
+    static int sel4_flush_cache(seL4_CPtr frame_cap, seL4_Word start, seL4_Word end) {
         return seL4_ARM_Page_Clean_Data(frame_cap, start, end);
     }
     /*- endif -*/


[DEVMINOR] Add error lock if mutex unlock fail.

--- Sources/ARSAL_Mutex.c
+++ Sources/ARSAL_Mutex.c
@@ -8,12 +8,19 @@
 #include <config.h>
 #include <libARSAL/ARSAL_Mutex.h>
 #include <libARSAL/ARSAL_Time.h>
+#include <libARSAL/ARSAL_Print.h>
+#include <sys/syscall.h>

 #if defined(HAVE_PTHREAD_H)
 #include <pthread.h>
 #else
 #error The pthread.h header is required in order to build the library
 #endif
+
+/**
+ * Tag for ARSAL_PRINT
+ */
+#define ARSAL_MUTEX_TAG "ARSAL_Mutex"

 int ARSAL_Mutex_Init(ARSAL_Mutex_t *mutex)
 {
@@ -68,6 +75,13 @@

 #if defined(HAVE_PTHREAD_H)
     result = pthread_mutex_unlock((pthread_mutex_t *)*mutex);
+    if (result != 0)
+    {
+        ARSAL_PRINT(ARSAL_PRINT_FATAL, ARSAL_MUTEX_TAG, "Mutex operation failed! errno = %d , %s ; thread_id = %d",
+                result,
+                strerror(result),
+                syscall(SYS_gettid));
+    }
 #endif

     return result;


Use LoadLibrary to force a dependency on opengl32.dll to stop it getting unloaded in certain circumstances.
https://tracker.physiomeproject.org/show_bug.cgi?id=2080

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@6689 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/graphics/graphics_library.c
+++ source/graphics/graphics_library.c
@@ -116,6 +116,14 @@
 #if defined (OPENGL_API)
 		glMatrixMode(GL_MODELVIEW);

+#if defined (WIN32_SYSTEM)
+		//Ensure we have a reference count for this dll
+		HMODULE dll = LoadLibrary("opengl32.dll");
+		if (!dll)
+		{
+			display_message(ERROR_MESSAGE, "Failed to get reference to opengl32.dll");
+		}
+#endif // defined (WIN32_SYSTEM)
 #if defined(GLX_ARB_get_proc_address)
 #if defined (MOTIF_USER_INTERFACE)
 		/* Try and load this function while we have the user_interface connection */


osl_createThreadKeyData with callback function paramater

--- sal/inc/osl/thread.h
+++ sal/inc/osl/thread.h
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: thread.h,v $
  *
- *  $Revision: 1.1.1.1 $
- *
- *  last change: $Author: hr $ $Date: 2000-09-18 15:17:13 $
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: hro $ $Date: 2000-09-29 10:54:37 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -223,8 +223,12 @@
 */
 void SAL_CALL osl_yieldThread(void);

+/* Callback when data stored in a thread key is no longer needed */
+
+typedef void (SAL_CALL *oslThreadKeyCallbackFunction)(void *);
+
 /** Create a key to an associated thread local storage pointer. */
-oslThreadKey SAL_CALL osl_createThreadKey(void);
+oslThreadKey SAL_CALL osl_createThreadKey(oslThreadKeyCallbackFunction pCallback);

 /** Destroy a key to an associated thread local storage pointer. */
 void SAL_CALL osl_destroyThreadKey(oslThreadKey Key);
@@ -252,6 +256,9 @@
 /*************************************************************************
 *
 *    $Log: not supported by cvs2svn $
+*    Revision 1.1.1.1  2000/09/18 15:17:13  hr
+*    initial import
+*
 *    Revision 1.9  2000/09/18 14:28:49  willem.vandorp
 *    OpenOffice header added.
 *


extmod/modussl_axtls: socket_read: Handle EAGAIN.

If SSL_EAGAIN is returned (which is a feature of MicroPython's axTLS fork),
return EAGAIN.

Original axTLS returns SSL_OK both when there's no data to return to user
yet and when the underlying stream returns EAGAIN. That's not distinctive
enough, for example, original module code works well for blocking stream,
but will infinite-loop for non-blocking socket with EAGAIN. But if we fix
non-blocking case, blocking calls to .read() will return few None's initially
(while axTLS progresses thru handshake).

Using SSL_EAGAIN allows to fix non-blocking case without regressing the
blocking one.

Note that this only handles case of non-blocking reads of application data.
Initial handshake and writes still don't support non-blocking mode and must
be done in the blocking way.

--- extmod/modussl_axtls.c
+++ extmod/modussl_axtls.c
@@ -121,6 +121,9 @@
                 // EOF
                 return 0;
             }
+            if (r == SSL_EAGAIN) {
+                r = MP_EAGAIN;
+            }
             *errcode = r;
             return MP_STREAM_ERROR;
         }


MOD: Adding default operator to Vector2

MOD: Adding default operator to Vector2

--- cegui/include/CEGUI/Vector.h
+++ cegui/include/CEGUI/Vector.h
@@ -140,6 +140,14 @@
         return Vector2(d_x / c, d_y / c);
     }

+    inline Vector2 operator/=(const T c)
+    {
+        d_x /= c;
+        d_y /= c;
+
+        return *this;
+    }
+
     inline bool operator==(const Vector2& vec) const
     {
         return ((d_x == vec.d_x) && (d_y == vec.d_y));


gateplus: setting default values for variables.

--- source/nw.gateplus~/nw.gateplus~.c
+++ source/nw.gateplus~/nw.gateplus~.c
@@ -16,7 +16,7 @@
 #include "z_dsp.h"		// required for all MSP external objects
 #include <string.h>

-//#define DEBUG			//enable debugging messages
+#define DEBUG			//enable debugging messages

 #define OBJECT_NAME		"nw.gateplus~"		// name of the object

@@ -88,6 +88,13 @@
     dsp_setup((t_pxobject *)x, 2);					// two inlets
     outlet_new((t_pxobject *)x, "signal");			// one outlet

+    /* setup variables */
+    x->last_ctrl_in = 0.0;
+    x->last_sig_in = 0.0;
+
+    /* set flags to defaults */
+    x->gate_stage = GATE_CLOSED;
+
     x->x_obj.z_misc = Z_NO_INPLACE;

     #ifdef DEBUG


Properly initialize the maze memory.

Properly initialize the maze memory.

--- maze/maze.c
+++ maze/maze.c
@@ -22,8 +22,8 @@
 	m->width = width;
 	m->height = height;
 	m->region_counter = 0;
-	m->a = reallocarray(NULL, width*height, sizeof(enum cell));
-	m->r = reallocarray(NULL, width*height, sizeof(region));
+	m->a = calloc(width*height, sizeof(enum cell));
+	m->r = calloc(width*height, sizeof(region));

 	return m;
 }
@@ -79,5 +79,5 @@
 		case 0: return '#';
 		case 1: return ' ';
 	}
-	errx(EX_SOFTWARE, "invalid cell");
+	errx(EX_SOFTWARE, "invalid cell: %d", c);
 }


Include RTCD header in encodeframe.c

Include RTCD header in encodeframe.c

The file uses functions defined in vp8_rtcd.h but did not include the
header.

Change-Id: I110196ddc9181e533be1fe656e21c1791cabe226

--- vp8/encoder/encodeframe.c
+++ vp8/encoder/encodeframe.c
@@ -10,6 +10,7 @@

 #include "vpx_config.h"
+#include "vp8_rtcd.h"
 #include "encodemb.h"
 #include "encodemv.h"
 #include "vp8/common/common.h"


Platform: this documentation block is superfluous.

--- src/Platform/AbstractXApplication.h
+++ src/Platform/AbstractXApplication.h
@@ -83,11 +83,6 @@
         void exit() { flags |= Flag::Exit; }

     protected:
-        /**
-         * @brief Destructor
-         *
-         * Deletes context and destroys the window.
-         */
         /* Nobody will need to have (and delete) AbstractXApplication*, thus
            this is faster than public pure virtual destructor */
         ~AbstractXApplication();


Skip loop filter operation in show_existing_frame mode

Skip the loop filtering for frame coding in show_existing_frame
mode. This matches the decoder operation for show_existing_frame
mode.

Change-Id: I96f275cf5384eb5fe8c0404ec4142cf5b580ac16

--- vp9/encoder/vp9_encoder.c
+++ vp9/encoder/vp9_encoder.c
@@ -3250,6 +3250,12 @@
   if (cpi->use_svc &&
       cpi->svc.temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS)
     is_reference_frame = !cpi->svc.non_reference_frame;
+
+  // Skip loop filter in show_existing_frame mode.
+  if (cm->show_existing_frame) {
+    lf->filter_level = 0;
+    return;
+  }

   if (xd->lossless) {
     lf->filter_level = 0;


Adds comments to the BeaconRegion header file.

--- BeaconKit/BeaconKit/BeaconRegion.h
+++ BeaconKit/BeaconKit/BeaconRegion.h
@@ -8,11 +8,22 @@

 #import <Foundation/Foundation.h>

+/**
+ *  Class reperesnting beacon region.
+ */
 @interface BeaconRegion : NSObject

 @property (nonatomic, copy) NSString *uuid;
 @property (nonatomic, copy) NSString *name;

+/**
+ *  Designated initalizer for creating a new BeaconRegion instance.
+ *
+ *  @param uuid NSString with the UUID for reagion.
+ *  @param name Unique name for region.
+ *
+ *  @return New instance of BeaconRegion.
+ */
 - (instancetype)initWithUUID:(NSString *)uuid
                         name:(NSString *)name NS_DESIGNATED_INITIALIZER;


fixed include guard to make it unique with vis data structure

--- apps/oskar_VisData.h
+++ apps/oskar_VisData.h
@@ -26,8 +26,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */

-#ifndef OSKAR_VISDATA_H_
-#define OSKAR_VISDATA_H_
+#ifndef OSKAR_VISDATA_CLASS_H_
+#define OSKAR_VISDATA_CLASS_H_

 #include "utility/oskar_vector_types.h"
 #include <vector>
@@ -61,4 +61,4 @@
 };

-#endif // OSKAR_VISDATA_H_
+#endif // OSKAR_VISDATA_CLASS_H_


CLEANUP: refactored the swallowing code.

--- memcached.c
+++ memcached.c
@@ -4256,7 +4256,6 @@

     if (nkey > MAX_SASL_MECH_LEN) {
         write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_EINVAL, vlen);
-        c->write_and_go = conn_swallow;
         return;
     }

@@ -4267,7 +4266,6 @@
     struct sasl_tmp *data = calloc(sizeof(struct sasl_tmp) + buffer_size, 1);
     if (!data) {
         write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
-        c->write_and_go = conn_swallow;
         return;
     }

@@ -4538,11 +4536,6 @@
             write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
         else
             handle_unexpected_errorcode_bin(c, __func__, ret, vlen);
-
-        if (ret != ENGINE_DISCONNECT) {
-            /* swallow the data line */
-            c->write_and_go = conn_swallow;
-        }
     }
 }

@@ -4951,11 +4944,6 @@
             write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
         else
             handle_unexpected_errorcode_bin(c, __func__, ret, vlen);
-
-        if (ret != ENGINE_DISCONNECT) {
-            /* swallow the data line */
-            c->write_and_go = conn_swallow;
-        }
     }
 }

@@ -5406,11 +5394,6 @@
             write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
         else
             handle_unexpected_errorcode_bin(c, __func__, ret, vlen);
-
-        if (ret != ENGINE_DISCONNECT) {
-            /* swallow the data line */
-            c->write_and_go = conn_swallow;
-        }
     }
 }

@@ -5631,11 +5614,10 @@
         /* ret == ENGINE_E2BIG || ret == ENGINE_ENOMEM */
         if (ret == ENGINE_E2BIG)
             write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_E2BIG, vlen);
+        else if (ret == ENGINE_ENOMEM)
+            write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
         else
-            write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_EINTERNAL, 0);
-
-        /* swallow the data line */
-        c->write_and_go = conn_swallow;
+            handle_unexpected_errorcode_bin(c, __func__, ret, vlen);
     }
 }

@@ -6091,11 +6073,10 @@
         /* ret == ENGINE_EBADVALUE || ret == ENGINE_ENOMEM */
         if (ret == ENGINE_EBADVALUE)
             write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_EBADVALUE, vlen);
+        else if (ret == ENGINE_ENOMEM)
+            write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
         else
-            write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
-
-        /* swallow the data line */
-        c->write_and_go = conn_swallow;
+            handle_unexpected_errorcode_bin(c, __func__, ret, vlen);
     }
 }
 #endif
@@ -7201,17 +7182,9 @@
                                  ntohll(req->message.header.request.cas),
                                  c->binary_header.request.vbucket);
         }
-
-        /* swallow the data line */
-        c->write_and_go = conn_swallow;
         break;
     default:
         handle_unexpected_errorcode_bin(c, __func__, ret, vlen);
-
-        if (ret != ENGINE_DISCONNECT) {
-            /* swallow the data line */
-            c->write_and_go = conn_swallow;
-        }
     }
 }

@@ -7269,16 +7242,9 @@
         } else {
             write_bin_packet(c, PROTOCOL_BINARY_RESPONSE_ENOMEM, vlen);
         }
-        /* swallow the data line */
-        c->write_and_go = conn_swallow;
         break;
     default:
         handle_unexpected_errorcode_bin(c, __func__, ret, vlen);
-
-        if (ret != ENGINE_DISCONNECT) {
-            /* swallow the data line */
-            c->write_and_go = conn_swallow;
-        }
     }
 }

@@ -8370,8 +8336,8 @@
         conn_set_state(c, conn_nread);
     } else {
         out_string(c, "SERVER_ERROR out of memory");
+        c->sbytes = vlen;
         c->write_and_go = conn_swallow;
-        c->sbytes = vlen;
     }
 }

@@ -8392,8 +8358,8 @@
         lenkeys > ((numkeys*KEY_MAX_LENGTH) + numkeys-1)) {
         /* ENGINE_EBADVALUE */
         out_string(c, "CLIENT_ERROR bad value");
+        c->sbytes = lenkeys + 2;
         c->write_and_go = conn_swallow;
-        c->sbytes = lenkeys + 2;
         return;
     }
     lenkeys += 2;
@@ -8481,8 +8447,8 @@
             out_string(c, "SERVER_ERROR out of memory storing object");
         }
         /* swallow the data line */
+        c->sbytes = vlen;
         c->write_and_go = conn_swallow;
-        c->sbytes = vlen;

         /* Avoid stale data persisting in cache because we failed alloc.
          * Unacceptable for SET. Anywhere else too? */
@@ -8495,8 +8461,8 @@

         if (ret != ENGINE_DISCONNECT) {
             /* swallow the data line */
+            c->sbytes = vlen;
             c->write_and_go = conn_swallow;
-            c->sbytes = vlen;
         }
     }
 }
@@ -9812,8 +9778,8 @@

         if (ret != ENGINE_DISCONNECT) {
             /* swallow the data line */
+            c->sbytes = vlen;
             c->write_and_go = conn_swallow;
-            c->sbytes = vlen;
         }
     }
 }
@@ -10232,8 +10198,8 @@

         if (ret != ENGINE_DISCONNECT) {
             /* swallow the data line */
+            c->sbytes = vlen;
             c->write_and_go = conn_swallow;
-            c->sbytes = vlen;
         }
     }
 }
@@ -10909,8 +10875,8 @@
         else                     out_string(c, "SERVER_ERROR out of memory");

         /* swallow the data line */
+        c->sbytes = vlen;
         c->write_and_go = conn_swallow;
-        c->sbytes = vlen;
     }
 }

@@ -10952,8 +10918,8 @@

         if (ret != ENGINE_DISCONNECT) {
             /* swallow the data line */
+            c->sbytes = vlen;
             c->write_and_go = conn_swallow;
-            c->sbytes = vlen;
         }
     }
 }
@@ -11043,8 +11009,8 @@
         out_string(c, "SERVER_ERROR out of memory");

         /* swallow the data line */
+        c->sbytes = vlen;
         c->write_and_go = conn_swallow;
-        c->sbytes = vlen;
     }
 }
 #endif
@@ -11420,8 +11386,8 @@

         if (ret != ENGINE_DISCONNECT) {
             /* swallow the data line */
+            c->sbytes = vlen;
             c->write_and_go = conn_swallow;
-            c->sbytes = vlen;
         }
     }
 }
@@ -11452,9 +11418,9 @@
         /* ret == ENGINE_ENOMEM */
         out_string(c, "SERVER_ERROR out of memory");

-        //swallow the data line
+        /* swallow the data line */
+        c->sbytes = flen;
         c->write_and_go = conn_swallow;
-        c->sbytes = flen;
     }
 }

@@ -11632,8 +11598,8 @@
         if (numfields == 0) {
             if (lenfields != 0)  {
                 out_string(c, "CLIENT_ERROR bad value");
+                c->sbytes = lenfields + 2;
                 c->write_and_go = conn_swallow;
-                c->sbytes = lenfields + 2;
                 return;
             }
         } else { /* numfields != 0 */
@@ -11645,8 +11611,8 @@
                 numfields > ((lenfields/2) + 1) ||
                 lenfields > ((numfields*MAX_FIELD_LENG) + numfields-1)) {
                 out_string(c, "CLIENT_ERROR bad value");
+                c->sbytes = lenfields + 2;
                 c->write_and_go = conn_swallow;
-                c->sbytes = lenfields + 2;
                 return;
             }
         }
@@ -11703,8 +11669,8 @@
         if (numfields == 0) {
             if (lenfields != 0)  {
                 out_string(c, "CLIENT_ERROR bad value");
+                c->sbytes = lenfields + 2;
                 c->write_and_go = conn_swallow;
-                c->sbytes = lenfields + 2;
                 return;
             }
         } else { /* numfields != 0 */
@@ -11716,8 +11682,8 @@
                 numfields > ((lenfields/2) + 1) ||
                 lenfields > ((numfields*MAX_FIELD_LENG) + numfields-1)) {
                 out_string(c, "CLIENT_ERROR bad value");
+                c->sbytes = lenfields + 2;
                 c->write_and_go = conn_swallow;
-                c->sbytes = lenfields + 2;
                 return;
             }
         }
@@ -12251,8 +12217,8 @@
             lenkeys > ((numkeys*KEY_MAX_LENGTH) + numkeys-1)) {
             /* ENGINE_EBADVALUE */
             out_string(c, "CLIENT_ERROR bad value");
+            c->sbytes = lenkeys + 2;
             c->write_and_go = conn_swallow;
-            c->sbytes = lenkeys + 2;
             return;
         }
         lenkeys += 2;
@@ -12261,8 +12227,8 @@
             if (numkeys > MAX_BMGET_KEY_COUNT || count > MAX_BMGET_ELM_COUNT) {
                 /* ENGINE_EBADVALUE */
                 out_string(c, "CLIENT_ERROR bad value");
+                c->sbytes = lenkeys;
                 c->write_and_go = conn_swallow;
-                c->sbytes = lenkeys;
                 return;
             }
         }
@@ -12272,8 +12238,8 @@
             if (numkeys > MAX_SMGET_KEY_COUNT || (offset+count) > MAX_SMGET_REQ_COUNT) {
                 /* ENGINE_EBADVALUE */
                 out_string(c, "CLIENT_ERROR bad value");
+                c->sbytes = lenkeys;
                 c->write_and_go = conn_swallow;
-                c->sbytes = lenkeys;
                 return;
             }
         }


ACPI, APEI, ERST, Prevent erst_dbg from loading if ERST is disabled

erst_dbg module can not work when ERST is disabled.  So disable module
loading to provide clearer information to user.

Signed-off-by: Huang Ying <b1ed892af366400004b51f70e40351e33707b6c4@intel.com>
Signed-off-by: Len Brown <b060cfa1096cc6e8be83699ddb4ed8a77dd63af5@intel.com>

--- drivers/acpi/apei/erst-dbg.c
+++ drivers/acpi/apei/erst-dbg.c
@@ -213,6 +213,10 @@

 static __init int erst_dbg_init(void)
 {
+	if (erst_disable) {
+		pr_info(ERST_DBG_PFX "ERST support is disabled.\n");
+		return -ENODEV;
+	}
 	return misc_register(&erst_dbg_dev);
 }


added eigen plugin for perspective transoforms and some EigenToQt converters

error: pathspec 'EigenTransformPlugin.h' did not match any file(s) known to git

--- EigenTransformPlugin.h
+++ EigenTransformPlugin.h
@@ -0,0 +1,59 @@
+// The following are members of the Transform class in Eigen
+
+// perspective projection transform
+Transform<Scalar,Dim,Mode,Options>&
+perspective(float verticalAngle, float aspectRatio, float nearPlane, float farPlane)
+{
+  EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
+
+  // Check that projection volume is non-zero.
+  if (nearPlane == farPlane || aspectRatio == 0.0f)
+    return *this;
+
+  // Construct the projection.
+  MatrixType m;
+  m.setIdentity();
+
+  float radians = (verticalAngle / 2.0f) * M_PI / 180.0f;
+  float sine = std::sin(radians);
+  if (sine == 0.0f)
+    return *this;
+
+  float cotan = std::cos(radians) / sine;
+  float clip = farPlane - nearPlane;
+  m << cotan / aspectRatio, 0.0f, 0.0f, 0.0f,
+    0.0f, cotan, 0.0f, 0.0f,
+    0.0f, 0.0f, -(nearPlane + farPlane)/clip, -(2.0f*nearPlane*farPlane)/clip,
+    0.0f, 0.0f, -1.0f, 0.0f;
+
+  // Apply the projection.
+  m_matrix *= m;
+  return *this;
+}
+
+QMatrix4x4 toQMatrix4x4(void) const
+{
+  check_template_params();
+  EIGEN_STATIC_ASSERT(Dim==3, YOU_MADE_A_PROGRAMMING_MISTAKE)
+
+  if (Mode == AffineCompact)
+    return QMatrix4x4(
+        m_matrix.coeff(0,0), m_matrix.coeff(0,1), m_matrix.coeff(0,2), m_matrix.coeff(0,3),
+        m_matrix.coeff(1,0), m_matrix.coeff(1,1), m_matrix.coeff(1,2), m_matrix.coeff(1,3),
+        m_matrix.coeff(2,0), m_matrix.coeff(2,1), m_matrix.coeff(2,2), m_matrix.coeff(2,3),
+        0.0f, 0.0f, 0.0f, 1.0f);
+  else
+    return QMatrix4x4(
+        m_matrix.coeff(0,0), m_matrix.coeff(0,1), m_matrix.coeff(0,2), m_matrix.coeff(0,3),
+        m_matrix.coeff(1,0), m_matrix.coeff(1,1), m_matrix.coeff(1,2), m_matrix.coeff(1,3),
+        m_matrix.coeff(2,0), m_matrix.coeff(2,1), m_matrix.coeff(2,2), m_matrix.coeff(2,3),
+        m_matrix.coeff(3,0), m_matrix.coeff(3,1), m_matrix.coeff(3,2), m_matrix.coeff(3,3));
+}
+
+QMatrix3x3 toQMatrix3x3(void) const
+{
+  check_template_params();
+  EIGEN_STATIC_ASSERT(Dim==3, YOU_MADE_A_PROGRAMMING_MISTAKE)
+  EIGEN_STATIC_ASSERT(!(Options & RowMajor), YOU_MADE_A_PROGRAMMING_MISTAKE)
+    return QMatrix3x3(linear().data()).transposed();
+}


tcpip-forward.c: Removed unused variables shost, sport and sockopt

--- example/tcpip-forward.c
+++ example/tcpip-forward.c
@@ -57,20 +57,15 @@
     LIBSSH2_SESSION *session;
     LIBSSH2_LISTENER *listener = NULL;
     LIBSSH2_CHANNEL *channel = NULL;
-    const char *shost;
-    unsigned int sport;
     fd_set fds;
     struct timeval tv;
     ssize_t len, wr;
     char buf[16384];

 #ifdef WIN32
-    char sockopt;
     WSADATA wsadata;

     WSAStartup(MAKEWORD(2,0), &wsadata);
-#else
-    int sockopt;
 #endif

     if (argc > 1)


Don't display QoS when printing verbose messages in sub_client.

--- client/sub_client.c
+++ client/sub_client.c
@@ -50,7 +50,7 @@
 int my_publish_callback(const char *topic, int qos, uint32_t payloadlen, const uint8_t *payload, int retain)
 {
 	if(verbose){
-		printf("%s (QoS: %d): \"%s\"\n", topic, qos, payload);
+		printf("%s %s\n", topic, qos, payload);
 	}else{
 		printf("%s\n", payload);
 		fflush(stdout);


Only perform the "packet == 0X06" hack if the HandyTech display is a Bookworm. (dm)

git-svn-id: 30a5f035a20f1bc647618dbad7eea2a951b61b7c@2958 91a5dbb7-01b9-0310-9b5f-b28072856b6e

--- BrailleDrivers/HandyTech/braille.c
+++ BrailleDrivers/HandyTech/braille.c
@@ -76,6 +76,7 @@
   unsigned char sessionEndLength;

   unsigned hasATC:1; /* Active Tactile Control */
+  unsigned isBookworm:1;
 } ModelEntry;

 #define HT_BYTE_SEQUENCE(name,bytes) .name##Address = bytes, .name##Length = sizeof(bytes)
@@ -144,6 +145,7 @@
   ,
   { .identifier = 0X90,
     .name = "Bookworm",
+    .isBookworm = 1,
     .textCells = 8,
     .statusCells = 0,
     .helpPage = 1,
@@ -1451,20 +1453,22 @@
     noInput = 0;

     /* a kludge to handle the Bookworm going offline */
-    if (packet.fields.type == 0X06) {
-      if (currentState != BDS_OFF) {
-        /* if we get another byte right away then the device
-         * has gone offline and is echoing its display
-         */
-        if (io->awaitInput(10)) {
-          setState(BDS_OFF);
-          continue;
+    if (model->isBookworm) {
+      if (packet.fields.type == 0X06) {
+        if (currentState != BDS_OFF) {
+          /* if we get another byte right away then the device
+           * has gone offline and is echoing its display
+           */
+          if (io->awaitInput(10)) {
+            setState(BDS_OFF);
+            continue;
+          }
+
+          /* if an input error occurred then restart the driver */
+          if (errno != EAGAIN) return BRL_CMD_RESTARTBRL;
+
+          /* no additional input so fall through and interpret the packet as keys */
         }
-
-        /* if an input error occurred then restart the driver */
-        if (errno != EAGAIN) return BRL_CMD_RESTARTBRL;
-
-        /* no additional input so fall through and interpret the packet as keys */
       }
     }


Fix windows build issue (cannot dllexport functions).

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@32083 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/reflex/inc/Reflex/Builder/TypeBuilder.h
+++ cint/reflex/inc/Reflex/Builder/TypeBuilder.h
@@ -26,7 +26,7 @@

 namespace Reflex {
 template<typename FUNC>
-RFLX_API void* FuncToVoidPtr(FUNC f) {
+void* FuncToVoidPtr(FUNC f) {
    union Cnv_t {
       Cnv_t(FUNC ff): fFunc(ff) {}
       FUNC fFunc;
@@ -35,7 +35,7 @@
    return u.fPtr;
 }
 template <typename FUNC>
-RFLX_API FUNC VoidPtrToFunc(void* p) {
+FUNC VoidPtrToFunc(void* p) {
    union Cnv_t {
       Cnv_t(void* pp): fPtr(pp) {}
       FUNC fFunc;


PM / wakeirq: check that wake IRQ is valid before accepting it

Check that IRQ number passed to dev_pm_set_wake_irq() and
dev_pm_set_dedicated_wake_irq() is valid (not negative) before
accepting it.

Signed-off-by: Dmitry Torokhov <6b8646d310837fed93a129ed3c979b90c7f2674f@gmail.com>
Signed-off-by: Rafael J. Wysocki <27ffc44a8ec6a212fba98cfc3246c6ce8ab131e0@intel.com>

--- drivers/base/power/wakeirq.c
+++ drivers/base/power/wakeirq.c
@@ -67,6 +67,9 @@
 {
 	struct wake_irq *wirq;
 	int err;
+
+	if (irq < 0)
+		return -EINVAL;

 	wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
 	if (!wirq)
@@ -166,6 +169,9 @@
 {
 	struct wake_irq *wirq;
 	int err;
+
+	if (irq < 0)
+		return -EINVAL;

 	wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
 	if (!wirq)


debugutils: fix order of caps on an unnegotiated link

headlabel is the sink_pad (where the link points to) and not the other way around.

--- gst/gstdebugutils.c
+++ gst/gstdebugutils.c
@@ -399,7 +399,7 @@
        * we need an empty label to make space */
       fprintf (out, "%s%s_%s -> %s_%s [labeldistance=\"10\", labelangle=\"0\", "
           "label=\"                                                  \", "
-          "headlabel=\"%s\", taillabel=\"%s\"]\n",
+          "taillabel=\"%s\", headlabel=\"%s\"]\n",
           spc, element_name, pad_name, peer_element_name, peer_pad_name,
           media_src, media_sink);
       g_free (media_src);


optimized version of rowsums (2x speedup)

--- openmp/rowsums.c
+++ openmp/rowsums.c
@@ -57,14 +57,17 @@
       for (i = 0; i < nrows; i++) {
         rsum[i] = 0.0;
       }
-#pragma omp parallel private(my_rsum, i) shared(rsum)
+#pragma omp parallel private(my_rsum, i, j) shared(rsum)
 {
       for (i = 0; i < nrows; i++) {
         my_rsum[i] = 0.0;
       }
 #pragma omp for schedule(static)
-      for (i = 0; i < size; i++) {
-        my_rsum[i % nrows] += f1[i];
+      for (i = 0; i < ncols; i++) {
+        k = i * nrows;
+        for (j = 0; j < nrows; j++, k++) {
+          my_rsum[j] += f1[k];
+        }
       }
 #pragma omp critical
       for (i = 0; i < nrows; i++) {


clocksource: sh_cmt: Consolidate platform_set_drvdata() call

Cleanup the use of platform_set_drvdata() to reduce code size

Signed-off-by: Shinya Kuribayashi <039822ba0520bbe58ce7503b63b474f64f04ae3a@renesas.com>
Signed-off-by: Magnus Damm <2336f5729424d0c84d319e991b3648cafa2c3c5b@opensource.se>
Acked-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>
Tested-by: Guennadi Liakhovetski <50875182aae23d69ca7738697596f18a14e926fc@gmx.de>
Signed-off-by: Simon Horman <9662bddcc379be37df16f02a449c344b4718c1a1@verge.net.au>

--- drivers/clocksource/sh_cmt.c
+++ drivers/clocksource/sh_cmt.c
@@ -688,8 +688,6 @@
 		goto err0;
 	}

-	platform_set_drvdata(pdev, p);
-
 	res = platform_get_resource(p->pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(&p->pdev->dev, "failed to get I/O memory\n");
@@ -757,6 +755,8 @@
 		goto err2;
 	}

+	platform_set_drvdata(pdev, p);
+
 	return 0;
 err2:
 	clk_put(p->clk);
@@ -792,7 +792,6 @@
 	ret = sh_cmt_setup(p, pdev);
 	if (ret) {
 		kfree(p);
-		platform_set_drvdata(pdev, NULL);
 		pm_runtime_idle(&pdev->dev);
 		return ret;
 	}


udpsrc: Always bind to ANY when address is a multicast address and not only on Windows

For IPv6 addresses, binding to a multicast group does not work on Linux
either. Always bind to ANY and then later join the multicast group.

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

--- gst/udp/gstudpsrc.c
+++ gst/udp/gstudpsrc.c
@@ -942,20 +942,10 @@

     GST_DEBUG_OBJECT (src, "binding on port %d", src->port);

-    /* On Windows it's not possible to bind to a multicast address
-     * but the OS will make sure to filter out all packets that
-     * arrive not for the multicast address the socket joined.
-     *
-     * On Linux and others it is necessary to bind to a multicast
-     * address to let the OS filter out all packets that are received
-     * on the same port but for different addresses than the multicast
-     * address
-     */
-#ifdef G_OS_WIN32
+    /* For multicast, bind to ANY and join the multicast group later */
     if (g_inet_address_get_is_multicast (addr))
       bind_addr = g_inet_address_new_any (g_inet_address_get_family (addr));
     else
-#endif
       bind_addr = G_INET_ADDRESS (g_object_ref (addr));

     g_object_unref (addr);
@@ -981,25 +971,22 @@
     if (!local_addr)
       goto getsockname_error;

-    /* See above for the reasons. Without this we would behave different on
-     * Windows and Linux, joining multicast groups below for provided sockets
-     * on Linux but not on Windows
-     */
-#ifdef G_OS_WIN32
     addr = gst_udpsrc_resolve (src, src->address);
     if (!addr)
       goto name_resolve;

+    /* If bound to ANY and address points to a multicast address, make
+     * sure that address is not overridden with ANY but we have the
+     * opportunity later to join the multicast address. This ensures that we
+     * have the same behaviour as for sockets created by udpsrc */
     if (!src->auto_multicast ||
         !g_inet_address_get_is_any (g_inet_socket_address_get_address
             (local_addr))
         || !g_inet_address_get_is_multicast (addr)) {
       g_object_unref (addr);
-#endif
       if (src->addr)
         g_object_unref (src->addr);
       src->addr = local_addr;
-#ifdef G_OS_WIN32
     } else {
       g_object_unref (local_addr);
       if (src->addr)
@@ -1008,7 +995,6 @@
           G_INET_SOCKET_ADDRESS (g_inet_socket_address_new (addr, src->port));
       g_object_unref (addr);
     }
-#endif
   }

   {


clocksource: sh_tmu: Hardcode TMU clock event and source ratings to 200

All boards use clock event and clock source ratings of 200 for the TMU,
hardcode it in the driver.

Signed-off-by: Laurent Pinchart <ae960578cc5eca7b9b1dbc37d9caa6cb634f35e0@ideasonboard.com>

--- drivers/clocksource/sh_tmu.c
+++ drivers/clocksource/sh_tmu.c
@@ -300,12 +300,12 @@
 }

 static int sh_tmu_register_clocksource(struct sh_tmu_channel *ch,
-				       const char *name, unsigned long rating)
+				       const char *name)
 {
 	struct clocksource *cs = &ch->cs;

 	cs->name = name;
-	cs->rating = rating;
+	cs->rating = 200;
 	cs->read = sh_tmu_clocksource_read;
 	cs->enable = sh_tmu_clocksource_enable;
 	cs->disable = sh_tmu_clocksource_disable;
@@ -402,7 +402,7 @@
 }

 static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
-				       const char *name, unsigned long rating)
+				       const char *name)
 {
 	struct clock_event_device *ced = &ch->ced;
 	int ret;
@@ -410,7 +410,7 @@
 	ced->name = name;
 	ced->features = CLOCK_EVT_FEAT_PERIODIC;
 	ced->features |= CLOCK_EVT_FEAT_ONESHOT;
-	ced->rating = rating;
+	ced->rating = 200;
 	ced->cpumask = cpumask_of(0);
 	ced->set_next_event = sh_tmu_clock_event_next;
 	ced->set_mode = sh_tmu_clock_event_mode;
@@ -433,13 +433,12 @@
 }

 static int sh_tmu_register(struct sh_tmu_channel *ch, const char *name,
-		    unsigned long clockevent_rating,
-		    unsigned long clocksource_rating)
-{
-	if (clockevent_rating)
-		sh_tmu_register_clockevent(ch, name, clockevent_rating);
-	else if (clocksource_rating)
-		sh_tmu_register_clocksource(ch, name, clocksource_rating);
+			   bool clockevent, bool clocksource)
+{
+	if (clockevent)
+		sh_tmu_register_clockevent(ch, name);
+	else if (clocksource)
+		sh_tmu_register_clocksource(ch, name);

 	return 0;
 }
@@ -471,8 +470,8 @@
 	ch->enable_count = 0;

 	return sh_tmu_register(ch, dev_name(&tmu->pdev->dev),
-			       cfg->clockevent_rating,
-			       cfg->clocksource_rating);
+			       cfg->clockevent_rating != 0,
+			       cfg->clocksource_rating != 0);
 }

 static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)


udpsrc: Fix compilation on Windows and *BSD/OSX

--- gst/udp/gstudpsrc.c
+++ gst/udp/gstudpsrc.c
@@ -110,8 +110,12 @@
 /* Needed to get struct in6_pktinfo */
 #define _GNU_SOURCE
 #include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifndef G_OS_WIN32
 #include <netinet/in.h>
+#endif

 #include <string.h>
 #include "gstudpsrc.h"
@@ -363,7 +367,7 @@
   addr = data;

   message = g_object_new (GST_TYPE_IP_RECVDSTADDR_MESSAGE, NULL);
-  message->addr = g_inet_address_new_from_bytes ((guint8 *) addr, AF_INET);
+  message->addr = *addr;

   return G_SOCKET_CONTROL_MESSAGE (message);
 }


firmware: Expose DMI type 15 System Event Log

The System Event Log described by DMI entry type 15 may be backed by
either memory or may be indirectly accessed via an IO index/data
register pair.

In order to get read access to this log, expose it in the
"system_event_log" sub-directory of type 15 DMI entries, ie:
/sys/firmware/dmi/entries/15-0/system_event_log/raw_event_log.

This commit handles both IO accessed and memory access system event
logs.  OEM specific access and GPNV support is explicitly not handled
and we error out in the logs when we do not recognize the access method.

Signed-off-by: Mike Waychison <299b28f2f3ac327aab97e268a3ca5428ba100ef8@google.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/firmware/dmi-sysfs.c
+++ drivers/firmware/dmi-sysfs.c
@@ -312,6 +312,140 @@
 	.default_attrs = dmi_sysfs_sel_attrs,
 };

+typedef u8 (*sel_io_reader)(const struct dmi_system_event_log *sel,
+			    loff_t offset);
+
+static DEFINE_MUTEX(io_port_lock);
+
+static u8 read_sel_8bit_indexed_io(const struct dmi_system_event_log *sel,
+				   loff_t offset)
+{
+	u8 ret;
+
+	mutex_lock(&io_port_lock);
+	outb((u8)offset, sel->io.index_addr);
+	ret = inb(sel->io.data_addr);
+	mutex_unlock(&io_port_lock);
+	return ret;
+}
+
+static u8 read_sel_2x8bit_indexed_io(const struct dmi_system_event_log *sel,
+				     loff_t offset)
+{
+	u8 ret;
+
+	mutex_lock(&io_port_lock);
+	outb((u8)offset, sel->io.index_addr);
+	outb((u8)(offset >> 8), sel->io.index_addr + 1);
+	ret = inb(sel->io.data_addr);
+	mutex_unlock(&io_port_lock);
+	return ret;
+}
+
+static u8 read_sel_16bit_indexed_io(const struct dmi_system_event_log *sel,
+				    loff_t offset)
+{
+	u8 ret;
+
+	mutex_lock(&io_port_lock);
+	outw((u16)offset, sel->io.index_addr);
+	ret = inb(sel->io.data_addr);
+	mutex_unlock(&io_port_lock);
+	return ret;
+}
+
+static sel_io_reader sel_io_readers[] = {
+	[DMI_SEL_ACCESS_METHOD_IO8]	= read_sel_8bit_indexed_io,
+	[DMI_SEL_ACCESS_METHOD_IO2x8]	= read_sel_2x8bit_indexed_io,
+	[DMI_SEL_ACCESS_METHOD_IO16]	= read_sel_16bit_indexed_io,
+};
+
+static ssize_t dmi_sel_raw_read_io(struct dmi_sysfs_entry *entry,
+				   const struct dmi_system_event_log *sel,
+				   char *buf, loff_t pos, size_t count)
+{
+	ssize_t wrote = 0;
+
+	sel_io_reader io_reader = sel_io_readers[sel->access_method];
+
+	while (count && pos < sel->area_length) {
+		count--;
+		*(buf++) = io_reader(sel, pos++);
+		wrote++;
+	}
+
+	return wrote;
+}
+
+static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry,
+				       const struct dmi_system_event_log *sel,
+				       char *buf, loff_t pos, size_t count)
+{
+	u8 __iomem *mapped;
+	ssize_t wrote = 0;
+
+	mapped = ioremap(sel->access_method_address, sel->area_length);
+	if (!mapped)
+		return -EIO;
+
+	while (count && pos < sel->area_length) {
+		count--;
+		*(buf++) = readb(mapped + pos++);
+		wrote++;
+	}
+
+	iounmap(mapped);
+	return wrote;
+}
+
+static ssize_t dmi_sel_raw_read_helper(struct dmi_sysfs_entry *entry,
+				       const struct dmi_header *dh,
+				       void *_state)
+{
+	struct dmi_read_state *state = _state;
+	const struct dmi_system_event_log *sel = to_sel(dh);
+
+	if (sizeof(*sel) > dmi_entry_length(dh))
+		return -EIO;
+
+	switch (sel->access_method) {
+	case DMI_SEL_ACCESS_METHOD_IO8:
+	case DMI_SEL_ACCESS_METHOD_IO2x8:
+	case DMI_SEL_ACCESS_METHOD_IO16:
+		return dmi_sel_raw_read_io(entry, sel, state->buf,
+					   state->pos, state->count);
+	case DMI_SEL_ACCESS_METHOD_PHYS32:
+		return dmi_sel_raw_read_phys32(entry, sel, state->buf,
+					       state->pos, state->count);
+	case DMI_SEL_ACCESS_METHOD_GPNV:
+		pr_info("dmi-sysfs: GPNV support missing.\n");
+		return -EIO;
+	default:
+		pr_info("dmi-sysfs: Unknown access method %02x\n",
+			sel->access_method);
+		return -EIO;
+	}
+}
+
+static ssize_t dmi_sel_raw_read(struct file *filp, struct kobject *kobj,
+				struct bin_attribute *bin_attr,
+				char *buf, loff_t pos, size_t count)
+{
+	struct dmi_sysfs_entry *entry = to_entry(kobj->parent);
+	struct dmi_read_state state = {
+		.buf = buf,
+		.pos = pos,
+		.count = count,
+	};
+
+	return find_dmi_entry(entry, dmi_sel_raw_read_helper, &state);
+}
+
+static struct bin_attribute dmi_sel_raw_attr = {
+	.attr = {.name = "raw_event_log", .mode = 0400},
+	.read = dmi_sel_raw_read,
+};
+
 static int dmi_system_event_log(struct dmi_sysfs_entry *entry)
 {
 	int ret;
@@ -325,6 +459,15 @@
 				   "system_event_log");
 	if (ret)
 		goto out_free;
+
+	ret = sysfs_create_bin_file(entry->child, &dmi_sel_raw_attr);
+	if (ret)
+		goto out_del;
+
+	return 0;
+
+out_del:
+	kobject_del(entry->child);
 out_free:
 	kfree(entry->child);
 	return ret;


gstsctpclientsink: Add properties

gstsctpclientsink: Add properties

Change-Id: I00297a497f27b7737b03c2f32ee7bf4ab2093121

--- gstsctpclientsink.c
+++ gstsctpclientsink.c
@@ -21,6 +21,10 @@

 #define PLUGIN_NAME "sctpclientsink"

+#define SCTP_HIGHEST_PORT G_MAXUINT16
+#define SCTP_DEFAULT_HOST "localhost"
+#define SCTP_DEFAULT_PORT 8000
+
 GST_DEBUG_CATEGORY_STATIC (gst_sctp_client_sink_debug_category);
 #define GST_CAT_DEFAULT gst_sctp_client_sink_debug_category

@@ -35,12 +39,98 @@
 struct _GstSCTPClientSinkPrivate
 {
   gint sockfd;
+
+  /* server information */
+  gint port;
+  gchar *host;
 };
+
+enum
+{
+  PROP_0,
+  PROP_HOST,
+  PROP_PORT
+};
+
+static void
+gst_sctp_client_sink_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec)
+{
+  GstSCTPClientSink *stcpclientsink;
+
+  g_return_if_fail (GST_IS_SCTP_CLIENT_SINK (object));
+  stcpclientsink = GST_SCTP_CLIENT_SINK (object);
+
+  switch (prop_id) {
+    case PROP_HOST:
+      if (g_value_get_string (value) == NULL) {
+        GST_WARNING ("host property cannot be NULL");
+        break;
+      }
+      g_free (stcpclientsink->priv->host);
+      stcpclientsink->priv->host = g_strdup (g_value_get_string (value));
+      break;
+    case PROP_PORT:
+      stcpclientsink->priv->port = g_value_get_int (value);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static void
+gst_sctp_client_sink_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec)
+{
+  GstSCTPClientSink *stcpclientsink;
+
+  g_return_if_fail (GST_IS_SCTP_CLIENT_SINK (object));
+  stcpclientsink = GST_SCTP_CLIENT_SINK (object);
+
+  switch (prop_id) {
+    case PROP_HOST:
+      g_value_set_string (value, stcpclientsink->priv->host);
+      break;
+    case PROP_PORT:
+      g_value_set_int (value, stcpclientsink->priv->port);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static void
+gst_sctp_client_sink_finalize (GObject * gobject)
+{
+  GstSCTPClientSink *self = GST_SCTP_CLIENT_SINK (gobject);
+
+  g_free (self->priv->host);
+  self->priv->host = NULL;
+
+  G_OBJECT_CLASS (gst_sctp_client_sink_parent_class)->finalize (gobject);
+}

 static void
 gst_sctp_client_sink_class_init (GstSCTPClientSinkClass * klass)
 {
   GstElementClass *gstelement_class;
+  GObjectClass *gobject_class;
+
+  gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class->set_property = gst_sctp_client_sink_set_property;
+  gobject_class->get_property = gst_sctp_client_sink_get_property;
+  gobject_class->finalize = gst_sctp_client_sink_finalize;
+
+  g_object_class_install_property (gobject_class, PROP_HOST,
+      g_param_spec_string ("host", "Host", "The host/IP to send the packets to",
+          SCTP_DEFAULT_HOST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+  g_object_class_install_property (gobject_class, PROP_PORT,
+      g_param_spec_int ("port", "Port", "The port to send the packets to",
+          0, SCTP_HIGHEST_PORT, SCTP_DEFAULT_PORT,
+          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

   gstelement_class = GST_ELEMENT_CLASS (klass);

@@ -57,6 +147,8 @@
 {
   self->priv = GST_SCTP_CLIENT_SINK_GET_PRIVATE (self);
   self->priv->sockfd = -1;
+  self->priv->host = g_strdup (SCTP_DEFAULT_HOST);
+  self->priv->port = SCTP_DEFAULT_PORT;

   g_object_set (G_OBJECT (self), "async-handling", TRUE, NULL);
 }


Revert "drm/atomic: Call ww_acquire_done after check phase is complete"

This reverts commit 992cbf19b32900efa17850b9fa0031fd623edd4d.

Until we make fbdev layer atomic we can't call this.

Requested-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com?
Acked-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>
Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

--- drivers/gpu/drm/drm_atomic.c
+++ drivers/gpu/drm/drm_atomic.c
@@ -1230,9 +1230,6 @@
 		}
 	}

-	if (ret == 0)
-		ww_acquire_done(&state->acquire_ctx->ww_ctx);
-
 	return ret;
 }
 EXPORT_SYMBOL(drm_atomic_check_only);


a cache entry should not be copyable!

a cache entry should not be copyable!

--- Engine/AbstractCache.h
+++ Engine/AbstractCache.h
@@ -14,6 +14,7 @@

 #include <vector>
 #include <QtCore/QMutex>
+#include <boost/utility.hpp>

 #include "Global/Macros.h"
 #include "Global/GlobalDefines.h"
@@ -23,7 +24,7 @@
 /* Abstract class/interface for cache entries. This can be overloaded to fit parameters you'd
  like to track like offset in files, list of elements etc...
  Entries are not copyable, you must create a new object if you want to copy infos.*/
-class CacheEntry {
+class CacheEntry : boost::noncopyable {
 public:
     CacheEntry() {};
     virtual ~CacheEntry() {};


Update epackettype.h

Update epackettype.h

--- src/rosecommon/include/epackettype.h
+++ src/rosecommon/include/epackettype.h
@@ -53,6 +53,7 @@
   ISC_SERVER_REGISTER,
   ISC_TRANSFER, // transfer to specific map(s)
   ISC_TRANSFER_CHAR, // transfer to specific character(s) (map(s) is/are determined automatically for you)
+  ISC_CLIENT_STATUS, // maps send this packet to the char server every time the status of a client changes
   ISC_SHUTDOWN,
   ISCEND,


drm/tegra: Don't check resource with devm_ioremap_resource()

devm_ioremap_resource() does sanity checks on the given resource. No
need to duplicate this in the driver.

Signed-off-by: Wolfram Sang <fd4ce474653598159cad06f3c83387a05cd53a44@the-dreams.de>
Reviewed-by: Terje Bergstrom <b8d9c01712a06e0617f9ca052381cbc8aad1ec73@nvidia.com>
Signed-off-by: Thierry Reding <3055038c414aef68bf32c33b8118623e7554e0f2@nvidia.com>

--- drivers/gpu/drm/tegra/hdmi.c
+++ drivers/gpu/drm/tegra/hdmi.c
@@ -1418,9 +1418,6 @@
 		return err;

 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!regs)
-		return -ENXIO;
-
 	hdmi->regs = devm_ioremap_resource(&pdev->dev, regs);
 	if (IS_ERR(hdmi->regs))
 		return PTR_ERR(hdmi->regs);


Eliminate error status on EAFP when no pool link exists

I think that the proper behavior is to just not return anything instead of an
error.  Since not being affiliated with a pool isn't necessarily an error, we
shouldn't kill an entire associaton operation as a result.

Signed-off-by: Dan Smith <787803eb1755f35291827d0f0268aa9bc7a57464@us.ibm.com>

--- src/Virt_ElementAllocatedFromPool.c
+++ src/Virt_ElementAllocatedFromPool.c
@@ -75,9 +75,7 @@

         poolid = pool_member_of(_BROKER, CLASSNAME(ref), type, id);
         if (poolid == NULL) {
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Unknown pool membership for `%s'", id);
+                CU_DEBUG("No pool membership for `%s'", id);
                 goto out;
         }


drm/ttm: get rid of ttm_bo_is_reserved usage

Use lockdep_assert_held instead.

Signed-off-by: Maarten Lankhorst <743c2818a341d71b99ed2b566f9f80c2fc288f93@canonical.com>
Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

--- drivers/gpu/drm/ttm/ttm_bo.c
+++ drivers/gpu/drm/ttm/ttm_bo.c
@@ -166,7 +166,7 @@
 	struct ttm_bo_device *bdev = bo->bdev;
 	struct ttm_mem_type_manager *man;

-	BUG_ON(!ttm_bo_is_reserved(bo));
+	lockdep_assert_held(&bo->resv->lock.base);

 	if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {

@@ -671,7 +671,7 @@
 		goto out;
 	}

-	BUG_ON(!ttm_bo_is_reserved(bo));
+	lockdep_assert_held(&bo->resv->lock.base);

 	evict_mem = bo->mem;
 	evict_mem.mm_node = NULL;
@@ -961,7 +961,7 @@
 	struct ttm_mem_reg mem;
 	struct ttm_bo_device *bdev = bo->bdev;

-	BUG_ON(!ttm_bo_is_reserved(bo));
+	lockdep_assert_held(&bo->resv->lock.base);

 	/*
 	 * FIXME: It's possible to pipeline buffer moves.
@@ -1020,7 +1020,7 @@
 {
 	int ret;

-	BUG_ON(!ttm_bo_is_reserved(bo));
+	lockdep_assert_held(&bo->resv->lock.base);
 	/* Check that range is valid */
 	if (placement->lpfn || placement->fpfn)
 		if (placement->fpfn > placement->lpfn ||


GtkScrollable: Use G_PARAM_EXPLICIT_NOTIFY

Implementors will have to be adjusted.

--- gtk/gtkscrollable.c
+++ gtk/gtkscrollable.c
@@ -112,7 +112,7 @@
 			     P_("How the size of the content should be determined"),
 			     GTK_TYPE_SCROLLABLE_POLICY,
 			     GTK_SCROLL_MINIMUM,
-			     GTK_PARAM_READWRITE);
+			     GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
   g_object_interface_install_property (iface, pspec);

   /**
@@ -128,7 +128,7 @@
 			     P_("How the size of the content should be determined"),
 			     GTK_TYPE_SCROLLABLE_POLICY,
 			     GTK_SCROLL_MINIMUM,
-			     GTK_PARAM_READWRITE);
+			     GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
   g_object_interface_install_property (iface, pspec);
 }


hwmon: (wm8350) Convert to devm_hwmon_device_register_with_groups

Use ATTRIBUTE_GROUPS macro and devm_hwmon_device_register_with_groups() to
simplify the code a bit.

Signed-off-by: Axel Lin <b6ffd6973e972cb999e8e535ab74da7fee0c035f@ingics.com>
Acked-by: Charles Keepax <8e4aa0015eb43ed5ca66aaca3fb498609e1e427c@opensource.wolfsonmicro.com>
Signed-off-by: Guenter Roeck <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@roeck-us.net>

--- drivers/hwmon/wm8350-hwmon.c
+++ drivers/hwmon/wm8350-hwmon.c
@@ -28,18 +28,11 @@
 #include <linux/mfd/wm8350/core.h>
 #include <linux/mfd/wm8350/comparator.h>

-static ssize_t show_name(struct device *dev,
-			 struct device_attribute *attr, char *buf)
-{
-	return sprintf(buf, "wm8350\n");
-}
-
 static const char * const input_names[] = {
 	[WM8350_AUXADC_USB]  = "USB",
 	[WM8350_AUXADC_LINE] = "Line",
 	[WM8350_AUXADC_BATT] = "Battery",
 };
-

 static ssize_t show_voltage(struct device *dev,
 			    struct device_attribute *attr, char *buf)
@@ -68,15 +61,11 @@
 	static SENSOR_DEVICE_ATTR(in##id##_label, S_IRUGO, show_label,	\
 				  NULL, name)

-static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
-
 WM8350_NAMED_VOLTAGE(0, WM8350_AUXADC_USB);
 WM8350_NAMED_VOLTAGE(1, WM8350_AUXADC_BATT);
 WM8350_NAMED_VOLTAGE(2, WM8350_AUXADC_LINE);

-static struct attribute *wm8350_attributes[] = {
-	&dev_attr_name.attr,
-
+static struct attribute *wm8350_attrs[] = {
 	&sensor_dev_attr_in0_input.dev_attr.attr,
 	&sensor_dev_attr_in0_label.dev_attr.attr,
 	&sensor_dev_attr_in1_input.dev_attr.attr,
@@ -87,46 +76,21 @@
 	NULL,
 };

-static const struct attribute_group wm8350_attr_group = {
-	.attrs	= wm8350_attributes,
-};
+ATTRIBUTE_GROUPS(wm8350);

 static int wm8350_hwmon_probe(struct platform_device *pdev)
 {
 	struct wm8350 *wm8350 = platform_get_drvdata(pdev);
-	int ret;
+	struct device *hwmon_dev;

-	ret = sysfs_create_group(&pdev->dev.kobj, &wm8350_attr_group);
-	if (ret)
-		goto err;
-
-	wm8350->hwmon.classdev = hwmon_device_register(&pdev->dev);
-	if (IS_ERR(wm8350->hwmon.classdev)) {
-		ret = PTR_ERR(wm8350->hwmon.classdev);
-		goto err_group;
-	}
-
-	return 0;
-
-err_group:
-	sysfs_remove_group(&pdev->dev.kobj, &wm8350_attr_group);
-err:
-	return ret;
-}
-
-static int wm8350_hwmon_remove(struct platform_device *pdev)
-{
-	struct wm8350 *wm8350 = platform_get_drvdata(pdev);
-
-	hwmon_device_unregister(wm8350->hwmon.classdev);
-	sysfs_remove_group(&pdev->dev.kobj, &wm8350_attr_group);
-
-	return 0;
+	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev, "wm8350",
+							   wm8350,
+							   wm8350_groups);
+	return PTR_ERR_OR_ZERO(hwmon_dev);
 }

 static struct platform_driver wm8350_hwmon_driver = {
 	.probe = wm8350_hwmon_probe,
-	.remove = wm8350_hwmon_remove,
 	.driver = {
 		.name = "wm8350-hwmon",
 		.owner = THIS_MODULE,


add missing code for PIPE_FORMAT_S8_UNORM renderbuffer

--- src/mesa/state_tracker/st_cb_fbo.c
+++ src/mesa/state_tracker/st_cb_fbo.c
@@ -243,6 +243,10 @@
       strb->Base.InternalFormat = GL_DEPTH24_STENCIL8_EXT;
       strb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT;
       break;
+   case PIPE_FORMAT_S8_UNORM:
+      strb->Base.InternalFormat = GL_STENCIL_INDEX8_EXT;
+      strb->Base._BaseFormat = GL_STENCIL_INDEX;
+      break;
    case PIPE_FORMAT_R16G16B16A16_SNORM:
       strb->Base.InternalFormat = GL_RGBA16;
       strb->Base._BaseFormat = GL_RGBA;


periph/i2c: Editorial doc changes

periph/i2c: Editorial doc changes

--- drivers/include/periph/i2c.h
+++ drivers/include/periph/i2c.h
@@ -29,7 +29,7 @@
  * // before accessing the bus, we need to acquire it
  * i2c_acquire(dev);
  * // next we write the register address, but create no STOP condition when done
- * i2c_write_byte(dev, device_addr, reg_addr, (i2C_NOSTOP | I2C_ADDR10));
+ * i2c_write_byte(dev, device_addr, reg_addr, (I2C_NOSTOP | I2C_ADDR10));
  * // and now we read the register value
  * i2c_read_byte(dev, device_addr, &reg_value, I2C_ADDR10);
  * // finally we have to release the bus
@@ -425,4 +425,4 @@
 #endif

 #endif /* PERIPH_I2C_H */
-/** @} */+/** @} */


esp_wifi: fix the crash when wifi stop after deinit

--- components/esp_wifi/src/wifi_init.c
+++ components/esp_wifi/src/wifi_init.c
@@ -35,6 +35,7 @@

 ESP_EVENT_DEFINE_BASE(WIFI_EVENT);

+extern uint8_t esp_wifi_get_user_init_flag_internal(void);
 #ifdef CONFIG_PM_ENABLE
 static esp_pm_lock_handle_t s_wifi_modem_sleep_lock;
 #endif
@@ -114,6 +115,11 @@
 {
     esp_err_t err = ESP_OK;

+    if (esp_wifi_get_user_init_flag_internal()) {
+        ESP_LOGE(TAG, "Wi-Fi not stop");
+        return ESP_FAIL;
+    }
+
     esp_supplicant_deinit();
     err = esp_wifi_deinit_internal();
     if (err != ESP_OK) {


Apply netmask to IPv6 address in is_in_net6().

--- openpgm/pgm/if.c
+++ openpgm/pgm/if.c
@@ -212,7 +212,7 @@
 #endif

 	for (unsigned i = 0; i < 16; i++)
-		if (netmask->s6_addr[i] && addr->s6_addr[i] != (netaddr->s6_addr[i] & netmask->s6_addr[i]))
+		if ((addr->s6_addr[i] & netmask->s6_addr[i]) != (netaddr->s6_addr[i] & netmask->s6_addr[i]))
 			return FALSE;
 	return TRUE;
 }


st/mesa: fix gallium texture level selection for RTT

Fixes invalid texture level when rendering to a texture where
GL_BASE_LEVEL > 0.

This will be cherry-picked to the 7.7 branch after additional
testing.

--- src/mesa/state_tracker/st_cb_fbo.c
+++ src/mesa/state_tracker/st_cb_fbo.c
@@ -37,6 +37,7 @@
 #include "main/context.h"
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
+#include "main/macros.h"
 #include "main/renderbuffer.h"

 #include "pipe/p_context.h"
@@ -340,11 +341,16 @@
    struct gl_renderbuffer *rb;
    struct pipe_texture *pt = st_get_texobj_texture(att->Texture);
    struct st_texture_object *stObj;
-   const struct gl_texture_image *texImage =
-      att->Texture->Image[att->CubeMapFace][att->TextureLevel];
-
+   const struct gl_texture_image *texImage;
+   GLint pt_level;
+
+   /* When would this fail?  Perhaps assert? */
    if (!pt)
       return;
+
+   /* The first gallium texture level = Mesa BaseLevel */
+   pt_level = MAX2(0, (GLint) att->TextureLevel - att->Texture->BaseLevel);
+   texImage = att->Texture->Image[att->CubeMapFace][pt_level];

    /* create new renderbuffer which wraps the texture image */
    rb = st_new_renderbuffer(ctx, 0);
@@ -365,7 +371,7 @@

    /* point renderbuffer at texobject */
    strb->rtt = stObj;
-   strb->rtt_level = att->TextureLevel;
+   strb->rtt_level = pt_level;
    strb->rtt_face = att->CubeMapFace;
    strb->rtt_slice = att->Zoffset;

@@ -379,6 +385,8 @@
    pipe_texture_reference( &strb->texture, pt );

    pipe_surface_reference(&strb->surface, NULL);
+
+   assert(strb->rtt_level <= strb->texture->last_level);

    /* new surface for rendering into the texture */
    strb->surface = screen->get_tex_surface(screen,


dm cache: improve discard support

dm cache: improve discard support

Safely allow the discard blocksize to be larger than the cache blocksize
by using the bio prison's range locking support.  This also improves
discard performance considerly because larger discards are issued to the
dm-cache device.  The discard blocksize was always intended to be
greater than the cache blocksize.  But until now it wasn't implemented
safely.

Also, by safely restoring the ability to have discard blocksize larger
than cache blocksize we're able to significantly reduce the memory used
for the cache's discard bitset.  Before, with a small discard blocksize,
the discard bitset could get quite large because its size is a function
of the discard blocksize and the origin device's size.  For example,
previously, using a 32KB cache blocksize with a 40TB origin resulted in
1280MB of incore memory use for the discard bitset!  Now, the discard
blocksize is scaled up accordingly to ensure the discard bitset is
capped at 2**14 bits, or 16KB.

Signed-off-by: Joe Thornber <61d5fad70554ae22d57a37634e04f12f58acc678@redhat.com>
Signed-off-by: Mike Snitzer <85e533f2e78486213c4d69f71462342ec0c62734@redhat.com>

--- drivers/md/dm-cache-target.c
+++ drivers/md/dm-cache-target.c
@@ -310,6 +310,7 @@
 	dm_cblock_t cblock;

 	bool err:1;
+	bool discard:1;
 	bool writeback:1;
 	bool demote:1;
 	bool promote:1;
@@ -433,12 +434,12 @@

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

-static void build_key(dm_oblock_t oblock, struct dm_cell_key *key)
+static void build_key(dm_oblock_t begin, dm_oblock_t end, struct dm_cell_key *key)
 {
 	key->virtual = 0;
 	key->dev = 0;
-	key->block_begin = from_oblock(oblock);
-	key->block_end = key->block_begin + 1ULL;
+	key->block_begin = from_oblock(begin);
+	key->block_end = from_oblock(end);
 }

 /*
@@ -448,20 +449,30 @@
  */
 typedef void (*cell_free_fn)(void *context, struct dm_bio_prison_cell *cell);

+static int bio_detain_range(struct cache *cache, dm_oblock_t oblock_begin, dm_oblock_t oblock_end,
+			    struct bio *bio, struct dm_bio_prison_cell *cell_prealloc,
+			    cell_free_fn free_fn, void *free_context,
+			    struct dm_bio_prison_cell **cell_result)
+{
+	int r;
+	struct dm_cell_key key;
+
+	build_key(oblock_begin, oblock_end, &key);
+	r = dm_bio_detain(cache->prison, &key, bio, cell_prealloc, cell_result);
+	if (r)
+		free_fn(free_context, cell_prealloc);
+
+	return r;
+}
+
 static int bio_detain(struct cache *cache, dm_oblock_t oblock,
 		      struct bio *bio, struct dm_bio_prison_cell *cell_prealloc,
 		      cell_free_fn free_fn, void *free_context,
 		      struct dm_bio_prison_cell **cell_result)
 {
-	int r;
-	struct dm_cell_key key;
-
-	build_key(oblock, &key);
-	r = dm_bio_detain(cache->prison, &key, bio, cell_prealloc, cell_result);
-	if (r)
-		free_fn(free_context, cell_prealloc);
-
-	return r;
+	dm_oblock_t end = to_oblock(from_oblock(oblock) + 1ULL);
+	return bio_detain_range(cache, oblock, end, bio,
+				cell_prealloc, free_fn, free_context, cell_result);
 }

 static int get_cell(struct cache *cache,
@@ -475,7 +486,7 @@

 	cell_prealloc = prealloc_get_cell(structs);

-	build_key(oblock, &key);
+	build_key(oblock, to_oblock(from_oblock(oblock) + 1ULL), &key);
 	r = dm_get_cell(cache->prison, &key, cell_prealloc, cell_result);
 	if (r)
 		prealloc_put_cell(structs, cell_prealloc);
@@ -525,25 +536,34 @@
 	return b;
 }

+static dm_block_t oblocks_per_dblock(struct cache *cache)
+{
+	dm_block_t oblocks = cache->discard_block_size;
+
+	if (block_size_is_power_of_two(cache))
+		oblocks >>= cache->sectors_per_block_shift;
+	else
+		oblocks = block_div(oblocks, cache->sectors_per_block);
+
+	return oblocks;
+}
+
 static dm_dblock_t oblock_to_dblock(struct cache *cache, dm_oblock_t oblock)
 {
-	uint32_t discard_blocks = cache->discard_block_size;
-	dm_block_t b = from_oblock(oblock);
-
-	if (!block_size_is_power_of_two(cache))
-		discard_blocks = discard_blocks / cache->sectors_per_block;
-	else
-		discard_blocks >>= cache->sectors_per_block_shift;
-
-	b = block_div(b, discard_blocks);
-
-	return to_dblock(b);
+	return to_dblock(block_div(from_oblock(oblock),
+				   oblocks_per_dblock(cache)));
+}
+
+static dm_oblock_t dblock_to_oblock(struct cache *cache, dm_dblock_t dblock)
+{
+	return to_oblock(from_dblock(dblock) * oblocks_per_dblock(cache));
 }

 static void set_discard(struct cache *cache, dm_dblock_t b)
 {
 	unsigned long flags;

+	BUG_ON(from_dblock(b) >= from_dblock(cache->discard_nr_blocks));
 	atomic_inc(&cache->stats.discard_count);

 	spin_lock_irqsave(&cache->lock, flags);
@@ -995,7 +1015,7 @@
 	wake_worker(cache);
 }

-static void issue_copy_real(struct dm_cache_migration *mg)
+static void issue_copy(struct dm_cache_migration *mg)
 {
 	int r;
 	struct dm_io_region o_region, c_region;
@@ -1074,10 +1094,45 @@
 	migration_success_pre_commit(mg);
 }

-static void issue_copy(struct dm_cache_migration *mg)
+static void calc_discard_block_range(struct cache *cache, struct bio *bio,
+				     dm_dblock_t *b, dm_dblock_t *e)
+{
+	sector_t sb = bio->bi_iter.bi_sector;
+	sector_t se = bio_end_sector(bio);
+
+	*b = to_dblock(dm_sector_div_up(sb, cache->discard_block_size));
+
+	if (se - sb < cache->discard_block_size)
+		*e = *b;
+	else
+		*e = to_dblock(block_div(se, cache->discard_block_size));
+}
+
+static void issue_discard(struct dm_cache_migration *mg)
+{
+	dm_dblock_t b, e;
+	struct bio *bio = mg->new_ocell->holder;
+
+	calc_discard_block_range(mg->cache, bio, &b, &e);
+	while (b != e) {
+		set_discard(mg->cache, b);
+		b = to_dblock(from_dblock(b) + 1);
+	}
+
+	bio_endio(bio, 0);
+	cell_defer(mg->cache, mg->new_ocell, false);
+	free_migration(mg);
+}
+
+static void issue_copy_or_discard(struct dm_cache_migration *mg)
 {
 	bool avoid;
 	struct cache *cache = mg->cache;
+
+	if (mg->discard) {
+		issue_discard(mg);
+		return;
+	}

 	if (mg->writeback || mg->demote)
 		avoid = !is_dirty(cache, mg->cblock) ||
@@ -1093,7 +1148,7 @@
 		}
 	}

-	avoid ? avoid_copy(mg) : issue_copy_real(mg);
+	avoid ? avoid_copy(mg) : issue_copy(mg);
 }

 static void complete_migration(struct dm_cache_migration *mg)
@@ -1178,6 +1233,7 @@
 	struct dm_cache_migration *mg = prealloc_get_migration(structs);

 	mg->err = false;
+	mg->discard = false;
 	mg->writeback = false;
 	mg->demote = false;
 	mg->promote = true;
@@ -1201,6 +1257,7 @@
 	struct dm_cache_migration *mg = prealloc_get_migration(structs);

 	mg->err = false;
+	mg->discard = false;
 	mg->writeback = true;
 	mg->demote = false;
 	mg->promote = false;
@@ -1226,6 +1283,7 @@
 	struct dm_cache_migration *mg = prealloc_get_migration(structs);

 	mg->err = false;
+	mg->discard = false;
 	mg->writeback = false;
 	mg->demote = true;
 	mg->promote = true;
@@ -1254,6 +1312,7 @@
 	struct dm_cache_migration *mg = prealloc_get_migration(structs);

 	mg->err = false;
+	mg->discard = false;
 	mg->writeback = false;
 	mg->demote = true;
 	mg->promote = false;
@@ -1270,6 +1329,26 @@
 	quiesce_migration(mg);
 }

+static void discard(struct cache *cache, struct prealloc *structs,
+		    struct dm_bio_prison_cell *cell)
+{
+	struct dm_cache_migration *mg = prealloc_get_migration(structs);
+
+	mg->err = false;
+	mg->discard = true;
+	mg->writeback = false;
+	mg->demote = false;
+	mg->promote = false;
+	mg->requeue_holder = false;
+	mg->invalidate = false;
+	mg->cache = cache;
+	mg->old_ocell = NULL;
+	mg->new_ocell = cell;
+	mg->start_jiffies = jiffies;
+
+	quiesce_migration(mg);
+}
+
 /*----------------------------------------------------------------
  * bio processing
  *--------------------------------------------------------------*/
@@ -1303,31 +1382,27 @@
 	issue(cache, bio);
 }

-/*
- * People generally discard large parts of a device, eg, the whole device
- * when formatting.  Splitting these large discards up into cache block
- * sized ios and then quiescing (always neccessary for discard) takes too
- * long.
- *
- * We keep it simple, and allow any size of discard to come in, and just
- * mark off blocks on the discard bitset.  No passdown occurs!
- *
- * To implement passdown we need to change the bio_prison such that a cell
- * can have a key that spans many blocks.
- */
-static void process_discard_bio(struct cache *cache, struct bio *bio)
-{
-	dm_block_t start_block = dm_sector_div_up(bio->bi_iter.bi_sector,
-						  cache->discard_block_size);
-	dm_block_t end_block = bio_end_sector(bio);
-	dm_block_t b;
-
-	end_block = block_div(end_block, cache->discard_block_size);
-
-	for (b = start_block; b < end_block; b++)
-		set_discard(cache, to_dblock(b));
-
-	bio_endio(bio, 0);
+static void process_discard_bio(struct cache *cache, struct prealloc *structs,
+				struct bio *bio)
+{
+	int r;
+	dm_dblock_t b, e;
+	struct dm_bio_prison_cell *cell_prealloc, *new_ocell;
+
+	calc_discard_block_range(cache, bio, &b, &e);
+	if (b == e) {
+		bio_endio(bio, 0);
+		return;
+	}
+
+	cell_prealloc = prealloc_get_cell(structs);
+	r = bio_detain_range(cache, dblock_to_oblock(cache, b), dblock_to_oblock(cache, e), bio, cell_prealloc,
+			     (cell_free_fn) prealloc_put_cell,
+			     structs, &new_ocell);
+	if (r > 0)
+		return;
+
+	discard(cache, structs, new_ocell);
 }

 static bool spare_migration_bandwidth(struct cache *cache)
@@ -1517,7 +1592,7 @@
 		if (bio->bi_rw & REQ_FLUSH)
 			process_flush_bio(cache, bio);
 		else if (bio->bi_rw & REQ_DISCARD)
-			process_discard_bio(cache, bio);
+			process_discard_bio(cache, &structs, bio);
 		else
 			process_bio(cache, &structs, bio);
 	}
@@ -1732,7 +1807,7 @@
 			process_invalidation_requests(cache);
 		}

-		process_migrations(cache, &cache->quiesced_migrations, issue_copy);
+		process_migrations(cache, &cache->quiesced_migrations, issue_copy_or_discard);
 		process_migrations(cache, &cache->completed_migrations, complete_migration);

 		if (commit_if_needed(cache)) {
@@ -3130,7 +3205,8 @@
 	/*
 	 * FIXME: these limits may be incompatible with the cache device
 	 */
-	limits->max_discard_sectors = cache->discard_block_size * 1024;
+	limits->max_discard_sectors = min_t(sector_t, cache->discard_block_size * 1024,
+					    cache->origin_sectors);
 	limits->discard_granularity = cache->discard_block_size << SECTOR_SHIFT;
 }

@@ -3155,7 +3231,7 @@

 static struct target_type cache_target = {
 	.name = "cache",
-	.version = {1, 5, 0},
+	.version = {1, 6, 0},
 	.module = THIS_MODULE,
 	.ctr = cache_ctr,
 	.dtr = cache_dtr,


missing header include added

missing header include added

--- scm_data/src/scm/data/analysis/transfer_function/piecewise_function_1d_serialization.h
+++ scm_data/src/scm/data/analysis/transfer_function/piecewise_function_1d_serialization.h
@@ -10,6 +10,8 @@
 #include <string>
 //#include <istream>
 //#include <iterator>
+
+#include <scm/data/analysis/transfer_function/piecewise_function_1d.h>

 namespace scm {
 namespace data {


fpta: refine inplace-ops API description, fix typos.

--- fast_positive/tables.h
+++ fast_positive/tables.h
@@ -607,6 +607,21 @@

   return FPTA_EINVAL;
 }
+
+//----------------------------------------------------------------------------
+/* In-place numeric operations with saturation */
+
+typedef enum fpta_inplace {
+  fpta_saturated_add /* target = min(target + argument, MAX_TYPE_VALUE) */,
+  fpta_saturated_sub /* target = max(target - argument, MIN_TYPE_VALUE) */,
+  fpta_saturated_mul /* target = min(target * argument, MAX_TYPE_VALUE) */,
+  fpta_saturated_div /* target = max(target / argument, MIN_TYPE_VALUE) */,
+  fpta_min /* target = min(target, argument) */,
+  fpta_max /* target = max(target, argument) */,
+  fpta_bes /* Basic Exponential Smoothing, при этом коэффициент сглаживания
+            * определяется дополнительным (третьим) аргументом.
+            * https://en.wikipedia.org/wiki/Exponential_smoothing */,
+} fpta_inplace;

 //----------------------------------------------------------------------------
 /* Designated empty, aka Denoted NILs */
@@ -2235,34 +2250,21 @@
 FPTA_API int fpta_get_column(fptu_ro row_value, const fpta_name *column_id,
                              fpta_value *value);

-typedef enum fpta_inplace {
-  fpta_saturated_add /* target = min(target + argument, MAX_TYPE_VALUE) */,
-  fpta_saturated_sub /* target = max(target - argument, MIN_TYPE_VALUE) */,
-  fpta_saturated_mul /* target = min(target * argument, MAX_TYPE_VALUE) */,
-  fpta_saturated_div /* target = max(target / argument, MIN_TYPE_VALUE) */,
-  fpta_min /* target = min(target, argument) */,
-  fpta_max /* target = max(target, argument) */,
-  fpta_bes /* Basic Exponential Smoothing, при этом коэффицент сглаживания
-            * определяется третим (дополнительным) аргументом.
-            * https://en.wikipedia.org/wiki/Exponential_smoothing */,
-} fpta_inplace;
-
-/* Обновляет значение колонки выполняет бинарную операцию c аргументом
- * и текущим значением колонки (поля кортежа).
+/* Обновляет значение колонки в переданном кортеже-строке, выполняя бинарную
+ * операцию c аргументом и текущим значением колонки (поля кортежа).
  *
  * Аргумент column_id идентифицирует целевую колонку и должен быть
  * предварительно подготовлен посредством fpta_name_refresh().
  * Внутри функции column_id не обновляется.
  *
  * Требуемая операция задается аргументом op, а второй операнд параметром value.
-
  * ВАЖНО: Для операции fpta_bes (Basic Exponential Smoothing) необходимо
  * передать дополнительный параметр, который задает коэффициент сглаживания.
  * Этот дополнительные параметр может быть передан в двух вариантах:
- *  - В формате плавающей точки, в диаппазане (0..1), исключая крайние точки.
+ *  - В формате плавающей точки, в диапазоне (0..1), исключая крайние точки.
  *    При этом непосредственно задается значение коэффициент сглаживания.
  *  - В виде отрицательного int64_t значения в диапазоне (-24..0),
- *    также исключая крайние точки. При этом коэффициет сглаживания вычисляется
+ *    также исключая крайние точки. При этом коэффициент сглаживания вычисляется
  *    как "2 в степени N", где N - переданное значение.
  *
  * В случае успеха возвращает ноль, иначе код ошибки. */


st/mesa: add PIPE_FORMAT_R10G10B10A2_UNORM to format_map table

as a candidate for the GL_RGB10_A2 internal texture format.

Reviewed-by: Marek Olšák <8c7344a1abdb103e79ecfd488098373070c3c70e@amd.com>

--- src/mesa/state_tracker/st_format.c
+++ src/mesa/state_tracker/st_format.c
@@ -861,7 +861,8 @@
    },
    {
       { GL_RGB10_A2, 0 },
-      { PIPE_FORMAT_B10G10R10A2_UNORM, DEFAULT_RGBA_FORMATS }
+      { PIPE_FORMAT_B10G10R10A2_UNORM, PIPE_FORMAT_R10G10B10A2_UNORM,
+        DEFAULT_RGBA_FORMATS }
    },
    {
       { 4, GL_RGBA, GL_RGBA8, 0 },


[libc] Does export time API if RTC component is not used.

--- components/libc/armlibc/libc_syms.c
+++ components/libc/armlibc/libc_syms.c
@@ -27,11 +27,13 @@
 RTM_EXPORT(toupper);
 RTM_EXPORT(atoi);

+#ifdef RT_USING_RTC
 RTM_EXPORT(localtime);
 RTM_EXPORT(time);
+#endif

 /* import the full stdio for printf */
-#ifdef __MICROLIB
+#if defined(RT_USING_MODULE) && defined(__MICROLIB)
 #error "[RT_USING_LIBC] Please use standard libc but not microlib."
 #endif


[media] i2c: fix platform_no_drv_owner.cocci warnings

drivers/media/i2c/tc358743.c:1960:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org>
Signed-off-by: Fengguang Wu <24f7fe9d205c8a9f6ade0c2894e14303ca16087f@intel.com>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@osg.samsung.com>

--- drivers/media/i2c/tc358743.c
+++ drivers/media/i2c/tc358743.c
@@ -1969,7 +1969,6 @@

 static struct i2c_driver tc358743_driver = {
 	.driver = {
-		.owner = THIS_MODULE,
 		.name = "tc358743",
 	},
 	.probe = tc358743_probe,


st/mesa: add missing packed depth/stencil formats in st_format_datatype()

Fixes llvmpipe regression from one of the prev commits.

--- src/mesa/state_tracker/st_format.c
+++ src/mesa/state_tracker/st_format.c
@@ -78,7 +78,9 @@
          return GL_UNSIGNED_SHORT;
       }
       else if (format == PIPE_FORMAT_Z24_UNORM_S8_USCALED ||
-               format == PIPE_FORMAT_S8_USCALED_Z24_UNORM) {
+               format == PIPE_FORMAT_S8_USCALED_Z24_UNORM ||
+               format == PIPE_FORMAT_Z24X8_UNORM ||
+               format == PIPE_FORMAT_X8Z24_UNORM) {
          return GL_UNSIGNED_INT_24_8;
       }
       else {


atmel-mci: fix sdc_reg typo

atmel-mci: fix sdc_reg typo

This fixes a bug when setting the sdc_reg for 4-bit bus width
transactions.

Signed-off-by: Hans-Christian Egtvedt <3205290bd1d4a909d3b1f9e99f4a85bafd04fac3@atmel.com>
Signed-off-by: Haavard Skinnemoen <af8c0cf3411930951fa86926b241df32af99fdb9@atmel.com>
Signed-off-by: Pierre Ossman <8b64f2aeec7ea42cd6838e5b2901f7aa61dfa5d4@drzeus.cx>

--- drivers/mmc/host/atmel-mci.c
+++ drivers/mmc/host/atmel-mci.c
@@ -812,7 +812,7 @@
 		slot->sdc_reg |= MCI_SDCBUS_1BIT;
 		break;
 	case MMC_BUS_WIDTH_4:
-		slot->sdc_reg = MCI_SDCBUS_4BIT;
+		slot->sdc_reg |= MCI_SDCBUS_4BIT;
 		break;
 	}