Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/833992/?format=api
{ "id": 833992, "url": "http://patchwork.ozlabs.org/api/1.2/patches/833992/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20171103163220.3799742-1-arnd@arndb.de/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/1.2/projects/7/?format=api", "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": "<20171103163220.3799742-1-arnd@arndb.de>", "list_archive_url": null, "date": "2017-11-03T16:31:36", "name": "[1/2] can: peak_usb: remove some 'struct timeval' users", "commit_ref": null, "pull_url": null, "state": "awaiting-upstream", "archived": true, "hash": "75121510d3925a00b1165becf0003d5755fffbb4", "submitter": { "id": 30, "url": "http://patchwork.ozlabs.org/api/1.2/people/30/?format=api", "name": "Arnd Bergmann", "email": "arnd@arndb.de" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/1.2/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20171103163220.3799742-1-arnd@arndb.de/mbox/", "series": [ { "id": 11780, "url": "http://patchwork.ozlabs.org/api/1.2/series/11780/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=11780", "date": "2017-11-03T16:31:37", "name": "[1/2] can: peak_usb: remove some 'struct timeval' users", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/11780/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/833992/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/833992/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 3yT6vy3wPRz9sNV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 4 Nov 2017 03:33:34 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756135AbdKCQdD (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 3 Nov 2017 12:33:03 -0400", "from mout.kundenserver.de ([212.227.126.131]:62219 \"EHLO\n\tmout.kundenserver.de\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1755977AbdKCQdB (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 3 Nov 2017 12:33:01 -0400", "from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de\n\t(mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id\n\t0MYHJs-1dfwlT1NL6-00Uoik; Fri, 03 Nov 2017 17:32:31 +0100" ], "From": "Arnd Bergmann <arnd@arndb.de>", "To": "Wolfgang Grandegger <wg@grandegger.com>,\n\tMarc Kleine-Budde <mkl@pengutronix.de>", "Cc": "Arnd Bergmann <arnd@arndb.de>, \"David S. Miller\" <davem@davemloft.net>,\n\tKees Cook <keescook@chromium.org>, \n\tAllen Pais <allen.lkml@gmail.com>, Stephane Grosjean\n\t<s.grosjean@peak-system.com>, Johan Hovold <johan@kernel.org>,\n\t=?utf-8?b?7LaU7KeA7Zi4?= <jiho.chu@samsung.com>,\n\tlinux-can@vger.kernel.org, netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org", "Subject": "[PATCH 1/2] can: peak_usb: remove some 'struct timeval' users", "Date": "Fri, 3 Nov 2017 17:31:36 +0100", "Message-Id": "<20171103163220.3799742-1-arnd@arndb.de>", "X-Mailer": "git-send-email 2.9.0", "X-Provags-ID": "V03:K0:/LCdvyroFt+daSO3yYKLspZC5Afz7wmFkhhBrBRVkNYbEZexHpW\n\tOz1qd646AWDF1OwyC0R8ssHarl6nBsfxqmy2eBZ6eG16N03TlBnWtfQxX8Lwn7Lt5P+cU/6\n\tLPA4k+UpUd59Etg+vKHNvnTdpYNdnFRQL7OmZwDZlXwFfTcCuguvbq4pQt4I20BwbA/3afG\n\t4xMYxsGEey+t0hgeungzQ==", "X-UI-Out-Filterresults": "notjunk:1; V01:K0:El1vHa/DNr8=:tul7aSLBdV6+ycBg9QdTHu\n\tjf3LA4d0R01mPtOxXbxjnZ2rrAbka6lWrk2AS2y5vokozyFDQQNrttcYUJZBUomCyKByHDMyq\n\tzEltAeSiSG7FpIs10bKqG46IYJl6uTe2PSpyHWQFF837k1Uu/+V9lsM9htkujCnRRAy41xyS9\n\tUYccC6o8emodw8e/gEdT/HMlV1DqevMmlBFK6ThBlZSJ/r/Bid0Sy9xzgRG3UsN88XkSN5F3w\n\tFbDbSMTbvBLu18WF0qc1rl0Uldpb5wUlJ8FTJ/BQrDFuY0Ij0RKwFaFJoDXwY1X9bcpJisMtK\n\tsxZR7oox0eu5Y1BSUQ6E+h7azk7mQoCtEZYKzRvWre2Y19HNQf9lzzcReS46E3AcDIG3Txb/h\n\tO3d+a0yf0eLP4y9TazyKgSdnz2zIxgK6k/1+c3S0tic+rRNVAox7vimo9bMH+wUBIUVaiYSJ0\n\t8l1qRaolMmZUI8CwbTs0k0lhuHmDfOVyhsNACE9etjx9hmUWEcjqzFqy1mTo4AkRb0JlMuihV\n\tXWRVvcVhoQGIbIlFtg1+IZdOXsgDRY0vbnoYVZcNb2y0xHor20zF3YOu7pH6Mf4rM1fITN5lf\n\twoiR3zTXGlNRhoHlD9yL5Qm+KL0NLfuPNhblmkx584gIkEjZblk75Xo88DDbh3MrbtjdIh+VB\n\t9RMIElkpO5mfSUmSHf5hWS2BUIhD/wQnJ/KIG3xZLQLOES9OdChPAruNH3iirjuTZ2DnCb16S\n\tu88Zvu6HiBowcFXzGkt4TZx5OnlxKLjiM/dqWQ==", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "We want to remove 'struct timeval' and related interfaces since this is\ngenerally not safe for use beyond 2038.\n\nFor peak_usb, we can simplify the internal interface by using ktime_t\ndirectly. This should not change any behavior, but it avoids a few\nconversions.\n\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\n---\n drivers/net/can/usb/peak_usb/pcan_usb.c | 9 +++------\n drivers/net/can/usb/peak_usb/pcan_usb_core.c | 15 +++++++--------\n drivers/net/can/usb/peak_usb/pcan_usb_core.h | 3 +--\n drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 9 +++------\n 4 files changed, 14 insertions(+), 22 deletions(-)", "diff": "diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c\nindex 25a9b79cc42d..f530a80f5051 100644\n--- a/drivers/net/can/usb/peak_usb/pcan_usb.c\n+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c\n@@ -408,7 +408,6 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,\n {\n \tstruct sk_buff *skb;\n \tstruct can_frame *cf;\n-\tstruct timeval tv;\n \tenum can_state new_state;\n \n \t/* ignore this error until 1st ts received */\n@@ -525,8 +524,8 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,\n \tif (status_len & PCAN_USB_STATUSLEN_TIMESTAMP) {\n \t\tstruct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb);\n \n-\t\tpeak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);\n-\t\thwts->hwtstamp = timeval_to_ktime(tv);\n+\t\tpeak_usb_get_ts_time(&mc->pdev->time_ref, mc->ts16,\n+\t\t\t\t &hwts->hwtstamp);\n \t}\n \n \tmc->netdev->stats.rx_packets++;\n@@ -610,7 +609,6 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)\n \tu8 rec_len = status_len & PCAN_USB_STATUSLEN_DLC;\n \tstruct sk_buff *skb;\n \tstruct can_frame *cf;\n-\tstruct timeval tv;\n \tstruct skb_shared_hwtstamps *hwts;\n \n \tskb = alloc_can_skb(mc->netdev, &cf);\n@@ -658,9 +656,8 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)\n \t}\n \n \t/* convert timestamp into kernel time */\n-\tpeak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);\n \thwts = skb_hwtstamps(skb);\n-\thwts->hwtstamp = timeval_to_ktime(tv);\n+\tpeak_usb_get_ts_time(&mc->pdev->time_ref, mc->ts16, &hwts->hwtstamp);\n \n \t/* update statistics */\n \tmc->netdev->stats.rx_packets++;\ndiff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c\nindex 1ca76e03e965..695a75a9b4bb 100644\n--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c\n+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c\n@@ -148,11 +148,11 @@ void peak_usb_set_ts_now(struct peak_time_ref *time_ref, u32 ts_now)\n /*\n * compute timeval according to current ts and time_ref data\n */\n-void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,\n-\t\t\tstruct timeval *tv)\n+void peak_usb_get_ts_time(struct peak_time_ref *time_ref, u32 ts, ktime_t *time)\n {\n \t/* protect from getting timeval before setting now */\n \tif (time_ref->tv_host.tv_sec > 0) {\n+\t\tstruct timeval tv;\n \t\tu64 delta_us;\n \n \t\tdelta_us = ts - time_ref->ts_dev_2;\n@@ -164,10 +164,11 @@ void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,\n \t\tdelta_us *= time_ref->adapter->us_per_ts_scale;\n \t\tdelta_us >>= time_ref->adapter->us_per_ts_shift;\n \n-\t\t*tv = time_ref->tv_host_0;\n-\t\tpeak_usb_add_us(tv, (u32)delta_us);\n+\t\ttv = time_ref->tv_host_0;\n+\t\tpeak_usb_add_us(&tv, (u32)delta_us);\n+\t\t*time = timeval_to_ktime(tv);\n \t} else {\n-\t\t*tv = ktime_to_timeval(ktime_get());\n+\t\t*time = ktime_get();\n \t}\n }\n \n@@ -178,10 +179,8 @@ int peak_usb_netif_rx(struct sk_buff *skb,\n \t\t struct peak_time_ref *time_ref, u32 ts_low, u32 ts_high)\n {\n \tstruct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb);\n-\tstruct timeval tv;\n \n-\tpeak_usb_get_ts_tv(time_ref, ts_low, &tv);\n-\thwts->hwtstamp = timeval_to_ktime(tv);\n+\tpeak_usb_get_ts_time(time_ref, ts_low, &hwts->hwtstamp);\n \n \treturn netif_rx(skb);\n }\ndiff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.h b/drivers/net/can/usb/peak_usb/pcan_usb_core.h\nindex c01316cac354..b9a221ea7e5c 100644\n--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.h\n+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.h\n@@ -151,8 +151,7 @@ void peak_usb_init_time_ref(struct peak_time_ref *time_ref,\n \t\t\t const struct peak_usb_adapter *adapter);\n void peak_usb_update_ts_now(struct peak_time_ref *time_ref, u32 ts_now);\n void peak_usb_set_ts_now(struct peak_time_ref *time_ref, u32 ts_now);\n-void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,\n-\t\t\tstruct timeval *tv);\n+void peak_usb_get_ts_time(struct peak_time_ref *time_ref, u32 ts, ktime_t *tv);\n int peak_usb_netif_rx(struct sk_buff *skb,\n \t\t struct peak_time_ref *time_ref, u32 ts_low, u32 ts_high);\n void peak_usb_async_complete(struct urb *urb);\ndiff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c\nindex bbdd6058cd2f..0105fbfea273 100644\n--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c\n+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c\n@@ -531,7 +531,6 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if,\n \tstruct net_device *netdev = dev->netdev;\n \tstruct can_frame *can_frame;\n \tstruct sk_buff *skb;\n-\tstruct timeval tv;\n \tstruct skb_shared_hwtstamps *hwts;\n \n \tskb = alloc_can_skb(netdev, &can_frame);\n@@ -549,9 +548,9 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if,\n \telse\n \t\tmemcpy(can_frame->data, rx->data, can_frame->can_dlc);\n \n-\tpeak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(rx->ts32), &tv);\n \thwts = skb_hwtstamps(skb);\n-\thwts->hwtstamp = timeval_to_ktime(tv);\n+\tpeak_usb_get_ts_time(&usb_if->time_ref, le32_to_cpu(rx->ts32),\n+\t\t\t &hwts->hwtstamp);\n \n \tnetdev->stats.rx_packets++;\n \tnetdev->stats.rx_bytes += can_frame->can_dlc;\n@@ -571,7 +570,6 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,\n \tenum can_state new_state = CAN_STATE_ERROR_ACTIVE;\n \tu8 err_mask = 0;\n \tstruct sk_buff *skb;\n-\tstruct timeval tv;\n \tstruct skb_shared_hwtstamps *hwts;\n \n \t/* nothing should be sent while in BUS_OFF state */\n@@ -667,9 +665,8 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,\n \n \tdev->can.state = new_state;\n \n-\tpeak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(er->ts32), &tv);\n \thwts = skb_hwtstamps(skb);\n-\thwts->hwtstamp = timeval_to_ktime(tv);\n+\tpeak_usb_get_ts_time(&usb_if->time_ref, le32_to_cpu(er->ts32), &hwts->hwtstamp);\n \tnetdev->stats.rx_packets++;\n \tnetdev->stats.rx_bytes += can_frame->can_dlc;\n \tnetif_rx(skb);\n", "prefixes": [ "1/2" ] }