Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/810093/?format=api
{ "id": 810093, "url": "http://patchwork.ozlabs.org/api/1.2/patches/810093/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/CAJ+F1C+mPu9ftXwgs4UrGTQp4f65-thhvmWoB-kuRmu0=vnFFw@mail.gmail.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<CAJ+F1C+mPu9ftXwgs4UrGTQp4f65-thhvmWoB-kuRmu0=vnFFw@mail.gmail.com>", "list_archive_url": null, "date": "2017-09-05T12:14:42", "name": "clang-tidy: use g_new() family of functions", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "652b84452329b5f491010fe16ff70e048491526a", "submitter": { "id": 6442, "url": "http://patchwork.ozlabs.org/api/1.2/people/6442/?format=api", "name": "Marc-André Lureau", "email": "marcandre.lureau@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/CAJ+F1C+mPu9ftXwgs4UrGTQp4f65-thhvmWoB-kuRmu0=vnFFw@mail.gmail.com/mbox/", "series": [ { "id": 1562, "url": "http://patchwork.ozlabs.org/api/1.2/series/1562/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=1562", "date": "2017-09-05T12:14:42", "name": "clang-tidy: use g_new() family of functions", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1562/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810093/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810093/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"dMFVp4cE\"; dkim-atps=neutral" ], "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmm0p3XFvz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 5 Sep 2017 22:16:42 +1000 (AEST)", "from localhost ([::1]:58608 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpCmW-000297-K7\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 08:16:40 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:43197)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dpCkm-00014A-91\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 08:15:01 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dpCke-0006ph-GW\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 08:14:52 -0400", "from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:36211)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <marcandre.lureau@gmail.com>)\n\tid 1dpCke-0006pV-C3; Tue, 05 Sep 2017 08:14:44 -0400", "by mail-oi0-x236.google.com with SMTP id x190so7516912oix.3;\n\tTue, 05 Sep 2017 05:14:44 -0700 (PDT)", "by 10.58.39.139 with HTTP; Tue, 5 Sep 2017 05:14:42 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:from:date:message-id:subject:to\n\t:content-transfer-encoding;\n\tbh=cY5hRczZCcApUoUFFhtEv3ZbLgK164PzRFxH7dcxCvE=;\n\tb=dMFVp4cEGJExSGjTI4Qi8qn2X3nFzvDjrprIwzUly8iMEx8v88baaNnQ2b1Zpp4qm2\n\t16wOX3Yvw7SdjVbA4UOAqoCdl61fwUo/Zou28NuzSrq9CpJT0/cvPNd/4k984LPJnB45\n\t2pYOL1+OQ3RcZNIeakzlRqTRPA4ZiJ3//rRi9m5OJ3PqRDgaqAHuStd6EetIeHv0QmzW\n\tDzTySx3dC6SN7VzQ5z2Y1OtPgNgIfBX/QZDtCqzezCL3tib52v+ZO6EOFjH8xWySoMFc\n\tRBAy2NQzPoTRq01d4zhYEkNdZl8K3X17ZqKYjJRO2aXFZ82WE016edNRpQmwIdm4+tg3\n\t/OqA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:from:date:message-id:subject:to\n\t:content-transfer-encoding;\n\tbh=cY5hRczZCcApUoUFFhtEv3ZbLgK164PzRFxH7dcxCvE=;\n\tb=myc+8zYBTqbSdYqotJ9knb46K6lwSjcEB/DzHpZeCcHwb74lmKtHUDDrZcq+1rsPEU\n\tOma61NYFyY111AQ/8h2m3BYYbh/zFpQI1q584K/ErWVht33nHiqLJq6w4IPgRl3mLy+D\n\t98o4ESiVgwWL8TbEL7XiIJYC4QaSqax0iUSKT9LC///6YnZZtJh/ognuFTt2P3lZVY7p\n\th8qgNoihgbE7grZW9IwKAiYSsQvB9GCtQn6222MBFw40pkoS0MDxMN9z1vk26wF2D64z\n\t7u4zMxPj0KCWcrrSBrbMLyYQOSCZnr8ypPgpRDWiL65l9tXPoAwIAIce428x2rBsxSNv\n\t6Ypw==", "X-Gm-Message-State": "AHPjjUi0xa4pSJTg41tCtb0iEnG3p7kDssVdkpFiQxstU5/iAMP4vUft\n\tiw7dIS+UwOPIGce2N6na0ek9hO9vVww5J0A=", "X-Google-Smtp-Source": "ADKCNb7kTJIzyb2rifhzOvTUA4EhRymRxaP/EZvmY5+ie6mXBLQjHpa+Ek2Y/1zUNO/HEQfZgI77d0e1ndD7+PNXV2U=", "X-Received": "by 10.202.86.211 with SMTP id k202mr3134073oib.122.1504613683430;\n\tTue, 05 Sep 2017 05:14:43 -0700 (PDT)", "MIME-Version": "1.0", "From": "=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@gmail.com>", "Date": "Tue, 5 Sep 2017 14:14:42 +0200", "Message-ID": "<CAJ+F1C+mPu9ftXwgs4UrGTQp4f65-thhvmWoB-kuRmu0=vnFFw@mail.gmail.com>", "To": "QEMU <qemu-devel@nongnu.org>, qemu trival <qemu-trivial@nongnu.org>", "Content-Type": "text/plain; charset=\"UTF-8\"", "Content-Transfer-Encoding": "quoted-printable", "X-detected-operating-system": "by eggs.gnu.org: Genre and OS details not\n\trecognized.", "X-Received-From": "2607:f8b0:4003:c06::236", "Subject": "[Qemu-devel] clang-tidy: use g_new() family of functions", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "Hi,\n\nI have a series of changes generated with clang-tidy qemu [1] pending\nfor review [2].\n\nIt translates calloc/*malloc*/*realloc() calls to\ng_new/g_newa/g_new0/g_renew() where the argument is a sizeof(T) [* N].\n\nThis is the first commit to give you an idea:\n\ng_new() advantages (from glib doc):\n- the returned pointer is cast to a pointer to the given type.\n- care is taken to avoid overflow when calculating the size of the\nallocated block.\n\nBut it is also shorter&nicer :)\n\nI have not included in the first batch the opportunity to also\ntranslate: alloc(sizeof(*p) * x) to g_new(typeof(*p), x), since it is\narguably not much nicer. But for consistency, I think it would be good\nto use g_new(). What do you think?\n\nI splitted the changes amont the various MAINTAINERS entries, but it\nis still about 70 patches (without the typeof() changes).\n\n\n[1] https://github.com/elmarco/clang-tools-extra/\n[2] https://github.com/elmarco/qemu/commits/gnew", "diff": "diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c\nindex 98fddd7ac1..75affcb8a6 100644\n--- a/hw/timer/arm_timer.c\n+++ b/hw/timer/arm_timer.c\n@@ -166,7 +166,7 @@ static arm_timer_state *arm_timer_init(uint32_t freq)\n arm_timer_state *s;\n QEMUBH *bh;\n\n- s = (arm_timer_state *)g_malloc0(sizeof(arm_timer_state));\n+ s = g_new0(arm_timer_state, 1);\n s->freq = freq;\n s->control = TIMER_CTRL_IE;\n\n", "prefixes": [] }