Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/97878/?format=api
{ "id": 97878, "url": "http://patchwork.ozlabs.org/api/patches/97878/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1306740182-2665-15-git-send-email-sven@narfation.org/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/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": "<1306740182-2665-15-git-send-email-sven@narfation.org>", "list_archive_url": null, "date": "2011-05-30T07:22:59", "name": "[14/17] batman-adv: Check type of x and y in seq_(before|after)", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "2d2b475a4b02398f7d7939f88e2e0148ada8e887", "submitter": { "id": 6204, "url": "http://patchwork.ozlabs.org/api/people/6204/?format=api", "name": "Sven Eckelmann", "email": "sven@narfation.org" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1306740182-2665-15-git-send-email-sven@narfation.org/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/97878/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/97878/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 528C3B6F72\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 30 May 2011 17:23:41 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753868Ab1E3HX0 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 30 May 2011 03:23:26 -0400", "from narfation.org ([79.140.41.39]:60265 \"EHLO v3-1039.vlinux.de\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1755237Ab1E3HXW (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 30 May 2011 03:23:22 -0400", "from sven-desktop.home.narfation.org\n\t(bathseba.informatik.tu-chemnitz.de [134.109.192.185])\n\tby v3-1039.vlinux.de (Postfix) with ESMTPSA id A9B42940ED;\n\tMon, 30 May 2011 09:23:47 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=mail; \n\tt=1306740227; bh=kxU3Gwha7cAWMyshMJp156pb6VJoyDx/BDxS+S+jQMI=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References;\n\tb=cXvVPVmuHSNpd+Ja44NTP59TjR9D9NMl4cbZP8+jrf2mm+QCk43FV6qcmL+C/UJDz\n\tx2v5sXjRvaIyEF3Z7NBdj3Z+pwNsmRnDDmWkVVFv6VkqWTR+U4ajb4fwaY6R+8+emO\n\txCHbr/oDpAUxIbLC4AKB6oDmqSC5nx+yDsGdFttg=", "From": "Sven Eckelmann <sven@narfation.org>", "To": "davem@davemloft.net", "Cc": "netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,\n\tSven Eckelmann <sven@narfation.org>", "Subject": "[PATCH 14/17] batman-adv: Check type of x and y in\n\tseq_(before|after)", "Date": "Mon, 30 May 2011 09:22:59 +0200", "Message-Id": "<1306740182-2665-15-git-send-email-sven@narfation.org>", "X-Mailer": "git-send-email 1.7.5.3", "In-Reply-To": "<1306740182-2665-1-git-send-email-sven@narfation.org>", "References": "<1306740182-2665-1-git-send-email-sven@narfation.org>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "seq_before and seq_after depend on the fact that both sequence numbers\nhave the same type and thus the same bitwidth. We can ensure that by\ncompile time checking using a compare between the pointer to the\ntemporary buffers which were created using the typeof of both\nparameters. For example gcc would create a warning like\n\"warning: comparison of distinct pointer types lacks a cast\".\n\nSigned-off-by: Sven Eckelmann <sven@narfation.org>\n---\n net/batman-adv/main.h | 7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)", "diff": "diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h\nindex 80be5ad..610eaf0 100644\n--- a/net/batman-adv/main.h\n+++ b/net/batman-adv/main.h\n@@ -194,8 +194,11 @@ static inline int compare_eth(const void *data1, const void *data2)\n * - before adding more than 127 to the starting value - it is a predecessor,\n * - when adding 128 - it is neither a predecessor nor a successor,\n * - after adding more than 127 to the starting value - it is a successor */\n-#define seq_before(x, y) ({typeof(x) _dummy = (x - y); \\\n-\t\t\t_dummy > smallest_signed_int(_dummy); })\n+#define seq_before(x, y) ({typeof(x) _d1 = (x); \\\n+\t\t\t typeof(y) _d2 = (y); \\\n+\t\t\t typeof(x) _dummy = (_d1 - _d2); \\\n+\t\t\t (void) (&_d1 == &_d2); \\\n+\t\t\t _dummy > smallest_signed_int(_dummy); })\n #define seq_after(x, y) seq_before(y, x)\n \n #endif /* _NET_BATMAN_ADV_MAIN_H_ */\n", "prefixes": [ "14/17" ] }