{"id":814988,"url":"http://patchwork.ozlabs.org/api/patches/814988/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170918153049.44185-2-mika.westerberg@linux.intel.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170918153049.44185-2-mika.westerberg@linux.intel.com>","list_archive_url":null,"date":"2017-09-18T15:30:34","name":"[01/16] byteorder: Move {cpu_to_be32,be32_to_cpu}_array() from Thunderbolt to core","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":true,"hash":"62b0b91ade46e47d8c00324a48a46774501f3e2d","submitter":{"id":14534,"url":"http://patchwork.ozlabs.org/api/people/14534/?format=json","name":"Mika Westerberg","email":"mika.westerberg@linux.intel.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170918153049.44185-2-mika.westerberg@linux.intel.com/mbox/","series":[{"id":3664,"url":"http://patchwork.ozlabs.org/api/series/3664/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=3664","date":"2017-09-18T15:30:47","name":"Thunderbolt networking","version":1,"mbox":"http://patchwork.ozlabs.org/series/3664/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814988/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814988/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwqr35QzPz9s78\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 01:37:07 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753808AbdIRPaz (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 11:30:55 -0400","from mga06.intel.com ([134.134.136.31]:23395 \"EHLO mga06.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753383AbdIRPax (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 18 Sep 2017 11:30:53 -0400","from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga104.jf.intel.com with ESMTP; 18 Sep 2017 08:30:53 -0700","from black.fi.intel.com ([10.237.72.28])\n\tby FMSMGA003.fm.intel.com with ESMTP; 18 Sep 2017 08:30:50 -0700","by black.fi.intel.com (Postfix, from userid 1001)\n\tid 66C455D; Mon, 18 Sep 2017 18:30:49 +0300 (EEST)"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,413,1500966000\"; d=\"scan'208\";a=\"901370984\"","From":"Mika Westerberg <mika.westerberg@linux.intel.com>","To":"Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\t\"David S . Miller\" <davem@davemloft.net>","Cc":"Andreas Noever <andreas.noever@gmail.com>,\n\tMichael Jamet <michael.jamet@intel.com>,\n\tYehezkel Bernat <yehezkel.bernat@intel.com>,\n\tAmir Levy <amir.jer.levy@intel.com>,\n\tMario.Limonciello@dell.com, Lukas Wunner <lukas@wunner.de>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"[PATCH 01/16] byteorder: Move {cpu_to_be32,\n\tbe32_to_cpu}_array() from Thunderbolt to core","Date":"Mon, 18 Sep 2017 18:30:34 +0300","Message-Id":"<20170918153049.44185-2-mika.westerberg@linux.intel.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170918153049.44185-1-mika.westerberg@linux.intel.com>","References":"<20170918153049.44185-1-mika.westerberg@linux.intel.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"We will be using these when communicating XDomain discovery protocol\nover Thunderbolt link but they might be useful for other drivers as\nwell.\n\nMake them available through byteorder/generic.h.\n\nSuggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>\nSigned-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>\nReviewed-by: Michael Jamet <michael.jamet@intel.com>\nReviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>\n---\n drivers/thunderbolt/ctl.c         | 14 --------------\n include/linux/byteorder/generic.h | 16 ++++++++++++++++\n 2 files changed, 16 insertions(+), 14 deletions(-)","diff":"diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c\nindex fb40dd0588b9..e6a4c9458c76 100644\n--- a/drivers/thunderbolt/ctl.c\n+++ b/drivers/thunderbolt/ctl.c\n@@ -289,20 +289,6 @@ static void tb_cfg_print_error(struct tb_ctl *ctl,\n \t}\n }\n \n-static void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len)\n-{\n-\tint i;\n-\tfor (i = 0; i < len; i++)\n-\t\tdst[i] = cpu_to_be32(src[i]);\n-}\n-\n-static void be32_to_cpu_array(u32 *dst, __be32 *src, size_t len)\n-{\n-\tint i;\n-\tfor (i = 0; i < len; i++)\n-\t\tdst[i] = be32_to_cpu(src[i]);\n-}\n-\n static __be32 tb_crc(const void *data, size_t len)\n {\n \treturn cpu_to_be32(~__crc32c_le(~0, data, len));\ndiff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h\nindex 89f67c1c3160..805d16654459 100644\n--- a/include/linux/byteorder/generic.h\n+++ b/include/linux/byteorder/generic.h\n@@ -170,4 +170,20 @@ static inline void be64_add_cpu(__be64 *var, u64 val)\n \t*var = cpu_to_be64(be64_to_cpu(*var) + val);\n }\n \n+static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < len; i++)\n+\t\tdst[i] = cpu_to_be32(src[i]);\n+}\n+\n+static inline void be32_to_cpu_array(u32 *dst, const __be32 *src, size_t len)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < len; i++)\n+\t\tdst[i] = be32_to_cpu(src[i]);\n+}\n+\n #endif /* _LINUX_BYTEORDER_GENERIC_H */\n","prefixes":["01/16"]}