Rename a few Z39.50 specific funcs

Rename a few Z39.50 specific funcs

--- client/client.c
+++ client/client.c
@@ -326,7 +326,7 @@

 /* INIT SERVICE ------------------------------- */

-static void send_initRequest(const char* type_and_host)
+static void send_Z3950_initRequest(const char* type_and_host)
 {
     Z_APDU *apdu = zget_APDU(out, Z_APDU_initRequest);
     Z_InitRequest *req = apdu->u.initRequest;
@@ -375,7 +375,6 @@
 }

-/* These two are used only from process_initResponse() */
 static void render_initUserInfo(Z_OtherInformation *ui1);
 static void render_diag(Z_DiagnosticFormat *diag);

@@ -384,7 +383,7 @@
     printf(" %s", opt);
 }

-static int process_initResponse(Z_InitResponse *res)
+static int process_Z3950_initResponse(Z_InitResponse *res)
 {
     int ver = 0;
     /* save session parameters for later use */
@@ -733,7 +732,7 @@
     cs_print_session_info(conn);
     if (protocol == PROTO_Z3950)
     {
-        send_initRequest(type_and_host);
+        send_Z3950_initRequest(type_and_host);
         return 2;
     }
     return 0;
@@ -1179,7 +1178,7 @@
     }
 }

-static int send_deleteResultSetRequest(const char *arg)
+static int send_Z3950_deleteResultSetRequest(const char *arg)
 {
     char names[8][32];
     int i;
@@ -1391,7 +1390,7 @@
     /* regular requestse .. */
     sr = yaz_srw_get_pdu(out, Z_SRW_scan_request, sru_version);

-    switch(queryType)
+    switch (queryType)
     {
     case QueryType_CQL:
         sr->u.scan_request->query_type = Z_SRW_query_type_cql;
@@ -1430,7 +1429,7 @@
     /* regular request .. */
     sr = yaz_srw_get_pdu(out, Z_SRW_searchRetrieve_request, sru_version);

-    switch(queryType)
+    switch (queryType)
     {
     case QueryType_CQL:
         srw_sr->u.request->query_type = Z_SRW_query_type_cql;
@@ -1476,7 +1475,7 @@
     }
 }

-static int send_searchRequest(const char *arg)
+static int send_Z3950_searchRequest(const char *arg)
 {
     Z_APDU *apdu = zget_APDU(out, Z_APDU_searchRequest);
     Z_SearchRequest *req = apdu->u.searchRequest;
@@ -1748,7 +1747,7 @@
     }
 }

-static int process_searchResponse(Z_SearchResponse *res)
+static int process_Z3950_searchResponse(Z_SearchResponse *res)
 {
     printf("Received SearchResponse.\n");
     print_refid(res->referenceId);
@@ -1764,7 +1763,7 @@
     if (res->resultSetStatus)
     {
         printf("Result Set Status: ");
-        switch(*res->resultSetStatus)
+        switch (*res->resultSetStatus)
         {
         case Z_SearchResponse_subset:
             printf("subset"); break;
@@ -1953,7 +1952,7 @@
     }
 }

-static int process_resourceControlRequest(Z_ResourceControlRequest *req)
+static int process_Z3950_resourceControlRequest(Z_ResourceControlRequest *req)
 {
     printf("Received ResourceControlRequest.\n");
     print_referenceId(1, req->referenceId);
@@ -1965,7 +1964,7 @@
     return 0;
 }

-static void process_ESResponse(Z_ExtendedServicesResponse *res)
+static void process_Z3950_ESResponse(Z_ExtendedServicesResponse *res)
 {
     printf("Status: ");
     switch (*res->operationStatus)
@@ -2244,8 +2243,8 @@
     return r;
 }

-static int send_itemorder(const char *type, int itemno,
-                          const char *xml_buf, int xml_len)
+static int send_Z3950_itemorder(const char *type, int itemno,
+                                const char *xml_buf, int xml_len)
 {
     Z_APDU *apdu = zget_APDU(out, Z_APDU_extendedServicesRequest);
     Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest;
@@ -2288,11 +2287,11 @@
     return cmd_update_common(arg, 0);
 }

-static int cmd_update_Z3950(int version, int action_no, const char *recid,
+static int send_Z3950_update(int version, int action_no, const char *recid,
                             char *rec_buf, int rec_len);

 #if YAZ_HAVE_XML2
-static int cmd_update_SRW(int action_no, const char *recid,
+static int send_SRW_update(int action_no, const char *recid,
                           char *rec_buf, int rec_len);
 #endif

@@ -2347,14 +2346,14 @@

 #if YAZ_HAVE_XML2
     if (protocol == PROTO_HTTP)
-        return cmd_update_SRW(action_no, recid_buf, rec_buf, rec_len);
+        return send_SRW_update(action_no, recid_buf, rec_buf, rec_len);
 #endif
-    return cmd_update_Z3950(version, action_no, recid_buf, rec_buf, rec_len);
+    return send_Z3950_update(version, action_no, recid_buf, rec_buf, rec_len);
 }

 #if YAZ_HAVE_XML2
-static int cmd_update_SRW(int action_no, const char *recid,
-                          char *rec_buf, int rec_len)
+static int send_SRW_update(int action_no, const char *recid,
+                           char *rec_buf, int rec_len)
 {
     if (!conn)
         session_connect(cur_host);
@@ -2365,7 +2364,7 @@
         Z_SRW_PDU *srw = yaz_srw_get(out, Z_SRW_update_request);
         Z_SRW_updateRequest *sr = srw->u.update_request;

-        switch(action_no)
+        switch (action_no)
         {
         case Z_IUOriginPartToKeep_recordInsert:
             sr->operation = "info:srw/action/1/create";
@@ -2391,7 +2390,7 @@
 }
 #endif

-static int cmd_update_Z3950(int version, int action_no, const char *recid,
+static int send_Z3950_update(int version, int action_no, const char *recid,
                             char *rec_buf, int rec_len)
 {
     Z_APDU *apdu = zget_APDU(out, Z_APDU_extendedServicesRequest );
@@ -2593,7 +2592,7 @@
     parse_cmd_doc(&arg, out, &xml_buf, &xml_len);

     fflush(stdout);
-    send_itemorder(type, itemno, xml_buf, xml_len);
+    send_Z3950_itemorder(type, itemno, xml_buf, xml_len);
     return 2;
 }

@@ -2663,7 +2662,7 @@
     }
     if (only_z3950())
         return 1;
-    send_initRequest(cur_host);
+    send_Z3950_initRequest(cur_host);
     return 2;
 }

@@ -2850,7 +2849,7 @@
             {
                 if (conn)
                 {
-                    if (!send_searchRequest(arg))
+                    if (!send_Z3950_searchRequest(arg))
                         return 0;
                     wait_and_handle_response(0);
                     if (conn)
@@ -2868,7 +2867,7 @@
         }
         else if (conn)
         {
-            if (!send_searchRequest(arg))
+            if (!send_Z3950_searchRequest(arg))
                 return 0;
         }
         else
@@ -2916,7 +2915,7 @@
 {
     if (only_z3950())
         return 0;
-    if (!send_deleteResultSetRequest(arg))
+    if (!send_Z3950_deleteResultSetRequest(arg))
         return 0;
     return 2;
 }
@@ -3020,7 +3019,7 @@
     return 1;
 }

-static int send_presentRequest(const char *arg)
+static int send_Z3950_presentRequest(const char *arg)
 {
     Z_APDU *apdu = zget_APDU(out, Z_APDU_presentRequest);
     Z_PresentRequest *req = apdu->u.presentRequest;
@@ -3146,7 +3145,7 @@
     last_hit_count = 0;
 }

-static void process_close(Z_Close *req)
+static void process_Z3950_close(Z_Close *req)
 {
     Z_APDU *apdu = zget_APDU(out, Z_APDU_close);
     Z_Close *res = apdu->u.close;
@@ -3200,7 +3199,7 @@
             printf("Not connected yet\n");
             return 0;
         }
-        if (!send_presentRequest(arg))
+        if (!send_Z3950_presentRequest(arg))
             return 0;
     }
     return 2;
@@ -3224,38 +3223,46 @@

 static int cmd_cancel(const char *arg)
 {
-    Z_APDU *apdu = zget_APDU(out, Z_APDU_triggerResourceControlRequest);
-    Z_TriggerResourceControlRequest *req =
-        apdu->u.triggerResourceControlRequest;
-    bool_t rfalse = 0;
-    char command[16];
-
-    *command = '\0';
-    sscanf(arg, "%15s", command);
-
     if (only_z3950())
         return 0;
-    if (session_initResponse &&
-        !ODR_MASK_GET(session_initResponse->options,
-                      Z_Options_triggerResourceCtrl))
-    {
-        printf("Target doesn't support cancel (trigger resource ctrl)\n");
+    else
+    {
+        Z_APDU *apdu = zget_APDU(out, Z_APDU_triggerResourceControlRequest);
+        Z_TriggerResourceControlRequest *req =
+            apdu->u.triggerResourceControlRequest;
+        bool_t rfalse = 0;
+        char command[16];
+
+        *command = '\0';
+        sscanf(arg, "%15s", command);
+
+        if (only_z3950())
+            return 0;
+        if (session_initResponse &&
+            !ODR_MASK_GET(session_initResponse->options,
+                          Z_Options_triggerResourceCtrl))
+        {
+            printf("Target doesn't support cancel (trigger resource ctrl)\n");
+            return 0;
+        }
+        *req->requestedAction = Z_TriggerResourceControlRequest_cancel;
+        req->resultSetWanted = &rfalse;
+        req->referenceId = set_refid(out);
+
+        send_apdu(apdu);
+        printf("Sent cancel request\n");
+        if (!strcmp(command, "wait"))
+            return 2;
+        return 1;
+    }
+}
+
+static int cmd_cancel_find(const char *arg)
+{
+    int fres;
+    if (only_z3950())
         return 0;
-    }
-    *req->requestedAction = Z_TriggerResourceControlRequest_cancel;
-    req->resultSetWanted = &rfalse;
-    req->referenceId = set_refid(out);
-
-    send_apdu(apdu);
-    printf("Sent cancel request\n");
-    if (!strcmp(command, "wait"))
-         return 2;
-    return 1;
-}
-
-static int cmd_cancel_find(const char *arg)
-{
-    int fres = cmd_find(arg);
+    fres = cmd_find(arg);
     if (fres > 0)
     {
         return cmd_cancel("");
@@ -3263,8 +3270,8 @@
     return fres;
 }

-static int send_scanrequest(const char *set,  const char *query,
-                            Odr_int pp, Odr_int num, const char *term)
+static int send_Z3950_scanrequest(const char *set,  const char *query,
+                                  Odr_int pp, Odr_int num, const char *term)
 {
     Z_APDU *apdu = zget_APDU(out, Z_APDU_scanRequest);
     Z_ScanRequest *req = apdu->u.scanRequest;
@@ -3406,7 +3413,7 @@
         printf("\n");
 }

-static void process_scanResponse(Z_ScanResponse *res)
+static void process_Z3950_scanResponse(Z_ScanResponse *res)
 {
     int i;
     Z_Entry **entries = NULL;
@@ -3440,7 +3447,7 @@
                           res->entries->num_nonsurrogateDiagnostics);
 }

-static void process_sortResponse(Z_SortResponse *res)
+static void process_Z3950_sortResponse(Z_SortResponse *res)
 {
     printf("Received SortResponse: status=");
     switch (*res->sortStatus)
@@ -3461,7 +3468,8 @@
                          res->num_diagnostics);
 }

-static void process_deleteResultSetResponse(Z_DeleteResultSetResponse *res)
+static void process_Z3950_deleteResultSetResponse(
+    Z_DeleteResultSetResponse *res)
 {
     printf("Got deleteResultSetResponse status=" ODR_INT_PRINTF "\n",
            *res->deleteOperationStatus);
@@ -3570,14 +3578,14 @@
         if (*arg)
         {
             strcpy(last_scan_query, arg);
-            if (send_scanrequest(set, arg,
-                                 scan_position, scan_size, 0) < 0)
+            if (send_Z3950_scanrequest(set, arg,
+                                       scan_position, scan_size, 0) < 0)
                 return 0;
         }
         else
         {
-            if (send_scanrequest(set, last_scan_query,
-                                 1, scan_size, last_scan_line) < 0)
+            if (send_Z3950_scanrequest(set, last_scan_query,
+                                      1, scan_size, last_scan_line) < 0)
                 return 0;
         }
         return 2;
@@ -4204,7 +4212,7 @@
         fprintf(stderr, "failed to allocate ODR streams\n");
         exit(1);
     }
-
+
     setvbuf(stdout, 0, _IONBF, 0);
     if (apdu_file)
         odr_setprint(print, apdu_file);
@@ -4502,16 +4510,16 @@
         if (gdu->which == Z_GDU_Z3950)
         {
             Z_APDU *apdu = gdu->u.z3950;
-            switch(apdu->which)
+            switch (apdu->which)
             {
             case Z_APDU_initResponse:
-                process_initResponse(apdu->u.initResponse);
+                process_Z3950_initResponse(apdu->u.initResponse);
                 break;
             case Z_APDU_searchResponse:
-                process_searchResponse(apdu->u.searchResponse);
+                process_Z3950_searchResponse(apdu->u.searchResponse);
                 break;
             case Z_APDU_scanResponse:
-                process_scanResponse(apdu->u.scanResponse);
+                process_Z3950_scanResponse(apdu->u.scanResponse);
                 break;
             case Z_APDU_presentResponse:
                 print_refid(apdu->u.presentResponse->referenceId);
@@ -4525,23 +4533,23 @@
                         *apdu->u.presentResponse->nextResultSetPosition);
                 break;
             case Z_APDU_sortResponse:
-                process_sortResponse(apdu->u.sortResponse);
+                process_Z3950_sortResponse(apdu->u.sortResponse);
                 break;
             case Z_APDU_extendedServicesResponse:
                 printf("Got extended services response\n");
-                process_ESResponse(apdu->u.extendedServicesResponse);
+                process_Z3950_ESResponse(apdu->u.extendedServicesResponse);
                 break;
             case Z_APDU_close:
                 printf("Target has closed the association.\n");
-                process_close(apdu->u.close);
+                process_Z3950_close(apdu->u.close);
                 break;
             case Z_APDU_resourceControlRequest:
-                process_resourceControlRequest
-                    (apdu->u.resourceControlRequest);
+                process_Z3950_resourceControlRequest(
+                    apdu->u.resourceControlRequest);
                 break;
             case Z_APDU_deleteResultSetResponse:
-                process_deleteResultSetResponse(apdu->u.
-                                                deleteResultSetResponse);
+                process_Z3950_deleteResultSetResponse(
+                    apdu->u.deleteResultSetResponse);
                 break;
             default:
                 printf("Received unknown APDU type (%d).\n",


Avoid double display of SRU/SRW records (bug #2798).

--- client/client.c
+++ client/client.c
@@ -3914,11 +3914,6 @@
     printf("\n");
     if (rec->recordData_buf && rec->recordData_len)
     {
-        if (fwrite(rec->recordData_buf, 1, rec->recordData_len, stdout) !=
-            (size_t) (rec->recordData_len))
-        {
-            printf("write to stdout failed\n");
-        }
         printf("%.*s", rec->recordData_len, rec->recordData_buf);
         marc_file_write(rec->recordData_buf, rec->recordData_len);
     }


Revert "- test commit"

Revert "- test commit"

This reverts commit 03962a6a028c5944cb86e69963d6695d2d0437f0.

--- TRD/AliTRDgtuParam.h
+++ TRD/AliTRDgtuParam.h
@@ -1,5 +1,3 @@
-
-
 #ifndef ALITRDGTUPARAM_H
 #define ALITRDGTUPARAM_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *


Dummy methods to make it work with new TVirtualMC added.

--- TRD/AliTRDsimpleMC.h
+++ TRD/AliTRDsimpleMC.h
@@ -217,6 +217,13 @@
     virtual void InitLego() {}
     virtual void Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&) {}
     virtual void Gspart(Int_t, const char*, Int_t, Double_t, Double_t, Double_t) {}
+    virtual void DefineParticle(int, const char*, TMCParticleType, double, double, double);
+    virtual void DefineIon(const char*, int, int, int, double, double);
+    virtual TString  ParticleName(int) const {return "";}
+    virtual Double_t ParticleMass(int) const {return 0.;}
+    virtual Double_t ParticleCharge(int) const {return 0.;}
+    virtual Double_t ParticleLifeTime(int) const {return 0.;}
+    virtual TMCParticleType ParticleMCType(int) const {return (TMCParticleType) 0;}

   // Control Methods
   virtual void          Init()                                                            { };


more verbose output

more verbose output

git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@5753 3d70eeeb-363e-0410-a505-8a46323a89f2

--- Testing/nrrd/tskip.c
+++ Testing/nrrd/tskip.c
@@ -114,8 +114,8 @@
   refCRC = nrrdCRC32(nref, airEndianBig);
   printf("%u\n", refCRC);

+  /* write data, with padding */
   printf("saving data . . . "); fflush(stdout);
-  /* write padded data */
   if (!(fout = fopen(outS[0], "wb"))) {
     fprintf(stderr, "%s: couldn't open %s for writing: %s\n", me,
             outS[0], strerror(errno));
@@ -143,6 +143,7 @@
   printf("\n");

   /* write header; for now just writing the header directly */
+  printf("writing header . . . \n");
   if (!(fout = fopen(outS[1], "w"))) {
     fprintf(stderr, "%s: couldn't open %s for writing: %s\n", me,
             outS[1], strerror(errno));


Add main.c.

Add main.c.

error: pathspec 'system/main.c' did not match any file(s) known to git

--- system/main.c
+++ system/main.c
@@ -0,0 +1,29 @@
+/*
+ *
+ *  JUMA.IO - JUMA SDK for STM families
+ *
+ *  Copyright (C) 2013-2016  JUMA Technology
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the Apache V2 License as published by
+ *  the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+#include "bsp_common.h"
+
+int main(void)
+{
+		bsp_init();
+    dispatch_init();
+    on_ready();
+    while(1)
+		{
+        HCI_Process();
+        dispatch();
+    }
+}
+


Make the FakeWebRtcVideoCaptureModule class initialize frame data.

Needed to avoid DrMemory warnings, if the frame is passed to libyuv
AVX assembly functions.

BUG=libyuv:377

Review-Url: https://codereview.webrtc.org/1985693002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#12765}

--- webrtc/media/engine/fakewebrtcvideocapturemodule.h
+++ webrtc/media/engine/fakewebrtcvideocapturemodule.h
@@ -87,11 +87,16 @@

   void SendFrame(int w, int h) {
     if (!running_) return;
-    webrtc::VideoFrame sample;
-    // Setting stride based on width.
-    sample.CreateEmptyFrame(w, h, w, (w + 1) / 2, (w + 1) / 2);
+
+    rtc::scoped_refptr<webrtc::I420Buffer> buffer =
+        new rtc::RefCountedObject<webrtc::I420Buffer>(w, h);
+    // Initialize memory to satisfy DrMemory tests. See
+    // https://bugs.chromium.org/p/libyuv/issues/detail?id=377
+    buffer->InitializeData();
     if (callback_) {
-      callback_->OnIncomingCapturedFrame(id_, sample);
+      callback_->OnIncomingCapturedFrame(
+          id_,
+          webrtc::VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0));
     }
   }


Revert of Added kNotAProbe definiton to PacketInfo. (patchset #1 id:1 of https://codereview.chromium.org/2697383004/ )

Reason for revert:
Downstream fix landed.

Original issue's description:
> Added kNotAProbe definiton to PacketInfo.
>
> BUG=none
> NOTRY=True
> TBR=nisse@webrtc.org, stefan@webrtc.org
>
> Review-Url: https://codereview.webrtc.org/2697383004
> Cr-Commit-Position: refs/heads/master@{#16668}
> Committed: https://chromium.googlesource.com/external/webrtc/+/4db68e609b21644cc828d62440d5151b03a8834d

TBR=nisse@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=none

Review-Url: https://codereview.webrtc.org/2706823003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#16735}

--- webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h
+++ webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h
@@ -278,8 +278,6 @@
         payload_size(payload_size),
         probe_cluster_id(probe_cluster_id) {}

-  static constexpr int kNotAProbe = -1;
-
   // Time corresponding to when this object was created.
   int64_t creation_time_ms;
   // Time corresponding to when the packet was received. Timestamped with the


suppress clang warning

suppress clang warning

--- Rpkg/src/hashtable/hash.h
+++ Rpkg/src/hashtable/hash.h
@@ -173,7 +173,7 @@
 __attribute__ ((__gnu_inline__))
 #endif
 #endif
-const struct sylcount *
+static const struct sylcount *
 in_word_set (str, len)
      register const char *str;
      register unsigned int len;


Check for bad intel driver

Check for bad intel driver

--- Samples/Teapots/Helpers.h
+++ Samples/Teapots/Helpers.h
@@ -56,7 +56,7 @@
 {
     uint32_t count = 0;
     vkEnumeratePhysicalDevices(instance, &count, nullptr);
-
+    if(!count) LOGW("No devices found by: 'vkEnumeratePhysicalDevices'.\n");
     phys.resize(count);
     return vkEnumeratePhysicalDevices(instance, &count, phys.data());
 }


more doc cleanup

more doc cleanup

--- Source/CWErrorUtilities.h
+++ Source/CWErrorUtilities.h
@@ -77,8 +77,8 @@
  NSError object to the console. It creates a NSError object and then logs its
  description with CWLogError().

- @param domain a NSString specifying the domain for a NSError object
- @param errorCode a NSInteger for the error code in a NSError object
+ @param domain the domain for a NSError object
+ @param errorCode the error code in a NSError object
  @param errorMessageFormat string formatting for NSLocalizedDescriptionKey
  */
 void CWLogErrorInfo(NSString * domain,
@@ -91,8 +91,8 @@
  This allows creating an error and safely setting it wihtout worrying about
  checking for non nil value before setting the pointer.

- @param domain a NSString specifying the domain for a NSError object
- @param errorCode a NSInteger for the error code in a NSError object
+ @param domain the domain for a NSError object
+ @param errorCode the error code in a NSError object
  @param errorMessageFormat string formatting for NSLocalizedDescriptionKey
  @param error the NSError reference to set
  */
@@ -108,8 +108,8 @@
  checking for non nil value before setting the pointer. This method also allows
  you to set additional values in the user info dictionary if needed.

- @param domain a NSString specifying the domain for a NSError object
- @param errorCode a NSInteger for the error code in a NSError object
+ @param domain the domain for a NSError object
+ @param errorCode the error code in a NSError object
  @param errorMessageFormat string formatting for NSLocalizedDescriptionKey
  @param error the NSError reference to set
  */


Well, and then there was backwards compatibility…

--- Source/SPDatabaseAction.h
+++ Source/SPDatabaseAction.h
@@ -32,6 +32,11 @@
 @class SPMySQLConnection;

 @interface SPCreateDatabaseInfo : NSObject
+{
+	NSString *databaseName;
+	NSString *defaultEncoding;
+	NSString *defaultCollation;
+}

 @property (readwrite,retain) NSString *databaseName;
 @property (readwrite,retain) NSString *defaultEncoding;


Add Card Name for more Cards using defines from SNAP H file.

Signed-off-by: Eberhard S. Amann <abf3c3727151683d37ede95f5333c0b4875fd19d@de.ibm.com>

--- actions/hdl_nvme_example/sw/snap_nvme_example.c
+++ actions/hdl_nvme_example/sw/snap_nvme_example.c
@@ -603,9 +603,11 @@
 	snap_card_ioctl(dn, GET_CARD_TYPE, (unsigned long)&ioctl_data);
 	VERBOSE1("SNAP on ");
 	switch (ioctl_data) {
-		case 0: VERBOSE1("ADKU3"); break;
-		case 1: VERBOSE1("N250S"); break;
-		case 8: VERBOSE1("N250SP"); break;
+		case ADKU3_CARD:  VERBOSE1("ADKU3"); break;
+		case S121B_CARD:  VERBOSE1("S121B"); break;
+		case AD8K5_CARD:  VERBOSE1("AD8K5"); break;
+		case N250S_CARD:  VERBOSE1("N250S"); break;
+		case N250SP_CARD: VERBOSE1("N250SP"); break;
 		default: VERBOSE1("Unknown"); break;
 	}
 	snap_card_ioctl(dn, GET_SDRAM_SIZE, (unsigned long)&ioctl_data);


fixing test compilation

fixing test compilation

Former-commit-id: 4681c40b9c5cd5d7f3478b338f0154aa787c24f7

--- applications/plugins/SofaTest/ForceField_test.h
+++ applications/plugins/SofaTest/ForceField_test.h
@@ -182,7 +182,7 @@
         copyFromData( curF, dof->readForces() );

         // Get potential Energy before applying a displacement to dofs
-        double potentialEnergyBeforeDisplacement = force->getPotentialEnergy(&mparams, *mparams.readX(force->getMState()));
+        double potentialEnergyBeforeDisplacement = ((const core::behavior::BaseForceField*)force.get())->getPotentialEnergy(&mparams);

         // change position
         VecDeriv dX(n);
@@ -202,7 +202,7 @@
         }

         // Get potential energy after displacement of dofs
-        double potentialEnergyAfterDisplacement = force->getPotentialEnergy(&mparams, *mparams.readX(force->getMState()));
+        double potentialEnergyAfterDisplacement = ((const core::behavior::BaseForceField*)force.get())->getPotentialEnergy(&mparams);

         // Check getPotentialEnergy() we should have dE = -dX.F


msm: board-8930: Do not send PM8917 LDO 1 regulator request to RPM

Modify the PM8917 LDO 1 configuration data so that no request
is sent automatically to enable LDO 1 on MSM8930 + PM8917
targets.  This is an optimization which helps to achieve power
savings during XO shutdown.

Change-Id: I87f89b03c43e60727737f22205745a4c911a14df
Signed-off-by: David Collins <0dc5b64a0a004c3a10b37a64ec99148749baaf8b@codeaurora.org>


examples/spi_master: Fixed SPI read (keeping CS active) in SPI master example

Closes https://github.com/espressif/esp-idf/issues/8652

--- examples/peripherals/spi_master/lcd/main/spi_master_example_main.c
+++ examples/peripherals/spi_master/lcd/main/spi_master_example_main.c
@@ -184,7 +184,7 @@
  * mode for higher speed. The overhead of interrupt transactions is more than
  * just waiting for the transaction to complete.
  */
-void lcd_cmd(spi_device_handle_t spi, const uint8_t cmd)
+void lcd_cmd(spi_device_handle_t spi, const uint8_t cmd, bool keep_cs_active)
 {
     esp_err_t ret;
     spi_transaction_t t;
@@ -192,6 +192,9 @@
     t.length=8;                     //Command is 8 bits
     t.tx_buffer=&cmd;               //The data is the cmd itself
     t.user=(void*)0;                //D/C needs to be set to 0
+    if (keep_cs_active) {
+      t.flags = SPI_TRANS_CS_KEEP_ACTIVE;   //Keep CS active after data transfer
+    }
     ret=spi_device_polling_transmit(spi, &t);  //Transmit!
     assert(ret==ESP_OK);            //Should have had no issues.
 }
@@ -226,8 +229,11 @@

 uint32_t lcd_get_id(spi_device_handle_t spi)
 {
+    // When using SPI_TRANS_CS_KEEP_ACTIVE, bus must be locked/acquired
+    spi_device_acquire_bus(spi, portMAX_DELAY);
+
     //get_id cmd
-    lcd_cmd(spi, 0x04);
+    lcd_cmd(spi, 0x04, true);

     spi_transaction_t t;
     memset(&t, 0, sizeof(t));
@@ -237,6 +243,9 @@

     esp_err_t ret = spi_device_polling_transmit(spi, &t);
     assert( ret == ESP_OK );
+
+    // Release bus
+    spi_device_release_bus(spi);

     return *(uint32_t*)t.rx_data;
 }
@@ -293,7 +302,7 @@

     //Send all the commands
     while (lcd_init_cmds[cmd].databytes!=0xff) {
-        lcd_cmd(spi, lcd_init_cmds[cmd].cmd);
+        lcd_cmd(spi, lcd_init_cmds[cmd].cmd, false);
         lcd_data(spi, lcd_init_cmds[cmd].data, lcd_init_cmds[cmd].databytes&0x1F);
         if (lcd_init_cmds[cmd].databytes&0x80) {
             vTaskDelay(100 / portTICK_PERIOD_MS);


Don't try to do context things if there are no attrs

--- gridftp/network_manager/xio_driver/globus_xio_net_manager_driver.c
+++ gridftp/network_manager/xio_driver/globus_xio_net_manager_driver.c
@@ -832,9 +832,13 @@
     globus_net_manager_attr_t          *transport_attrs = NULL,
                                        *new_attrs = NULL;
     globus_l_xio_net_manager_server_t  *server = NULL;
-    char                               *new_contact_string;
+    char                               *new_contact_string = NULL;
     globus_xio_contact_t                new_contact_info = {0};

+    if (!driver_attr)
+    {
+        goto no_attr;
+    }
     server = malloc(sizeof(globus_l_xio_net_manager_server_t));
     if (!server)
     {
@@ -860,14 +864,6 @@
         if (result)
         {
             goto copy_attr_fail;
-        }
-    }
-    else
-    {
-        result = globus_l_xio_net_manager_attr_init((void **) &server->attr);
-        if (result)
-        {
-            goto init_attr_fail;
         }
     }

@@ -924,6 +920,7 @@
         }
     }

+no_attr:
     result = globus_xio_driver_pass_server_init(
         op,
         new_contact_info.unparsed ? &new_contact_info : contact_info,
@@ -990,6 +987,10 @@
     globus_l_xio_net_manager_link_t    *link = NULL;
     globus_net_manager_attr_t          *new_attr_array = NULL;

+    if (! server)
+    {
+        goto no_server;
+    }
     result = globus_net_manager_context_pre_accept(
         server->attr->context,
         server->attr->task_id,
@@ -1042,12 +1043,13 @@
         new_attr_array = NULL;
     }

+no_server:
     result = globus_xio_driver_pass_accept(
             op,
             globus_l_xio_net_manager_server_accept_callback,
             link);

-    if (result)
+    if (result != GLOBUS_SUCCESS && link != NULL)
     {
         globus_l_xio_net_manager_attr_destroy(link->attr);
 attr_copy_fail:
@@ -1315,6 +1317,10 @@
     {
         goto failed_accept;
     }
+    if (link == NULL)
+    {
+        goto no_link;
+    }
     handle = malloc(sizeof(globus_l_xio_net_manager_handle_t));
     if (handle == NULL)
     {
@@ -1344,20 +1350,8 @@
         goto get_remote_contact_fail;
     }

-    if (link->attr)
-    {
-        handle->attr = link->attr;
-        link->attr = NULL;
-    }
-    else
-    {
-        result = globus_l_xio_net_manager_attr_init(
-                (void **) &handle->attr);
-        if (result != GLOBUS_SUCCESS)
-        {
-            goto attr_copy_fail;
-        }
-    }
+    handle->attr = link->attr;
+    link->attr = NULL;

     result = globus_xio_driver_attr_cntl(
         op,
@@ -1422,6 +1416,7 @@
         handle = NULL;
     }
 malloc_handle_fail:
+no_link:
 failed_accept:
     globus_xio_driver_finished_open(handle, op, result);
 }
@@ -1458,7 +1453,7 @@
 {
     globus_result_t                     result = GLOBUS_SUCCESS;

-    if (driver_link == NULL)
+    if (contact_info->unparsed != NULL)
     {
         result = globus_l_xio_net_manager_connect(
                 contact_info,
@@ -1486,6 +1481,10 @@
 {
     globus_l_xio_net_manager_handle_t  *handle = user_arg;

+    if (!handle)
+    {
+        goto no_handle;
+    }
     if (result == GLOBUS_SUCCESS)
     {
         result = globus_net_manager_context_post_close(
@@ -1501,6 +1500,7 @@
     free(handle->remote_contact);
     free(handle->local_contact);
     free(handle);
+no_handle:
     globus_xio_driver_finished_close(op, result);
 }

@@ -1517,6 +1517,10 @@
     globus_xio_driver_handle_t          driver_handle =
             globus_xio_operation_get_driver_handle(op);

+    if (!handle)
+    {
+        goto no_handle;
+    }
     result = globus_l_xio_net_manager_get_handle_attr_array(
             op,
             handle->transport_driver,
@@ -1542,6 +1546,7 @@
         goto pre_close_fail;
     }

+no_handle:
     result = globus_xio_driver_pass_close(
         op, globus_l_xio_net_manager_close_cb, handle);


Base: Add some more missing includes in volumevoronoi algorithm

--- modules/base/include/modules/base/algorithm/volume/volumevoronoi.h
+++ modules/base/include/modules/base/algorithm/volume/volumevoronoi.h
@@ -33,6 +33,8 @@
 #include <inviwo/core/datastructures/volume/volumeramprecision.h>
 #include <inviwo/core/util/indexmapper.h>
 #include <inviwo/core/util/glm.h>
+#include <inviwo/core/util/zip.h>
+#include <inviwo/core/util/volumeramutils.h>
 #include <vector>

 namespace inviwo {


Fix building on POSIX

Fix building on POSIX

--- atom/browser/browser.h
+++ atom/browser/browser.h
@@ -11,12 +11,12 @@
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
 #include "base/observer_list.h"
+#include "base/strings/string16.h"
 #include "atom/browser/browser_observer.h"
 #include "atom/browser/window_list_observer.h"

 #if defined(OS_WIN)
 #include "base/files/file_path.h"
-#include "base/strings/string16.h"
 #endif

 namespace base {


[PATCH] Remove duplicate symbol exports on Alpha

WARNING: vmlinux: 'enable_irq' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'disable_irq' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'disable_irq_nosync' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'probe_irq_mask' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'sys_open' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'sys_read' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'strstr' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'memscan' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'memcmp' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'strnlen' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'strncmp' exported twice. Previous export was in vmlinux
WARNING: vmlinux: 'strcmp' exported twice. Previous export was in vmlinux

Signed-off-by: Mathieu Chouquet-Stringer <da3d8a3344339e526fe2a53e02548e772bd1126f@free.fr>
Cc: Richard Henderson <aea4fd857e97ee7d33f60175ba9388a955b9d916@twiddle.net>
Cc: Ivan Kokshaysky <ec437ab60af367f0fec0f6a3cd47f9cbad7b487f@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- arch/alpha/kernel/alpha_ksyms.c
+++ arch/alpha/kernel/alpha_ksyms.c
@@ -53,10 +53,6 @@
 extern void __remqu (void);

 EXPORT_SYMBOL(alpha_mv);
-EXPORT_SYMBOL(enable_irq);
-EXPORT_SYMBOL(disable_irq);
-EXPORT_SYMBOL(disable_irq_nosync);
-EXPORT_SYMBOL(probe_irq_mask);
 EXPORT_SYMBOL(screen_info);
 EXPORT_SYMBOL(perf_irq);
 EXPORT_SYMBOL(callback_getenv);
@@ -68,19 +64,13 @@

 /* platform dependent support */
 EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strcmp);
 EXPORT_SYMBOL(strcpy);
 EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strncmp);
 EXPORT_SYMBOL(strncpy);
-EXPORT_SYMBOL(strnlen);
 EXPORT_SYMBOL(strncat);
-EXPORT_SYMBOL(strstr);
 EXPORT_SYMBOL(strchr);
 EXPORT_SYMBOL(strrchr);
-EXPORT_SYMBOL(memcmp);
 EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(memscan);
 EXPORT_SYMBOL(__memcpy);
 EXPORT_SYMBOL(__memset);
 EXPORT_SYMBOL(__memsetw);
@@ -122,11 +112,9 @@

 /* In-kernel system calls.  */
 EXPORT_SYMBOL(kernel_thread);
-EXPORT_SYMBOL(sys_open);
 EXPORT_SYMBOL(sys_dup);
 EXPORT_SYMBOL(sys_exit);
 EXPORT_SYMBOL(sys_write);
-EXPORT_SYMBOL(sys_read);
 EXPORT_SYMBOL(sys_lseek);
 EXPORT_SYMBOL(execve);
 EXPORT_SYMBOL(sys_setsid);


ARM: EXYNOS: Update secondary boot addr for secure mode

Almost all Exynos-series of SoCs that run in secure mode don't need
additional offset for every CPU, with Exynos4412 being the only
exception.

Tested on Origen-Quad (Exynos4412) and Arndale-Octa (Exynos5420).

While at it, fix the coding style (space around *).

Signed-off-by: Sachin Kamat <1c3b1584a6008857f36c03c58f657c0fc16fc09e@linaro.org>
Signed-off-by: Tushar Behera <23164e61763db67ca52e6268847d2536aec6eaa9@linaro.org>
Tested-by: Andreas Faerber <e2dd33448c0d502d92fa832c8b393532a3b3f74b@suse.de>
Signed-off-by: Kukjin Kim <3fc711f4e08bc570a586748633ff7c76d0e1e253@samsung.com>


MIPS: Alchemy: Make 32kHz and r4k timer coexist peacefully

Now that the r4k timer is registered no matter what, bump the rating of
the Alchemy 32kHz timer so that it gets used when it is working,
and fall back on the r4k when it isn't.

This fixes a timer-related hang on platform with a working 32kHz timer
(the better rated c0 timer stops while executing 'wait' leading to (almost)
eternal sleep) and an oops on boot on platforms without a working 32kHz
timer (due to double registration of the r4k timer).

Signed-off-by: Manuel Lauss <a1f4ff295e0f8cc346fc4937c19496e21c351f53@gmail.com>
Cc:  Linux-MIPS <562397917b9a8bf316569a848858b12fb417723f@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/4728/
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

--- arch/mips/alchemy/common/time.c
+++ arch/mips/alchemy/common/time.c
@@ -53,7 +53,7 @@
 	.read		= au1x_counter1_read,
 	.mask		= CLOCKSOURCE_MASK(32),
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
-	.rating		= 100,
+	.rating		= 1500,
 };

 static int au1x_rtcmatch2_set_next_event(unsigned long delta,
@@ -84,7 +84,7 @@
 static struct clock_event_device au1x_rtcmatch2_clockdev = {
 	.name		= "rtcmatch2",
 	.features	= CLOCK_EVT_FEAT_ONESHOT,
-	.rating		= 100,
+	.rating		= 1500,
 	.set_next_event	= au1x_rtcmatch2_set_next_event,
 	.set_mode	= au1x_rtcmatch2_set_mode,
 	.cpumask	= cpu_all_mask,
@@ -158,20 +158,6 @@
 	return -1;
 }

-static void __init alchemy_setup_c0timer(void)
-{
-	/*
-	 * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this
-	 * function is called.  Because the Alchemy counters are unusable
-	 * the C0 timekeeping code is installed and use of the 'wait'
-	 * instruction must be prohibited, which is done most easily by
-	 * assigning NULL to cpu_wait.
-	 */
-	cpu_wait = NULL;
-	r4k_clockevent_init();
-	init_r4k_clocksource();
-}
-
 static int alchemy_m2inttab[] __initdata = {
 	AU1000_RTC_MATCH2_INT,
 	AU1500_RTC_MATCH2_INT,
@@ -186,8 +172,7 @@
 	int t;

 	t = alchemy_get_cputype();
-	if (t == ALCHEMY_CPU_UNKNOWN)
-		alchemy_setup_c0timer();
-	else if (alchemy_time_init(alchemy_m2inttab[t]))
-		alchemy_setup_c0timer();
+	if (t == ALCHEMY_CPU_UNKNOWN ||
+	    alchemy_time_init(alchemy_m2inttab[t]))
+		cpu_wait = NULL;	/* wait doesn't work with r4k timer */
 }


[MIPS] Alchemy: fix off by two error in __fixup_bigphys_addr()

the PCI specific code in this function doesn't check for the address range
being under the upper bound of the PCI memory window correctly -- fix this,
somewhat beautifying the code around the check, while at it...

Signed-off-by: Sergei Shtylyov <38a867ea26f35d3eeb42270f1bc7b9d1d135e6a2@ru.mvista.com>
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

--- arch/mips/au1000/common/setup.c
+++ arch/mips/au1000/common/setup.c
@@ -137,12 +137,11 @@

 #ifdef CONFIG_PCI
 	{
-		u32 start, end;
+		u32 start = (u32)Au1500_PCI_MEM_START;
+		u32 end   = (u32)Au1500_PCI_MEM_END;

-		start = (u32)Au1500_PCI_MEM_START;
-		end = (u32)Au1500_PCI_MEM_END;
-		/* check for pci memory window */
-		if ((phys_addr >= start) && ((phys_addr + size) < end))
+		/* Check for PCI memory window */
+		if (phys_addr >= start && (phys_addr + size - 1) <= end)
 			return (phys_t)
 			       ((phys_addr - start) + Au1500_PCI_MEM_START);
 	}


fix guard; Franco Fichtner

fix guard; Franco Fichtner

--- arch/octeon/include/octeonreg.h
+++ arch/octeon/include/octeonreg.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: octeonreg.h,v 1.1 2013/06/02 20:29:36 jasper Exp $	*/
+/*	$OpenBSD: octeonreg.h,v 1.2 2013/06/09 20:20:11 deraadt Exp $	*/

 /*
  * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.com).
@@ -27,7 +27,7 @@
  */

 #ifndef _MACHINE_OCTEONREG_H_
-#define _MACHINE_OCTEONREG_H
+#define _MACHINE_OCTEONREG_H_

 #define OCTEON_CF_BASE		0x1D000800ULL
 #define OCTEON_CIU_BASE		0x1070000000000ULL


[POWERPC] Export copy_page() on 32bit

[POWERPC] Export copy_page() on 32bit

Export copy_page() on 32-bit powerpc; unionfs needs it.

Unionfs already builds as a module on 64bit powerpc, so the export is
placed within an existing CONFIG_PPC32 #ifdef.

Signed-off-by: Joseph Fannin <a224ecbf167ab4cbb5118637d1e8fdcc3b82cad6@gmail.com>
Signed-off-by: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>

--- arch/powerpc/kernel/ppc_ksyms.c
+++ arch/powerpc/kernel/ppc_ksyms.c
@@ -59,6 +59,7 @@
 extern int sys_sigreturn(struct pt_regs *regs);

 EXPORT_SYMBOL(clear_pages);
+EXPORT_SYMBOL(copy_page);
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
 EXPORT_SYMBOL(DMA_MODE_READ);
 EXPORT_SYMBOL(DMA_MODE_WRITE);


x86: coding style fixes to arch/x86/kernel/crash_dump_64.c

Fix conding style without change crash_dump_64.o

 arch/x86/kernel/crash_dump_64.o
 text    data     bss     dec     hex filename
 129       0       0     129      81 crash_dump_64.o.after
 129       0       0     129      81 crash_dump_64.o.before

md5:
885b52c1b92737e6b12e5107e90fc1f1  crash_dump_64.o.after
885b52c1b92737e6b12e5107e90fc1f1  crash_dump_64.o.before

Signed-off-by: Gustavo F. Padovan <beac5f8171fcde5e2ec734cc5d25d03e7362e8de@las.ic.unicamp.br>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- arch/x86/kernel/crash_dump_64.c
+++ arch/x86/kernel/crash_dump_64.c
@@ -7,9 +7,8 @@

 #include <linux/errno.h>
 #include <linux/crash_dump.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>

 /**
  * copy_oldmem_page - copy one page from "oldmem"
@@ -25,7 +24,7 @@
  * in the current kernel. We stitch up a pte, similar to kmap_atomic.
  */
 ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
-                               size_t csize, unsigned long offset, int userbuf)
+		size_t csize, unsigned long offset, int userbuf)
 {
 	void  *vaddr;


x86: microcode_amd: fix compile warning

x86: microcode_amd: fix compile warning

Impact: fix build warning

  CC      arch/x86/kernel/microcode_amd.o
arch/x86/kernel/microcode_amd.c: In function ‘request_microcode_fw’:
arch/x86/kernel/microcode_amd.c:393: warning: passing argument 2 of ‘generic_load_microcode’ discards qualifiers from pointer target type

(Respect "const" qualifier of firmware->data.)

Signed-off-by: Andreas Herrmann <39e536ca8269572d74bff7f8e46f22412f1aee88@amd.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- arch/x86/kernel/microcode_amd.c
+++ arch/x86/kernel/microcode_amd.c
@@ -225,8 +225,8 @@
 	uci->cpu_sig.rev = rev;
 }

-static void *get_next_ucode(u8 *buf, unsigned int size,
-			int (*get_ucode_data)(void *, const void *, size_t),
+static void *get_next_ucode(const u8 *buf, unsigned int size,
+			int (*get_ucode_data)(void *, const u8 *, size_t),
 			unsigned int *mc_size)
 {
 	unsigned int total_size;
@@ -268,8 +268,8 @@
 }

-static int install_equiv_cpu_table(u8 *buf,
-		int (*get_ucode_data)(void *, const void *, size_t))
+static int install_equiv_cpu_table(const u8 *buf,
+		int (*get_ucode_data)(void *, const u8 *, size_t))
 {
 #define UCODE_CONTAINER_HEADER_SIZE	12
 	u8 *container_hdr[UCODE_CONTAINER_HEADER_SIZE];
@@ -311,11 +311,13 @@
 	}
 }

-static int generic_load_microcode(int cpu, void *data, size_t size,
-		int (*get_ucode_data)(void *, const void *, size_t))
+static int generic_load_microcode(int cpu, const u8 *data, size_t size,
+		int (*get_ucode_data)(void *, const u8 *, size_t))
 {
 	struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
-	u8 *ucode_ptr = data, *new_mc = NULL, *mc;
+	const u8 *ucode_ptr = data;
+	void *new_mc = NULL;
+	void *mc;
 	int new_rev = uci->cpu_sig.rev;
 	unsigned int leftover;
 	unsigned long offset;
@@ -368,7 +370,7 @@
 	return (int)leftover;
 }

-static int get_ucode_fw(void *to, const void *from, size_t n)
+static int get_ucode_fw(void *to, const u8 *from, size_t n)
 {
 	memcpy(to, from, n);
 	return 0;
@@ -390,7 +392,7 @@
 		return ret;
 	}

-	ret = generic_load_microcode(cpu, (void*)firmware->data, firmware->size,
+	ret = generic_load_microcode(cpu, firmware->data, firmware->size,
 			&get_ucode_fw);

 	release_firmware(firmware);


fixed window size bug found with threadtest program

--- spu/readback/readbackspu.c
+++ spu/readback/readbackspu.c
@@ -133,7 +133,6 @@
 		/* not resizable - ask render SPU for its window size */
 		readback_spu.super.GetChromiumParametervCR(GL_WINDOW_SIZE_CR,
 					readback_spu.windows[0].renderWindow, GL_INT, 2, newSize);
-
 	}

 	if (newSize[0] != window->width || newSize[1] != window->height)
@@ -145,6 +144,8 @@
 		if (readback_spu.resizable)
 		{
 			/* update super/render SPU window size & viewport */
+			CRASSERT(newSize[0] > 0);
+			CRASSERT(newSize[1] > 0);
 			readback_spu.super.WindowSize( w, newSize[0], newSize[1] );
 			readback_spu.super.Viewport( 0, 0, newSize[0], newSize[1] );

@@ -356,6 +357,8 @@
 		 * about getting the origin right.  glDrawPixels, glClear, etc don't
 		 * care what the viewport size is.  (BrianP)
 		 */
+		CRASSERT(window->width > 0);
+		CRASSERT(window->height > 0);
 		readback_spu.child.Viewport( 0, 0, window->width, window->height );

 		/* Send glClear to child (downstream SPU) */
@@ -470,10 +473,12 @@
 	static int first_time = 1;
 	GLint packAlignment, unpackAlignment;

+	if (first_time || window->width < 1 || window->height < 1)
+	{
+		CheckWindowSize( window );
+	}
 	if (first_time)
 	{
-		CheckWindowSize( window );
-
 		readback_spu.child.BarrierCreate( READBACK_BARRIER, 0 );
 		readback_spu.child.LoadIdentity();
 		readback_spu.child.Ortho( 0, window->width,


don't use next pointer after free.

don't use next pointer after free.

--- sql/common/sql_changeset.c
+++ sql/common/sql_changeset.c
@@ -102,7 +102,9 @@
 void
 cs_remove_node(changeset * cs, node *n)
 {
+	node *nxt = n->next;
+
 	list_remove_node(cs->set, n);
 	if (cs->nelm == n)
-		cs->nelm = n->next;
+		cs->nelm = nxt;
 }


Deserialize RPAs with their object ownership. This seems to fix the leak that saw parametric roles and pre-comp sometimes interact badly.

--- src/6model/serialization.c
+++ src/6model/serialization.c
@@ -11,6 +11,7 @@
 #include "pmc_serializationcontext.h"
 #include "pmc_nqplexinfo.h"
 #include "pmc_ownedhash.h"
+#include "pmc_ownedresizablepmcarray.h"
 #include "pmc/pmc_sub.h"
 #include "base64.h"

@@ -56,6 +57,7 @@
 static INTVAL perl6_lexpad_id = 0;
 static INTVAL ctmthunk_id = 0;
 static INTVAL ownedhash_id = 0;
+static INTVAL ownedrpa_id = 0;

 /* ***************************************************************************
  * Serialization (writing related)
@@ -457,6 +459,9 @@
         discrim = REFVAR_VM_STR;
     }
     else if (ref->vtable->base_type == enum_class_ResizablePMCArray) {
+        discrim = REFVAR_VM_ARR_VAR;
+    }
+    else if (ref->vtable->base_type == ownedrpa_id) {
         discrim = REFVAR_VM_ARR_VAR;
     }
     else if (ref->vtable->base_type == enum_class_ResizableIntegerArray) {
@@ -984,6 +989,7 @@
     perl6_lexpad_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "Perl6LexInfo", 0));
     ctmthunk_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "CTMThunk", 0));
     ownedhash_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "OwnedHash", 0));
+    ownedrpa_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "OwnedResizablePMCArray", 0));

     /* Initialize string heap so first entry is the NULL string. */
     VTABLE_push_string(interp, empty_string_heap, STRINGNULL);
@@ -1123,7 +1129,7 @@
 /* Reads in an array of variant references. */
 PMC * read_ref_func(PARROT_INTERP, SerializationReader *reader);
 static PMC * read_array_var(PARROT_INTERP, SerializationReader *reader) {
-    PMC *result = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
+    PMC *result = Parrot_pmc_new(interp, ownedrpa_id);
     Parrot_Int4 elems, i;

     /* Read the element count. */
@@ -1134,6 +1140,9 @@
     /* Read in the elements. */
     for (i = 0; i < elems; i++)
         VTABLE_set_pmc_keyed_int(interp, result, i, read_ref_func(interp, reader));
+
+    /* Set the owner. */
+    PARROT_OWNEDRESIZABLEPMCARRAY(result)->owner = reader->cur_object;

     return result;
 }
@@ -1735,6 +1744,7 @@
     /* Other init. */
     smo_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "SixModelObject", 0));
     ownedhash_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "OwnedHash", 0));
+    ownedrpa_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "OwnedResizablePMCArray", 0));

     /* Read header and disect the data into its parts. */
     check_and_disect_input(interp, reader, data);


Win 10 version check bug fix

Win 10 version check bug fix

--- src/BlackBoneDrv/Private.h
+++ src/BlackBoneDrv/Private.h
@@ -141,7 +141,7 @@
     WINVER_8     = 0x0620,
     WINVER_81    = 0x0630,
     WINVER_10    = 0x0A00,
-    WINVER_10_AU = 0x0A00,
+    WINVER_10_AU = 0x0A01,
 } WinVer;

 extern PLIST_ENTRY PsLoadedModuleList;


wreck/wdns/msg/private.h: #define USTR_CONF_COMPILE_USE_INLINE 0

--- wreck/wdns/msg/private.h
+++ wreck/wdns/msg/private.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <string.h>

+#define USTR_CONF_COMPILE_USE_INLINE 0
 #include <ustr.h>

 #include "../buf.h"


Prepares server_http.h

Prepares server_http.h

--- wsgi_boost/server_http.h
+++ wsgi_boost/server_http.h
@@ -26,6 +26,8 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 */
+
+#define WSGI_BOOST_VERSION "0.0.1"

 #include "request_handlers.h"

@@ -150,14 +152,12 @@
         };
         ///Set before calling start().
         Config config;
-
-        typedef std::function<void(typename ServerBase<socket_type>::Response&, std::shared_ptr<typename ServerBase<socket_type>::Request>)> Resource;
-
-		Resource static_handler;
-		Resource wsgi_handler;
+
 		std::vector<std::pair<boost::regex, std::string>> static_routes;

     public:
+		std::string server_name = "WsgiBoost Server v." WSGI_BOOST_VERSION;
+
         void start() {
 			GilRelease release_gil;

@@ -203,7 +203,14 @@
 			static_routes.emplace_back(boost::regex(path, boost::regex::icase), content_dir);
 		}

+		void set_app(boost::python::object app_)
+		{
+			app = app_;
+		}
+
     protected:
+		boost::python::object app;
+
         boost::asio::io_service io_service;
         boost::asio::ip::tcp::acceptor acceptor;
         std::vector<std::thread> threads;
@@ -213,17 +220,20 @@

         ServerBase(unsigned short port, size_t num_threads, size_t timeout_request, size_t timeout_send_or_receive) :
                 config(port, num_threads), acceptor(io_service),
-                timeout_request(timeout_request), timeout_content(timeout_send_or_receive)
+                timeout_request(timeout_request), timeout_content(timeout_send_or_receive) {}
+
+        virtual void accept()=0;
+
+		void handle_wsgi_request(ServerBase<socket_type>::Response& response, std::shared_ptr<ServerBase<socket_type>::Request> request)
 		{
-			static_handler = wsgi_handler = [](ServerBase<socket_type>::Response& response, std::shared_ptr<ServerBase<socket_type>::Request> request)
-			{
-				std::string message = "501 Not Implemented";
-				response << "HTTP/1.1 " << message << "\r\nContent-Type: text/plain\r\nContent-Length: " << message.length() << "\r\n\r\n" << message;
-			};
+
 		}

-        virtual void accept()=0;
-
+		void handle_static_request(ServerBase<socket_type>::Response& response, std::shared_ptr<ServerBase<socket_type>::Request> request)
+		{
+
+		}
+
         std::shared_ptr<boost::asio::deadline_timer> set_timeout_on_socket(std::shared_ptr<socket_type> socket, size_t seconds) {
             std::shared_ptr<boost::asio::deadline_timer> timer(new boost::asio::deadline_timer(io_service));
             timer->expires_from_now(boost::posix_time::seconds(seconds));
@@ -362,25 +372,31 @@
 				{
 					request->path_regex = route.first;
 					request->content_dir = route.second;
-                    write_response(socket, request, static_handler);
+                    write_response(socket, request);
                     return;
                 }
             }
-            write_response(socket, request, wsgi_handler);
-        }
-
-        void write_response(std::shared_ptr<socket_type> socket, std::shared_ptr<Request> request,
-                std::function<void(typename ServerBase<socket_type>::Response&, std::shared_ptr<typename ServerBase<socket_type>::Request>)>& resource_function) {
+            write_response(socket, request);
+        }
+
+        void write_response(std::shared_ptr<socket_type> socket, std::shared_ptr<Request> request) {
             //Set timeout on the following boost::asio::async-read or write function
             std::shared_ptr<boost::asio::deadline_timer> timer;
             if(timeout_content>0)
                 timer=set_timeout_on_socket(socket, request, timeout_content);

-            boost::asio::spawn(request->strand, [this, &resource_function, socket, request, timer](boost::asio::yield_context yield) {
+            boost::asio::spawn(request->strand, [this, socket, request, timer](boost::asio::yield_context yield) {
                 Response response(*socket, yield);

                 try {
-                    resource_function(response, request);
+					if (request->content_dir != "")
+					{
+						handle_static_request(response, request);
+					}
+					else
+					{
+						handle_wsgi_request(response, request);
+					}
                 }
                 catch(const std::exception& e) {
 					std::cerr << e.what() << std::endl;


zTGL: 修正不能读取一些 BMR 文件的问题

zTGL: 修正不能读取一些 BMR 文件的问题

--- src/CrH_FMTZ/tgl/tgl_bmr.c
+++ src/CrH_FMTZ/tgl/tgl_bmr.c
@@ -32,12 +32,12 @@
 /* BMR 文件头结构 */
 CR_TYPEDEF struct
 {
-        int32u  zero;           /* 0x00000000？ */
+        int32u  unknown1;       /* 未知数据值 */
         int32u  width;          /* 图片的宽度 */
         int32u  height;         /* 图片的高度 */
         int32u  dat_size;       /* 压缩数据大小 */
         byte_t  pal_count;      /* 调色板颜色数 */
-        byte_t  unknown[3];     /* 未知数据值 */
+        byte_t  unknown2[3];    /* 未知数据值 */

 } CR_PACKED sBMR_HDR;

@@ -78,11 +78,6 @@
                 "load_tgl_bmr()", "iDATIN::getT() failure");
         return (NULL);
     }
-    if (head.zero != 0x00000000UL) {
-        err_set(__CR_TGL_BMR_C__, head.zero,
-                "load_tgl_bmr()", "invalid BMR format");
-        return (NULL);
-    }
     if (head.pal_count == 0) {
         err_set(__CR_TGL_BMR_C__, head.pal_count,
                 "load_tgl_bmr()", "invalid BMR format");


last doxy fix

last doxy fix

--- src/Generating/FinishGen.h
+++ src/Generating/FinishGen.h
@@ -318,14 +318,14 @@

-class cFinishGenPassiveMobs :
-	public cFinishGen
-{
-public:
-
-	/** This class populates generated chunks with packs of biome-dependant animals
+/** This class populates generated chunks with packs of biome-dependant animals
 	Animals: cows, sheep, pigs, mooshrooms, squid, horses, wolves, ocelots
 	*/
+class cFinishGenPassiveMobs :
+	public cFinishGen
+{
+public:
+
 	cFinishGenPassiveMobs(int a_Seed, cIniFile & a_IniFile, eDimension a_Dimension);

 protected:


drm/nvf0/gr: enable acceleration with our chsw ucode

Signed-off-by: Ben Skeggs <d9f27fb07c1e9f131223ad827fa5179f3846c30b@redhat.com>


bnx2x: Change duplex setting in EEE function

This is not a real problem, since the EEE is supported for devices where the
actual_phy_selection is zero, such that the req_duplex of params will match
the one of the phy struct.

Signed-off-by: Yaniv Rosner <863d04138a679eefe08d0a31ca0f8f3a07fae2ff@broadcom.com>
Signed-off-by: Eilon Greenstein <5ba67022bcc5f9ee9b9819ddc35fa83823aa47ee@broadcom.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -10119,7 +10119,7 @@
 			return rc;
 		}

-		if ((params->req_duplex[actual_phy_selection] == DUPLEX_FULL) &&
+		if ((phy->req_duplex == DUPLEX_FULL) &&
 		    (params->eee_mode & EEE_MODE_ADV_LPI) &&
 		    (bnx2x_eee_calc_timer(params) ||
 		     !(params->eee_mode & EEE_MODE_ENABLE_LPI)))
@@ -13451,7 +13451,7 @@
 	if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
 		if (!not_kr2_device) {
 			DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page,
-			   next_page);
+				       next_page);
 			bnx2x_kr2_recovery(params, vars, phy);
 		}
 		return;


Add file adxl345.c

Add file adxl345.c

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


MapDeviceAddressSpace svcs now take option, not perm

--- nx/include/switch/kernel/svc.h
+++ nx/include/switch/kernel/svc.h
@@ -1164,7 +1164,7 @@
  * @note Syscall number 0x59.
  * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
  */
-Result svcMapDeviceAddressSpaceByForce(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 perm);
+Result svcMapDeviceAddressSpaceByForce(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 option);

 /**
  * @brief Maps an attached device address space to an userspace address.
@@ -1173,7 +1173,7 @@
  * @note Syscall number 0x5A.
  * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
  */
-Result svcMapDeviceAddressSpaceAligned(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 perm);
+Result svcMapDeviceAddressSpaceAligned(Handle handle, Handle proc_handle, u64 map_addr, u64 dev_size, u64 dev_addr, u32 option);

 /**
  * @brief Maps an attached device address space to an userspace address. [1.0.0-12.1.0]


~CaseNode()

~CaseNode()

--- source/Node.h
+++ source/Node.h
@@ -1072,11 +1072,11 @@

 		~CaseNode()
 		{
+			delete value;
 			for ( auto i : list )
 			{
 				delete i;
 			}
-
 			delete block;
 		}


Previously removed a semicolon to many.

Previously removed a semicolon to many.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@6925 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/projects/library/seqan/file/string_external.h
+++ seqan/projects/library/seqan/file/string_external.h
@@ -1218,7 +1218,7 @@
                 } else
                     return false;
 			}
-		}
+		};

         inline TPageFrame &getPage(
             int pageNo,


bnx2x: Fix VF MAC removal

bnx2x: Fix VF MAC removal

There's a bug in today's driver where VF requests to add/remove MAC filters
always reach the Hypervisor as add requests.
This prevents the VF from changing its MAC address, as it cannot remove the
previously configured MAC and runs out of MAC credits.

Signed-off-by: Shahed Shaikh <ab77ee5b0d734d17aeb48a015aa10cefccfbf5ad@qlogic.com>
Signed-off-by: Yuval Mintz <a320527b33f9bc556d024eb67e5daaf32889f80b@qlogic.com>
Signed-off-by: Ariel Elior <77ebc0b909496dd8d7adc90152299d1d237a1ecd@qlogic.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


cleanups

cleanups

--- src/master/auth-process.c
+++ src/master/auth-process.c
@@ -44,9 +44,9 @@

 static void auth_process_destroy(struct auth_process *p);

-static int handle_request(struct auth_process *process,
-			  struct auth_master_reply *reply,
-			  const unsigned char *data)
+static int handle_reply(struct auth_process *process,
+			struct auth_master_reply *reply,
+			const unsigned char *data)
 {
 	size_t nul_pos;
 	void *context;
@@ -154,7 +154,7 @@

 	if (!p->in_auth_reply) {
 		data = i_stream_get_data(p->input, &size);
-		if (size < sizeof(struct auth_master_reply))
+		if (size < sizeof(p->auth_reply))
 			return;

 		p->in_auth_reply = TRUE;
@@ -168,7 +168,7 @@
 		return;

 	/* reply is now read */
-	if (!handle_request(p, &p->auth_reply, data))
+	if (!handle_reply(p, &p->auth_reply, data))
 		auth_process_destroy(p);
 	else {
 		p->in_auth_reply = FALSE;


kernel/svc.h: Add descriptions/basic info for the rest of syscalls

--- nx/include/switch/kernel/svc.h
+++ nx/include/switch/kernel/svc.h
@@ -177,10 +177,38 @@
 ///@name Process and thread management
 ///@{

+/**
+ * @brief Exits the current process.
+ * @note Syscall number 0x07.
+ */
+
 void NORETURN svcExitProcess(void);
+
+/**
+ * @brief Creates a thread.
+ * @return Result code.
+ * @note Syscall number 0x08.
+ */
 Result svcCreateThread(Handle* out, void* entry, void* arg, void* stack_top, int prio, int cpuid);
+
+/**
+ * @brief Starts a freshly created thread.
+ * @return Result code.
+ * @note Syscall number 0x09.
+ */
 Result svcStartThread(Handle handle);
+
+/**
+ * @brief Exits the current thread.
+ * @note Syscall number 0x0A.
+ */
 void NORETURN svcExitThread(void);
+
+/**
+ * @brief Sleeps the current thread for the specified amount of time.
+ * @return Result code.
+ * @note Syscall number 0x0B.
+ */
 Result svcSleepThread(u64 nano);

 ///@}
@@ -188,6 +216,11 @@
 ///@name Synchronization
 ///@{

+/**
+ * @brief Clears an event's signalled status.
+ * @return Result code.
+ * @note Syscall number 0x12.
+ */
 Result svcClearEvent(Handle handle);

 ///@}
@@ -195,8 +228,25 @@
 ///@name Inter-process memory sharing
 ///@{

+/**
+ * @brief Maps a block of shared memory.
+ * @return Result code.
+ * @note Syscall number 0x13.
+ */
 Result svcMapSharedMemory(Handle handle, void* addr, size_t size, u32 perm);
+
+/**
+ * @brief Unmaps a block of shared memory.
+ * @return Result code.
+ * @note Syscall number 0x14.
+ */
 Result svcUnmapSharedMemory(Handle handle, void* addr, size_t size);
+
+/**
+ * @brief Creates a block of transfer memory.
+ * @return Result code.
+ * @note Syscall number 0x15.
+ */
 Result svcCreateTransferMemory(Handle* out, void* addr, size_t size, u32 perm);

 ///@}
@@ -218,6 +268,11 @@
 ///@name Synchronization
 ///@{

+/**
+ * @brief Resets a signal.
+ * @return Result code.
+ * @note Syscall number 0x17.
+ */
 Result svcResetSignal(Handle handle);

 ///@}
@@ -225,17 +280,57 @@
 ///@name Synchronization
 ///@{

+
+/**
+ * @brief Waits on one or more synchronization objects, optionally with a timeout.
+ * @return Result code.
+ * @note Syscall number 0x18.
+ */
 Result svcWaitSynchronization(s32* index, const Handle* handles, s32 handleCount, u64 timeout);

+/**
+ * @brief Waits on a single synchronization object, optionally with a timeout.
+ * @return Result code.
+ * @note Wrapper for \ref svcWaitSynchronization.
+ */
 static inline Result svcWaitSynchronizationSingle(Handle handle, u64 timeout) {
     s32 tmp;
     return svcWaitSynchronization(&tmp, &handle, 1, timeout);
 }

+/**
+ * @brief Waits a \ref svcWaitSynchronization operation being done on a synchronization object in another thread.
+ * @return Result code.
+ * @note Syscall number 0x19.
+ */
 Result svcCancelSynchronization(Handle thread);
+
+/**
+ * @brief Arbitrates a mutex lock operation in userspace.
+ * @return Result code.
+ * @note Syscall number 0x1A.
+ */
 Result svcArbitrateLock(u32 wait_tag, u32* tag_location, u32 self_tag);
+
+/**
+ * @brief Arbitrates a mutex unlock operation in userspace.
+ * @return Result code.
+ * @note Syscall number 0x1B.
+ */
 Result svcArbitrateUnlock(u32* tag_location);
+
+/**
+ * @brief Performs a condition variable wait operation in userspace.
+ * @return Result code.
+ * @note Syscall number 0x1C.
+ */
 Result svcWaitProcessWideKeyAtomic(u32* key, u32* tag_location, u32 self_tag, u64 timeout);
+
+/**
+ * @brief Performs a condition variable wake-up operation in userspace.
+ * @return Result code.
+ * @note Syscall number 0x1D.
+ */
 Result svcSignalProcessWideKey(u32* key, s32 num);

 ///@}
@@ -255,7 +350,18 @@
 ///@name Inter-process communication (IPC)
 ///@{

+/**
+ * @brief Connects to a registered named port.
+ * @return Result code.
+ * @note Syscall number 0x1F.
+ */
 Result svcConnectToNamedPort(Handle* session, const char* name);
+
+/**
+ * @brief Sends an IPC synchronization request to a session.
+ * @return Result code.
+ * @note Syscall number 0x21.
+ */
 Result svcSendSyncRequest(Handle session);

 ///@}
@@ -263,6 +369,11 @@
 ///@name Process and thread management
 ///@{

+/**
+ * @brief Gets the PID associated with a process.
+ * @return Result code.
+ * @note Syscall number 0x24.
+ */
 Result svcGetProcessId(u64 *processID, Handle handle);

 ///@}
@@ -285,6 +396,13 @@
 ///@name Debugging
 ///@{

+/**
+ * @brief Outputs debug text, if used during debugging.
+ * @param[in] str Text to output.
+ * @param[in] size Size of the text in bytes.
+ * @return Result code.
+ * @note Syscall number 0x27.
+ */
 Result svcOutputDebugString(const char *str, u64 size);

 ///@}
@@ -309,6 +427,12 @@
 ///@name Process and thread management
 ///@{

+/**
+ * @brief Configures the pause/unpause status of a thread.
+ * @return Result code.
+ * @note Syscall number 0x32.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcSetThreadActivity(Handle thread, bool paused);

 ///@}
@@ -316,8 +440,28 @@
 ///@name Inter-process communication (IPC)
 ///@{

+/**
+ * @brief Creates an IPC session.
+ * @return Result code.
+ * @note Syscall number 0x40.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcCreateSession(Handle *server_handle, Handle *client_handle, u32 unk0, u64 unk1);//unk* are normally 0?
+
+/**
+ * @brief Accepts an IPC session.
+ * @return Result code.
+ * @note Syscall number 0x41.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcAcceptSession(Handle *session_handle, Handle port_handle);
+
+/**
+ * @brief Performs IPC input/output.
+ * @return Result code.
+ * @note Syscall number 0x43.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcReplyAndReceive(s32* index, const Handle* handles, s32 handleCount, Handle replyTarget, u64 timeout);

 ///@}
@@ -325,7 +469,20 @@
 ///@name Just-in-time (JIT) compilation support
 ///@{

+/**
+ * @brief Creates JIT memory in the caller's address space [4.0.0+].
+ * @return Result code.
+ * @note Syscall number 0x4B.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcCreateJitMemory(Handle* jit_handle, void* src_addr, u64 size);
+
+/**
+ * @brief Maps JIT memory in the caller's address space [4.0.0+].
+ * @return Result code.
+ * @note Syscall number 0x4C.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcMapJitMemory(Handle jit_handle, JitMapOperation op, void* dst_addr, u64 size, u64 perm);

 ///@}
@@ -333,8 +490,29 @@
 ///@name Inter-process memory sharing
 ///@{

+
+/**
+ * @brief Creates a block of shared memory.
+ * @return Result code.
+ * @note Syscall number 0x50.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcCreateSharedMemory(Handle* out, size_t size, u32 local_perm, u32 other_perm);
+
+/**
+ * @brief Maps a block of transfer memory.
+ * @return Result code.
+ * @note Syscall number 0x51.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcMapTransferMemory(Handle tmem_handle, void* addr, size_t size, u32 perm);
+
+/**
+ * @brief Unmaps a block of transfer memory.
+ * @return Result code.
+ * @note Syscall number 0x52.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcUnmapTransferMemory(Handle tmem_handle, void* addr, size_t size);

 ///@}
@@ -342,7 +520,20 @@
 ///@name Device memory-mapped I/O (MMIO)
 ///@{

+/**
+ * @brief Queries information about a certain virtual address, including its physical address.
+ * @return Result code.
+ * @note Syscall number 0x54.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcQueryPhysicalAddress(u64 out[3], u64 virtaddr);
+
+/**
+ * @brief Returns a virtual address mapped to a given IO range.
+ * @return Result code.
+ * @note Syscall number 0x55.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcQueryIoMapping(u64* virtaddr, u64 physaddr, u64 size);

 ///@}
@@ -350,10 +541,45 @@
 ///@name I/O memory management unit (IOMMU)
 ///@{

+/**
+ * @brief Creates a virtual address space for binding device address spaces.
+ * @return Result code.
+ * @note Syscall number 0x56.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcCreateDeviceAddressSpace(Handle *handle, u64 dev_addr, u64 dev_size);
+
+/**
+ * @brief Attaches a device address space to a device.
+ * @return Result code.
+ * @note Syscall number 0x57.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcAttachDeviceAddressSpace(u64 device, Handle handle);
+
+/**
+ * @brief Detaches a device address space from a device.
+ * @return Result code.
+ * @note Syscall number 0x58.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcDetachDeviceAddressSpace(u64 device, Handle handle);
+
+/**
+ * @brief Maps an attached device address space to an userspace address.
+ * @return Result code.
+ * @remark The userspace destination address must have the \ref MemState_MapDeviceAlignedAllowed bit set.
+ * @note Syscall number 0x5A.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcMapDeviceAddressSpaceAligned(Handle handle, Handle proc_handle, u64 dev_addr, u64 dev_size, u64 map_addr, u64 perm);
+
+/**
+ * @brief Unmaps an attached device address space from an userspace address.
+ * @return Result code.
+ * @note Syscall number 0x5C.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcUnmapDeviceAddressSpace(Handle handle, Handle proc_handle, u64 map_addr, u64 map_size, u64 perm);

 ///@}
@@ -361,10 +587,44 @@
 ///@name Debugging
 ///@{

+/**
+ * @brief Debugs an active process.
+ * @return Result code.
+ * @note Syscall number 0x60.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcDebugActiveProcess(Handle* debug, u64 processID);
+
+/**
+ * @brief Breaks an active debugging session.
+ * @return Result code.
+ * @note Syscall number 0x61.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcBreakDebugProcess(Handle debug);
+
+/**
+ * @brief Gets an incoming debug event from a debugging session.
+ * @return Result code.
+ * @note Syscall number 0x63.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcGetDebugEvent(u8* event_out, Handle* debug);
+
+/**
+ * @brief Continues a debugging session.
+ * @return Result code.
+ * @note Syscall number 0x64.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcContinueDebugEvent(Handle debug, u32 flags, u64 unk);
+
+/**
+ * @brief Gets the context of a thread in a debugging session.
+ * @return Result code.
+ * @note Syscall number 0x67.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcGetDebugThreadContext(u8* out, Handle debug, u64 threadID, u32 flags);

 ///@}
@@ -372,6 +632,12 @@
 ///@name Process and thread management
 ///@{

+/**
+ * @brief Retrieves a list of all running processes.
+ * @return Result code.
+ * @note Syscall number 0x65.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcGetProcessList(u32 *num_out, u64 *pids_out, u32 max_pids);

 ///@}
@@ -379,8 +645,28 @@
 ///@name Debugging
 ///@{

+/**
+ * @brief Queries memory information from a process that is being debugged.
+ * @return Result code.
+ * @note Syscall number 0x69.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcQueryDebugProcessMemory(MemoryInfo* meminfo_ptr, u32* pageinfo, Handle debug, u64 addr);
+
+/**
+ * @brief Reads memory from a process that is being debugged.
+ * @return Result code.
+ * @note Syscall number 0x6A.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcReadDebugProcessMemory(void* buffer, Handle debug, u64 addr, u64 size);
+
+/**
+ * @brief Writes to memory in a process that is being debugged.
+ * @return Result code.
+ * @note Syscall number 0x6B.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcWriteDebugProcessMemory(Handle debug, void* buffer, u64 addr, u64 size);

 ///@}
@@ -388,6 +674,12 @@
 ///@name Inter-process communication (IPC)
 ///@{

+/**
+ * @brief Manages a named port.
+ * @return Result code.
+ * @note Syscall number 0x71.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcManageNamedPort(Handle* portServer, const char* name, s32 maxSessions);

 ///@}
@@ -450,7 +742,20 @@
 ///@name Process and thread management
 ///@{

+/**
+ * @brief Creates a new process.
+ * @return Result code.
+ * @note Syscall number 0x79.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcCreateProcess(Handle* out, void* proc_info, u32* caps, u64 cap_num);
+
+/**
+ * @brief Starts executing a freshly created process.
+ * @return Result code.
+ * @note Syscall number 0x7A.
+ * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
+ */
 Result svcStartProcess(Handle proc, s32 main_prio, s32 default_cpu, u32 stack_size);

 ///@}


--- source/Node.h
+++ source/Node.h
@@ -48,7 +48,7 @@

 		virtual Node::Type GetType() const = 0;

-		virtual const Location &GetLocation()
+		virtual const Location &GetLocation() const
 		{
 			return location;
 		}


ixgbe: fix SFF data dumps of SFP+ modules from an offset

This patch fixes the read loop for the I2C data to account for the offset.

Also includes a whitespace cleanup and removes ret_val as it is not needed.

CC: Ben Hutchings <0672176982fbc629cc374f31a7a45ae1671abf90@solarflare.com>
Reported-by: Ben Hutchings <0672176982fbc629cc374f31a7a45ae1671abf90@solarflare.com>
Signed-off-by: Emil Tantilov <7bb77ce8696ed668ba78a49cc3445dd5ee9fe4b8@intel.com>
Tested-by: Phil Schmitt <e59a1cb13110d2d5848864a809262db69840c26d@intel.com>
Reviewed-by: Ben Hutchings <0672176982fbc629cc374f31a7a45ae1671abf90@solarflare.com>
Signed-off-by: Jeff Kirsher <87e35f5be20bb3e67f4ba6b86f5f6be3085b1b3a@intel.com>


Don't crash when dict process exists and we receive SIGHUP.

--- src/master/dict-process.c
+++ src/master/dict-process.c
@@ -165,8 +165,11 @@
 {
 	struct dict_process *p = (struct dict_process *)process;

-	log_unref(p->log);
-	p->log = NULL;
+	if (p->log != NULL) {
+		/* not killed by ourself */
+		log_unref(p->log);
+		p->log = NULL;
+	}
 	(void)dict_process_listen(p);
 }


Fix GCC errors.

Fix GCC errors.

--- source/Type.h
+++ source/Type.h
@@ -29,6 +29,7 @@
 #define DUEL6_TYPE_H

 #include <stdint.h>
+#include <cstdio>

 namespace Duel6
 {


myri10ge: fix truesize underestimation

myri10ge: fix truesize underestimation

skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.

Signed-off-by: Eric Dumazet <a0baddf32b28d2f9429941ed4af2fe636e210591@gmail.com>
CC: Jon Mason <dfb59f0c8ff950313b5e348b016c8434aeb441c7@myri.com>
Acked-by: Jon Mason <dfb59f0c8ff950313b5e348b016c8434aeb441c7@myri.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -1210,7 +1210,6 @@
 	struct skb_frag_struct *skb_frags;

 	skb->len = skb->data_len = len;
-	skb->truesize = len + sizeof(struct sk_buff);
 	/* attach the page(s) */

 	skb_frags = skb_shinfo(skb)->frags;
@@ -1385,6 +1384,8 @@
 	if (skb_frag_size(&skb_shinfo(skb)->frags[0]) <= 0) {
 		skb_frag_unref(skb, 0);
 		skb_shinfo(skb)->nr_frags = 0;
+	} else {
+		skb->truesize += bytes * skb_shinfo(skb)->nr_frags;
 	}
 	skb->protocol = eth_type_trans(skb, dev);
 	skb_record_rx_queue(skb, ss - &mgp->ss[0]);


dovecot --exec-mail: Never listen input from stderr, there's no point.

--HG--
branch : HEAD

--- src/master/mail-process.c
+++ src/master/mail-process.c
@@ -290,7 +290,7 @@
 static void
 mail_process_set_environment(struct settings *set, const char *mail,
 			     const struct var_expand_table *var_expand_table,
-			     bool dump_capability)
+			     bool dump_capability, bool exec_mail)
 {
 	const char *const *envs;
 	string_t *str;
@@ -370,8 +370,10 @@
 	if (set->mbox_lazy_writes)
 		env_put("MBOX_LAZY_WRITES=1");
 	/* when running dump-capability log still points to stderr,
-	   and io_add()ing it might break (epoll_ctl() gives EPERM) */
-	if (set->shutdown_clients && !dump_capability)
+	   and io_add()ing it might break (epoll_ctl() gives EPERM).
+	   with --exec-mail there's no benefit in adding an extra stderr
+	   listener, but it might cause problems. */
+	if (set->shutdown_clients && !dump_capability && !exec_mail)
 		env_put("STDERR_CLOSE_SHUTDOWN=1");
 	(void)umask(set->umask);

@@ -486,7 +488,7 @@
 	}

 	mail_process_set_environment(set, getenv("MAIL"), var_expand_table,
-				     FALSE);
+				     FALSE, TRUE);
 	if (args == NULL)
 		client_process_exec(executable, "");
 	else
@@ -816,7 +818,7 @@
 	}

 	mail_process_set_environment(set, mail, var_expand_table,
-				     dump_capability);
+				     dump_capability, FALSE);

 	/* extra args. uppercase key value. */
 	args = array_get(&extra_args, &count);


Bluetooth: AT handling error condition

Bluetooth: AT handling error condition

In function at_get_number check for the value if gets computed.
If not return error. Also change the end state handling.

Change-Id: I193b04fa2880dfb44e7727b30b67c1ec2e051cc7
Signed-off-by: Sathish Narasimman <788f4f1e1e795a0a40b9b14d104da7375bf0cb35@intel.com>

--- subsys/bluetooth/host/at.c
+++ subsys/bluetooth/host/at.c
@@ -50,10 +50,16 @@

 int at_get_number(const char *buf, uint32_t *val)
 {
-	*val = 0;
-
-	for (buf = skip_whitespace(buf); isdigit(*buf); buf++) {
+	uint32_t i;
+
+	buf = skip_whitespace(buf);
+
+	for (i = 0, *val = 0; isdigit(*buf); buf++, i++) {
 		*val = *val * 10 + *buf - '0';
+	}
+
+	if (i == 0) {
+		return -ENODATA;
 	}

 	return 0;
@@ -279,7 +285,12 @@
 static int cmd_process_value(struct at_client *at, struct net_buf *buf,
 			     const char *prefix, parse_val_t func)
 {
-	return func(at);
+	int ret;
+
+	ret = func(at);
+	at->cmd_state = CMD_STATE_END_LF;
+
+	return ret;
 }

 static int cmd_state_end_lf(struct at_client *at, struct net_buf *buf,


Enable IPv6 support.

Enable IPv6 support.

--- source/ilib.c
+++ source/ilib.c
@@ -171,10 +171,10 @@
 	g_return_val_if_fail(port != 0, NULL);

 	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = AF_INET;
+	hints.ai_family = AF_UNSPEC;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = 0;
-	hints.ai_flags = 0;
+	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;

 	port_str = g_strdup_printf("%u", port);

@@ -240,10 +240,10 @@
 	g_return_val_if_fail(port != 0, NULL);

 	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = AF_INET;
+	hints.ai_family = AF_UNSPEC;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = 0;
-	hints.ai_flags = AI_PASSIVE;
+	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_PASSIVE;

 	port_str = g_strdup_printf("%u", port);


Add explicit casts to printing of function pointers (#16370)

Compiling with clang on Windows fails here with a warning about implicit
cast from function pointer to object pointer. Rather than disable that
warning, this makes it an explicit cast. Since this is just test output,
it's not critical that this be a completely safe operation.

Part of #16256

--- shell/platform/embedder/tests/embedder_assertions.h
+++ shell/platform/embedder/tests/embedder_assertions.h
@@ -224,16 +224,16 @@
                                 const FlutterOpenGLTexture& item) {
   return out << "(FlutterOpenGLTexture) Target: 0x" << std::hex << item.target
              << std::dec << " Name: " << item.name << " Format: " << item.format
-             << " User Data: " << item.user_data
-             << " Destruction Callback: " << item.destruction_callback;
+             << " User Data: " << item.user_data << " Destruction Callback: "
+             << reinterpret_cast<void*>(item.destruction_callback);
 }

 inline std::ostream& operator<<(std::ostream& out,
                                 const FlutterOpenGLFramebuffer& item) {
   return out << "(FlutterOpenGLFramebuffer) Target: 0x" << std::hex
              << item.target << std::dec << " Name: " << item.name
-             << " User Data: " << item.user_data
-             << " Destruction Callback: " << item.destruction_callback;
+             << " User Data: " << item.user_data << " Destruction Callback: "
+             << reinterpret_cast<void*>(item.destruction_callback);
 }

 inline std::string FlutterPlatformViewMutationTypeToString(
@@ -318,8 +318,8 @@
                                 const FlutterSoftwareBackingStore& item) {
   return out << "(FlutterSoftwareBackingStore) Allocation: " << item.allocation
              << " Row Bytes: " << item.row_bytes << " Height: " << item.height
-             << " User Data: " << item.user_data
-             << " Destruction Callback: " << item.destruction_callback;
+             << " User Data: " << item.user_data << " Destruction Callback: "
+             << reinterpret_cast<void*>(item.destruction_callback);
 }

 inline std::ostream& operator<<(std::ostream& out,


drivers: staging: ft1000: Fix indentation

Fixes indentation in header files.

Signed-off-by: Artem Fetishev <364e430d799e05480d764c41912542e18aa85000@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


Don't crash if username is NULL (shouldn't happen though)

--- src/master/mail-process.c
+++ src/master/mail-process.c
@@ -103,8 +103,8 @@
 	memcpy(tab, static_tab, sizeof(static_tab));

 	tab[0].value = user;
-	tab[1].value = t_strcut(user, '@');
-	tab[2].value = strchr(user, '@');
+	tab[1].value = user == NULL ? NULL : t_strcut(user, '@');
+	tab[2].value = user == NULL ? NULL : strchr(user, '@');
 	if (tab[2].value != NULL) tab[2].value++;
 	tab[3].value = t_str_ucase(protocol);
 	tab[4].value = home;


pm: device_runtime: Keep enable behavior consistent

It is not possible to rely on pm->dev to do lazy initialization of
some components. For example, in the follow sequence of commands:

1 - pm_device_runtime_enable()
  pm->state == PM_DEVICE_STATE_SUSPENDED;
2 - pm_device_runtime_disable()
  pm->state == PM_DEVICE_STATE_ACTIVE;
3 - pm_device_runtime_enable()
  pm->state == PM_DEVICE_STATE_ACTIVE

After the first time pm_device_runtime_enable(), the device state will
be suspended, but after the second time this function executes the state
will be active. That is not consistent.

It is just easier to remove the branch check and always set those
fields for the sake of consistent.

Signed-off-by: Flavio Ceolin <979b9165500b0741b9d0500e2efd74fc1547bff7@intel.com>

--- subsys/pm/device_runtime.c
+++ subsys/pm/device_runtime.c
@@ -183,9 +183,9 @@
 	/* lazy init of PM fields */
 	if (pm->dev == NULL) {
 		pm->dev = dev;
-		pm->state = PM_DEVICE_STATE_SUSPENDED;
 		k_work_init_delayable(&pm->work, runtime_suspend_work);
 	}
+	pm->state = PM_DEVICE_STATE_SUSPENDED;

 	atomic_set_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_ENABLED);


Pretty print.

Pretty print.

--- source/list.c
+++ source/list.c
@@ -4,7 +4,8 @@
 #include <err.h>
 #include "list.h"

-List *list_create(void) {
+List *list_create(void)
+{
     List *list = malloc(sizeof(List));
     list->size = 0;
     list->items = NULL;
@@ -12,7 +13,8 @@
     return list;
 };

-void list_free(List *list) {
+void list_free(List *list)
+{
     if (list->items != NULL) {
         free(list->items);
     }
@@ -21,15 +23,18 @@

 int list_length(List *list) { return list->size; }

-void list_append(List *list, void *item) {
+void list_append(List *list, void *item)
+{
     list->size++;
     list->items = realloc(list->items, list->size * sizeof(item));

     list->items[list->size - 1] = item;
 }

+
 /* Insert item as the first element in list. */
-void list_push(List *list, void *item) {
+void list_prepend(List *list, void *item)
+{
     list->size++;

     void **new_items = malloc(list->size * sizeof(item));
@@ -45,7 +50,8 @@

 /* Remove the last item from the list, and return it.
  */
-void *list_pop(List *list) {
+void *list_pop(List *list)
+{
     void *value = list_get(list, list->size - 1);

     list->size--;
@@ -56,12 +62,14 @@

 void *list_get(List *list, int index) { return list->items[index]; }

-void list_set(List *list, int index, void *value) {
+void list_set(List *list, int index, void *value)
+{
     if (index < 0 || index > list->size) {
         warnx("Index %d is out of bounds!", index);
     }

-    else if (index == list->size) {
+    else if (index == list->size)
+    {
         list_append(list, value);
     }


usb: cdc_acm: Use new device data interface

Use device data interface to handle device data.

Signed-off-by: Andrei Emeltchenko <a6565233ddc88e4fb9c66c1d70743223493f2ed4@intel.com>

--- subsys/usb/class/cdc_acm.c
+++ subsys/usb/class/cdc_acm.c
@@ -204,50 +204,11 @@
 	u8_t serial_state;
 	/* CDC ACM notification sent status */
 	u8_t notification_sent;
-	struct device *dev;
-	sys_snode_t node;
+
+	struct usb_dev_data common;
 };

 static sys_slist_t cdc_acm_data_devlist;
-
-static struct cdc_acm_dev_data_t *get_dev_data_by_iface(u8_t iface_num)
-{
-	struct cdc_acm_dev_data_t *dev_data;
-
-	SYS_SLIST_FOR_EACH_CONTAINER(&cdc_acm_data_devlist, dev_data, node) {
-		struct device *dev = dev_data->dev;
-		const struct usb_cfg_data *cfg = dev->config->config_info;
-		const struct usb_if_descriptor *if_desc =
-						cfg->interface_descriptor;
-
-		if (if_desc->bInterfaceNumber == iface_num) {
-			return dev_data;
-		}
-	}
-
-	LOG_DBG("Device data not found for iface number %u", iface_num);
-	return NULL;
-}
-
-static struct cdc_acm_dev_data_t *get_dev_data_by_ep(u8_t ep)
-{
-	struct cdc_acm_dev_data_t *dev_data;
-
-	SYS_SLIST_FOR_EACH_CONTAINER(&cdc_acm_data_devlist, dev_data, node) {
-		struct device *dev = dev_data->dev;
-		const struct usb_cfg_data *cfg = dev->config->config_info;
-		const struct usb_ep_cfg_data *ep_data = cfg->endpoint;
-
-		for (u8_t i = 0; i < cfg->num_endpoints; i++) {
-			if (ep_data[i].ep_addr == ep) {
-				return dev_data;
-			}
-		}
-	}
-
-	LOG_DBG("Device data not found for ep %u", ep);
-	return NULL;
-}

 /**
  * @brief Handler called for Class requests not handled by the USB stack.
@@ -262,13 +223,17 @@
 			     s32_t *len, u8_t **data)
 {
 	struct cdc_acm_dev_data_t *dev_data;
-
-	dev_data = get_dev_data_by_iface(sys_le16_to_cpu(pSetup->wIndex));
-	if (!dev_data) {
+	struct usb_dev_data *common;
+
+	common = usb_get_dev_data_by_iface(&cdc_acm_data_devlist,
+					   sys_le16_to_cpu(pSetup->wIndex));
+	if (common == NULL) {
 		LOG_WRN("Device data not found for interface %u",
 			sys_le16_to_cpu(pSetup->wIndex));
 		return -ENODEV;
 	}
+
+	dev_data = CONTAINER_OF(common, struct cdc_acm_dev_data_t, common);

 	switch (pSetup->bRequest) {
 	case SET_LINE_CODING:
@@ -317,14 +282,17 @@
 static void cdc_acm_bulk_in(u8_t ep, enum usb_dc_ep_cb_status_code ep_status)
 {
 	struct cdc_acm_dev_data_t *dev_data;
+	struct usb_dev_data *common;

 	ARG_UNUSED(ep_status);

-	dev_data = get_dev_data_by_ep(ep);
-	if (dev_data == NULL) {
+	common = usb_get_dev_data_by_ep(&cdc_acm_data_devlist, ep);
+	if (common == NULL) {
 		LOG_WRN("Device data not found for endpoint %u", ep);
 		return;
 	}
+
+	dev_data = CONTAINER_OF(common, struct cdc_acm_dev_data_t, common);

 	dev_data->tx_ready = 1U;
 	k_sem_give(&poll_wait_sem);
@@ -346,15 +314,18 @@
 {
 	struct cdc_acm_dev_data_t *dev_data;
 	u32_t bytes_to_read, i, j, buf_head;
+	struct usb_dev_data *common;
 	u8_t tmp_buf[4];

 	ARG_UNUSED(ep_status);

-	dev_data = get_dev_data_by_ep(ep);
-	if (dev_data == NULL) {
+	common = usb_get_dev_data_by_ep(&cdc_acm_data_devlist, ep);
+	if (common == NULL) {
 		LOG_WRN("Device data not found for endpoint %u", ep);
 		return;
 	}
+
+	dev_data = CONTAINER_OF(common, struct cdc_acm_dev_data_t, common);

 	/* Check how many bytes were received */
 	usb_read(ep, NULL, 0, &bytes_to_read);
@@ -404,14 +375,17 @@
 static void cdc_acm_int_in(u8_t ep, enum usb_dc_ep_cb_status_code ep_status)
 {
 	struct cdc_acm_dev_data_t *dev_data;
+	struct usb_dev_data *common;

 	ARG_UNUSED(ep_status);

-	dev_data = get_dev_data_by_ep(ep);
-	if (dev_data == NULL) {
+	common = usb_get_dev_data_by_ep(&cdc_acm_data_devlist, ep);
+	if (common == NULL) {
 		LOG_WRN("Device data not found for endpoint %u", ep);
 		return;
 	}
+
+	dev_data = CONTAINER_OF(common, struct cdc_acm_dev_data_t, common);

 	dev_data->notification_sent = 1U;
 	LOG_DBG("CDC_IntIN EP[%x]\r", ep);
@@ -465,15 +439,18 @@
 					    enum usb_dc_status_code status,
 					    const u8_t *param)
 {
-	struct usb_if_descriptor *if_desc = (void *)cfg->interface_descriptor;
 	struct cdc_acm_dev_data_t *dev_data;
-
-	dev_data = get_dev_data_by_iface(if_desc->bInterfaceNumber);
-	if (!dev_data) {
-		LOG_WRN("Device data not found for interface %u",
-			if_desc->bInterfaceNumber);
+	struct usb_dev_data *common;
+
+	LOG_DBG("cfg %p status %d", cfg, status);
+
+	common = usb_get_dev_data_by_cfg(&cdc_acm_data_devlist, cfg);
+	if (common == NULL) {
+		LOG_WRN("Device data not found for cfg %p", cfg);
 		return;
 	}
+
+	dev_data = CONTAINER_OF(common, struct cdc_acm_dev_data_t, common);

 	cdc_acm_do_cb(dev_data, status, param);
 }
@@ -482,14 +459,17 @@
 				  const u8_t *param)
 {
 	struct cdc_acm_dev_data_t *dev_data;
+	struct usb_dev_data *common;

 	/* Should be the only one element in the list */
-	dev_data = CONTAINER_OF(sys_slist_peek_head(&cdc_acm_data_devlist),
-				struct cdc_acm_dev_data_t, node);
-	if (dev_data == NULL) {
+	common = CONTAINER_OF(sys_slist_peek_head(&cdc_acm_data_devlist),
+			      struct usb_dev_data, node);
+	if (common == NULL) {
 		LOG_WRN("Device data not found");
 		return;
 	}
+
+	dev_data = CONTAINER_OF(common, struct cdc_acm_dev_data_t, common);

 	cdc_acm_do_cb(dev_data, status, param);
 }
@@ -562,8 +542,8 @@
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(dev);
 	int ret = 0;

-	dev_data->dev = dev;
-	sys_slist_append(&cdc_acm_data_devlist, &dev_data->node);
+	dev_data->common.dev = dev;
+	sys_slist_append(&cdc_acm_data_devlist, &dev_data->common.node);

 	LOG_DBG("Device dev %p dev_data %p cfg %p added to devlist %p",
 		dev, dev_data, dev->config->config_info, &cdc_acm_data_devlist);


branches/zip: trx_undo_prev_version_build(): Remove a bogus warning
about undo_rec possibly being uninitialized.  When trx_undo_get_undo_rec()
leaves undo_rec uninitialized, both functions will return DB_MISSING_HISTORY
without dereferencing undo_rec.

This closes Mantis issue #7.

--- trx/trx0rec.c
+++ trx/trx0rec.c
@@ -1388,7 +1388,7 @@
 				or if the purge COULD have removed the version
 				though it has not yet done so */
 {
-	trx_undo_rec_t*	undo_rec;
+	trx_undo_rec_t*	undo_rec	= NULL;
 	dtuple_t*	entry;
 	dulint		rec_trx_id;
 	ulint		type;


Fix patching..maybe..

Fix patching..maybe..

--- source/main.c
+++ source/main.c
@@ -58,8 +58,8 @@
 		u8 sigpatch2[0x4] = {0x00, 0x20, 0x70, 0x47};

 		firm_setup(FIRM, N3DSKey95, N3DSKey96);
-		patch(FIRM, (unsigned int *)sizeof(FIRM), sigpattern1, sigpatch1, sizeof(sigpattern1), sizeof(sigpatch1));
-		patch(FIRM, (unsigned int *)sizeof(FIRM), sigpattern2, sigpatch2, sizeof(sigpattern2), sizeof(sigpatch2));
+		patch(FIRM, (unsigned int)sizeof(FIRM), sigpattern1, sigpatch1, sizeof(sigpattern1), sizeof(sigpatch1));
+		patch(FIRM, (unsigned int)sizeof(FIRM), sigpattern2, sigpatch2, sizeof(sigpattern2), sizeof(sigpatch2));
 		firmlaunch(FIRM);
 	}


usb: cdc_acm: Various style fixes

usb: cdc_acm: Various style fixes

- {} are always required on if/for/while
- no break line before an if, if condition is testing previous
  assignment
- parameters indentation etc...

Change-Id: I83f217c02733b9e63ef1e752f55937f3d7dc03e1
Signed-off-by: Tomasz Bursztyka <ba81a3a719836727e6857ae83462b9f52ec41006@linux.intel.com>

--- subsys/usb/class/cdc_acm.c
+++ subsys/usb/class/cdc_acm.c
@@ -55,7 +55,7 @@
 #define SYS_LOG_LEVEL CONFIG_SYS_LOG_USB_CDC_ACM_LEVEL
 #include <misc/sys_log.h>

-#define DEV_DATA(dev) \
+#define DEV_DATA(dev)						\
 	((struct cdc_acm_dev_data_t * const)(dev)->driver_data)

 static struct uart_driver_api cdc_acm_driver_api;
@@ -255,19 +255,19 @@
  * @return  0 on success, negative errno code on fail.
  */
 int cdc_acm_class_handle_req(struct usb_setup_packet *pSetup,
-		int32_t *len, uint8_t **data)
+			     int32_t *len, uint8_t **data)
 {
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(cdc_acm_dev);

 	switch (pSetup->bRequest) {
 	case CDC_SET_LINE_CODING:
 		memcpy(&dev_data->line_coding,
-		    *data, sizeof(dev_data->line_coding));
+		       *data, sizeof(dev_data->line_coding));
 		SYS_LOG_DBG("\nCDC_SET_LINE_CODING %d %d %d %d",
-		    sys_le32_to_cpu(dev_data->line_coding.dwDTERate),
-		    dev_data->line_coding.bCharFormat,
-		    dev_data->line_coding.bParityType,
-		    dev_data->line_coding.bDataBits);
+			    sys_le32_to_cpu(dev_data->line_coding.dwDTERate),
+			    dev_data->line_coding.bCharFormat,
+			    dev_data->line_coding.bParityType,
+			    dev_data->line_coding.bDataBits);
 		break;

 	case CDC_SET_CONTROL_LINE_STATE:
@@ -280,10 +280,10 @@
 		*data = (uint8_t *)(&dev_data->line_coding);
 		*len = sizeof(dev_data->line_coding);
 		SYS_LOG_DBG("\nCDC_GET_LINE_CODING %d %d %d %d",
-		    sys_le32_to_cpu(dev_data->line_coding.dwDTERate),
-		    dev_data->line_coding.bCharFormat,
-		    dev_data->line_coding.bParityType,
-		    dev_data->line_coding.bDataBits);
+			    sys_le32_to_cpu(dev_data->line_coding.dwDTERate),
+			    dev_data->line_coding.bCharFormat,
+			    dev_data->line_coding.bParityType,
+			    dev_data->line_coding.bDataBits);
 		break;

 	default:
@@ -310,8 +310,9 @@
 	dev_data->tx_ready = 1;
 	k_sem_give(&poll_wait_sem);
 	/* Call callback only if tx irq ena */
-	if (dev_data->cb && dev_data->tx_irq_ena)
+	if (dev_data->cb && dev_data->tx_irq_ena) {
 		dev_data->cb(cdc_acm_dev);
+	}
 }

 /**
@@ -323,7 +324,7 @@
  * @return  N/A.
  */
 static void cdc_acm_bulk_out(uint8_t ep,
-		enum usb_dc_ep_cb_status_code ep_status)
+			     enum usb_dc_ep_cb_status_code ep_status)
 {
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(cdc_acm_dev);
 	uint32_t bytes_to_read, i, j, buf_head;
@@ -340,6 +341,7 @@
 	 */
 	for (i = 0; i < bytes_to_read; i += 4) {
 		usb_read(ep, tmp_buf, 4, NULL);
+
 		for (j = 0; j < 4; j++) {
 			if (i + j == bytes_to_read) {
 				/* We read all the data */
@@ -360,8 +362,9 @@
 	dev_data->rx_buf_head = buf_head;
 	dev_data->rx_ready = 1;
 	/* Call callback only if rx irq ena */
-	if (dev_data->cb && dev_data->rx_irq_ena)
+	if (dev_data->cb && dev_data->rx_irq_ena) {
 		dev_data->cb(cdc_acm_dev);
+	}
 }

 /**
@@ -421,7 +424,7 @@
 	default:
 		SYS_LOG_DBG("USB unknown state");
 		break;
-		}
+	}
 }

 /* Describe EndPoints configuration */
@@ -518,13 +521,14 @@
  * @return Number of bytes sent.
  */
 static int cdc_acm_fifo_fill(struct device *dev,
-	const uint8_t *tx_data, int len)
+			     const uint8_t *tx_data, int len)
 {
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(dev);
 	uint32_t bytes_written = 0;

-	if (dev_data->usb_status != USB_DC_CONFIGURED)
+	if (dev_data->usb_status != USB_DC_CONFIGURED) {
 		return 0;
+	}

 	dev_data->tx_ready = 0;
 	usb_write(CDC_ENDP_IN, tx_data, len, &bytes_written);
@@ -542,24 +546,26 @@
  * @return Number of bytes read.
  */
 static int cdc_acm_fifo_read(struct device *dev, uint8_t *rx_data,
-						const int size)
+			     const int size)
 {
 	uint32_t avail_data, bytes_read, i;
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(dev);

 	avail_data = (CDC_ACM_BUFFER_SIZE + dev_data->rx_buf_head -
-	    dev_data->rx_buf_tail) % CDC_ACM_BUFFER_SIZE;
-	if (avail_data > size)
+		      dev_data->rx_buf_tail) % CDC_ACM_BUFFER_SIZE;
+	if (avail_data > size) {
 		bytes_read = size;
-	else
+	} else {
 		bytes_read = avail_data;
-
-	for (i = 0; i < bytes_read; i++)
+	}
+
+	for (i = 0; i < bytes_read; i++) {
 		rx_data[i] = dev_data->rx_buf[(dev_data->rx_buf_tail + i) %
-		    CDC_ACM_BUFFER_SIZE];
+					      CDC_ACM_BUFFER_SIZE];
+	}

 	dev_data->rx_buf_tail = (dev_data->rx_buf_tail + bytes_read) %
-	    CDC_ACM_BUFFER_SIZE;
+		CDC_ACM_BUFFER_SIZE;

 	if (dev_data->rx_buf_tail == dev_data->rx_buf_head) {
 		/* Buffer empty */
@@ -674,8 +680,9 @@
 {
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(dev);

-	if (dev_data->tx_ready || dev_data->rx_ready)
+	if (dev_data->tx_ready || dev_data->rx_ready) {
 		return 1;
+	}

 	return 0;
 }
@@ -701,7 +708,7 @@
  * @return N/A
  */
 static void cdc_acm_irq_callback_set(struct device *dev,
-							uart_irq_callback_t cb)
+				     uart_irq_callback_t cb)
 {
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(dev);

@@ -736,11 +743,12 @@

 	dev_data->notification_sent = 0;
 	usb_write(CDC_ENDP_INT, (const uint8_t *)&notification,
-	    sizeof(notification), NULL);
+		  sizeof(notification), NULL);

 	/* Wait for notification to be sent */
 	while (!((volatile uint8_t)dev_data->notification_sent)) {
 		sys_thread_busy_wait(1);
+
 		if (++cnt > CDC_CONTROL_SERIAL_STATE_TIMEOUT_US) {
 			SYS_LOG_DBG("CDC ACM notification timeout!");
 			return -EIO;
@@ -760,7 +768,7 @@
  * @return 0 if successful, failed otherwise.
  */
 static int cdc_acm_line_ctrl_set(struct device *dev,
-				      uint32_t ctrl, uint32_t val)
+				 uint32_t ctrl, uint32_t val)
 {
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(dev);

@@ -770,15 +778,19 @@
 		return 0;
 	case LINE_CTRL_DCD:
 		dev_data->serial_state &= ~CDC_CONTROL_SERIAL_STATE_DCD;
-		if (val)
+
+		if (val) {
 			dev_data->serial_state |= CDC_CONTROL_SERIAL_STATE_DCD;
+		}

 		cdc_acm_send_notification(dev, CDC_CONTROL_SERIAL_STATE_DCD);
 		return 0;
 	case LINE_CTRL_DSR:
 		dev_data->serial_state &= ~CDC_CONTROL_SERIAL_STATE_DSR;
-		if (val)
+
+		if (val) {
 			dev_data->serial_state |= CDC_CONTROL_SERIAL_STATE_DSR;
+		}

 		cdc_acm_send_notification(dev, dev_data->serial_state);
 		return 0;
@@ -799,7 +811,7 @@
  * @return 0 if successful, failed otherwise.
  */
 static int cdc_acm_line_ctrl_get(struct device *dev,
-				      uint32_t ctrl, uint32_t *val)
+				 uint32_t ctrl, uint32_t *val)
 {
 	struct cdc_acm_dev_data_t * const dev_data = DEV_DATA(dev);

@@ -808,12 +820,12 @@
 		*val = sys_le32_to_cpu(dev_data->line_coding.dwDTERate);
 		return 0;
 	case LINE_CTRL_RTS:
-		*val =
-		    (dev_data->line_state & CDC_CONTROL_LINE_STATE_RTS) ? 1 : 0;
+		*val = (dev_data->line_state &
+			CDC_CONTROL_LINE_STATE_RTS) ? 1 : 0;
 		return 0;
 	case LINE_CTRL_DTR:
-		*val =
-		    (dev_data->line_state & CDC_CONTROL_LINE_STATE_DTR) ? 1 : 0;
+		*val = (dev_data->line_state &
+			CDC_CONTROL_LINE_STATE_DTR) ? 1 : 0;
 		return 0;
 	}

@@ -844,7 +856,7 @@
  * @return the same character which is sent
  */
 static unsigned char cdc_acm_poll_out(struct device *dev,
-					     unsigned char c)
+				      unsigned char c)
 {
 	cdc_acm_fifo_fill(dev, &c, 1);
 	k_sem_take(&poll_wait_sem, K_MSEC(100));
@@ -878,5 +890,5 @@
 };

 DEVICE_INIT(cdc_acm, CONFIG_CDC_ACM_PORT_NAME, &cdc_acm_init,
-			&cdc_acm_dev_data, NULL,
-			APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+	    &cdc_acm_dev_data, NULL,
+	    APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);