[{"id":1766394,"web_url":"http://patchwork.ozlabs.org/comment/1766394/","msgid":"<2b4623c9-eb92-77aa-fe1d-8e02b925591a@canonical.com>","list_archive_url":null,"date":"2017-09-11T16:51:17","subject":"ACK: [PATCH] lib: fwts_button: make button counts and button number\n\tuint32_t","submitter":{"id":10593,"url":"http://patchwork.ozlabs.org/api/people/10593/","name":"Alex Hung","email":"alex.hung@canonical.com"},"content":"On 2017-09-08 02:29 AM, Colin King wrote:\n> From: Colin Ian King <colin.king@canonical.com>\n> \n> There is no practical need for -ve button counts and button numbers\n> so make these uint32_t types.\n> \n> Signed-off-by: Colin Ian King <colin.king@canonical.com>\n> ---\n>   src/acpi/lid/lid.c            | 21 ++++++++++++---------\n>   src/lib/include/fwts_button.h |  2 +-\n>   src/lib/src/fwts_button.c     | 12 ++++++------\n>   3 files changed, 19 insertions(+), 16 deletions(-)\n> \n> diff --git a/src/acpi/lid/lid.c b/src/acpi/lid/lid.c\n> index 93e031c0..2542051e 100644\n> --- a/src/acpi/lid/lid.c\n> +++ b/src/acpi/lid/lid.c\n> @@ -31,7 +31,7 @@\n>   \n>   static int lid_init(fwts_framework *fw)\n>   {\n> -\tint matched, not_matched;\n> +\tuint32_t matched, not_matched;\n>   \n>   \tif (fwts_button_match_state(fw, FWTS_BUTTON_LID_ANY, &matched, &not_matched) != FWTS_OK) {\n>   \t\tfwts_failed(fw, LOG_LEVEL_LOW, \"NoLIDPath\",\n> @@ -41,13 +41,16 @@ static int lid_init(fwts_framework *fw)\n>   \treturn FWTS_OK;\n>   }\n>   \n> -static void lid_check_field_poll(fwts_framework *fw,\n> -\tint button, int *matching, int *not_matching)\n> +static void lid_check_field_poll(\n> +\tfwts_framework *fw,\n> +\tconst uint32_t button,\n> +\tuint32_t *matching,\n> +\tuint32_t *not_matching)\n>   {\n>   \tint i;\n>   \n> -\tint tmp_matching = 0;\n> -\tint tmp_not_matching = 0;\n> +\tuint32_t tmp_matching = 0;\n> +\tuint32_t tmp_not_matching = 0;\n>   \n>   \tfor (i = 0; i < 100; i++) {\n>   \t\tfwts_button_match_state(fw, button,\n> @@ -63,8 +66,8 @@ static void lid_check_field_poll(fwts_framework *fw,\n>   \n>   static int lid_test1(fwts_framework *fw)\n>   {\n> -\tint matching = 0;\n> -\tint not_matching = 0;\n> +\tuint32_t matching = 0;\n> +\tuint32_t not_matching = 0;\n>   \n>   \tfwts_printf(fw, \"==== Make sure laptop lid is open. ====\\n\");\n>   \tfwts_press_enter(fw);\n> @@ -84,8 +87,8 @@ static int lid_test_state(fwts_framework *fw, int button)\n>   {\n>   \tint gpe_count = 0;\n>   \tint fd;\n> -\tint matching = 0;\n> -\tint not_matching = 0;\n> +\tuint32_t matching = 0;\n> +\tuint32_t not_matching = 0;\n>   \tint events = 0;\n>   \tsize_t len;\n>   \tchar *state;\n> diff --git a/src/lib/include/fwts_button.h b/src/lib/include/fwts_button.h\n> index 5130c0c8..bc475e91 100644\n> --- a/src/lib/include/fwts_button.h\n> +++ b/src/lib/include/fwts_button.h\n> @@ -26,6 +26,6 @@\n>   \n>   #define FWTS_BUTTON_POWER_EXISTS\t(0x00010)\n>   \n> -int fwts_button_match_state(fwts_framework *fw, const int button, int *matched, int *not_matched);\n> +int fwts_button_match_state(fwts_framework *fw, const uint32_t button, uint32_t *matched, uint32_t *not_matched);\n>   \n>   #endif\n> diff --git a/src/lib/src/fwts_button.c b/src/lib/src/fwts_button.c\n> index 6e9a0101..c9fa8ee2 100644\n> --- a/src/lib/src/fwts_button.c\n> +++ b/src/lib/src/fwts_button.c\n> @@ -35,9 +35,9 @@\n>    *\tany non-matching states found, via proc iterface\n>    */\n>   static int fwts_button_match_state_proc(\n> -\tconst int button,\n> -\tint *matched,\n> -\tint *not_matched)\n> +\tconst uint32_t button,\n> +\tuint32_t *matched,\n> +\tuint32_t *not_matched)\n>   {\n>   \tDIR *dir;\n>   \tstruct dirent *entry;\n> @@ -112,9 +112,9 @@ static int fwts_button_match_state_proc(\n>    */\n>   int fwts_button_match_state(\n>   \tfwts_framework *fw,\n> -\tconst int button,\n> -\tint *matched,\n> -\tint *not_matched)\n> +\tconst uint32_t button,\n> +\tuint32_t *matched,\n> +\tuint32_t *not_matched)\n>   {\n>   \t*matched = 0;\n>   \t*not_matched = 0;\n> \n\nAcked-by: Alex Hung <alex.hung@canonical.com>","headers":{"Return-Path":"<fwts-devel-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xrYq20bTWz9s81;\n\tTue, 12 Sep 2017 02:51:26 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1drRvg-0005Hm-St; Mon, 11 Sep 2017 16:51:24 +0000","from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.86_2) (envelope-from <alex.hung@canonical.com>)\n\tid 1drRvf-0005HE-Mu\n\tfor fwts-devel@lists.ubuntu.com; Mon, 11 Sep 2017 16:51:23 +0000","from mail-pg0-f69.google.com ([74.125.83.69])\n\tby youngberry.canonical.com with esmtps\n\t(TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.76) (envelope-from <alex.hung@canonical.com>)\n\tid 1drRvf-0003FX-Bc\n\tfor fwts-devel@lists.ubuntu.com; Mon, 11 Sep 2017 16:51:23 +0000","by mail-pg0-f69.google.com with SMTP id m30so10076392pgn.2\n\tfor <fwts-devel@lists.ubuntu.com>;\n\tMon, 11 Sep 2017 09:51:23 -0700 (PDT)","from [192.168.1.125] ([207.102.104.225])\n\tby smtp.gmail.com with ESMTPSA id\n\tw134sm20040736pfd.186.2017.09.11.09.51.20\n\tfor <fwts-devel@lists.ubuntu.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Sep 2017 09:51:20 -0700 (PDT)"],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=KPpdW4i+ELqyrwSAU6Fy14lPJJ/MZgTL5hS4DMy8gpo=;\n\tb=mtho5TUkiIOEOAJi76DO0qS7xDjElhx2VoQXndticVcZRuKWbbEcZM5IJsIAhVguWG\n\tvGqPnDH0fVlQsErwmhrPSqd0c6RmNVX3+N7gck50TRoHbU/Rnmn8sx7xmDvtS0r/308z\n\tsoUFXX+0c559p38KlAgXZ7ayOkVlH/VziM2CedsK8jbvREPIkvEUeKXSQL8mFaQuGA94\n\tYetBdeYKQYBvyLz1Ba4RbNIoOfKV2yYMJlnxBh+Lj/SbZE3ZCaiKdL4+ziZdRusOhq7v\n\traiD1g3cr9qbS2wU/X4yD46U3MRG85ys8JIO8CocRrykNGnJ39LFmtdRf8y988fRqZQJ\n\tkYQw==","X-Gm-Message-State":"AHPjjUjkbkReEPs9uSz4MTFtUiIMVMa5ql7d05bNTRP5G85h7vMIo4Ck\n\t8uiz0p8kMD072ew9Yqy3IW8uFjgquBmoJttH6OxpZ4r4jRWBQNi5CaanJOgtu/J72UyTseA+WC8\n\tHJBKLyO7+qB/H7/iTUPYftrPeKYvh06s=","X-Received":["by 10.98.87.193 with SMTP id i62mr12432969pfj.186.1505148681623; \n\tMon, 11 Sep 2017 09:51:21 -0700 (PDT)","by 10.98.87.193 with SMTP id i62mr12432964pfj.186.1505148681405; \n\tMon, 11 Sep 2017 09:51:21 -0700 (PDT)"],"X-Google-Smtp-Source":"ADKCNb5q4+k2V4pweglFt1H2w3m/n6fWicxp3hL24Sb+qGL1wqmb3jM36VRce+KjM5QoSJ9XLFLSiA==","Subject":"ACK: [PATCH] lib: fwts_button: make button counts and button number\n\tuint32_t","To":"fwts-devel@lists.ubuntu.com","References":"<20170908092930.20559-1-colin.king@canonical.com>","From":"Alex Hung <alex.hung@canonical.com>","Message-ID":"<2b4623c9-eb92-77aa-fe1d-8e02b925591a@canonical.com>","Date":"Mon, 11 Sep 2017 09:51:17 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170908092930.20559-1-colin.king@canonical.com>","Content-Language":"en-US","X-BeenThere":"fwts-devel@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/fwts-devel>","List-Post":"<mailto:fwts-devel@lists.ubuntu.com>","List-Help":"<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"fwts-devel-bounces@lists.ubuntu.com","Sender":"\"fwts-devel\" <fwts-devel-bounces@lists.ubuntu.com>"}},{"id":1772598,"web_url":"http://patchwork.ozlabs.org/comment/1772598/","msgid":"<43bd0c9c-2983-c693-4813-2248c4678002@canonical.com>","list_archive_url":null,"date":"2017-09-21T09:15:59","subject":"ACK: [PATCH] lib: fwts_button: make button counts and button number\n\tuint32_t","submitter":{"id":14061,"url":"http://patchwork.ozlabs.org/api/people/14061/","name":"Ivan Hu","email":"ivan.hu@canonical.com"},"content":"On 09/08/2017 05:29 PM, Colin King wrote:\n> From: Colin Ian King <colin.king@canonical.com>\n> \n> There is no practical need for -ve button counts and button numbers\n> so make these uint32_t types.\n> \n> Signed-off-by: Colin Ian King <colin.king@canonical.com>\n> ---\n>   src/acpi/lid/lid.c            | 21 ++++++++++++---------\n>   src/lib/include/fwts_button.h |  2 +-\n>   src/lib/src/fwts_button.c     | 12 ++++++------\n>   3 files changed, 19 insertions(+), 16 deletions(-)\n> \n> diff --git a/src/acpi/lid/lid.c b/src/acpi/lid/lid.c\n> index 93e031c0..2542051e 100644\n> --- a/src/acpi/lid/lid.c\n> +++ b/src/acpi/lid/lid.c\n> @@ -31,7 +31,7 @@\n>   \n>   static int lid_init(fwts_framework *fw)\n>   {\n> -\tint matched, not_matched;\n> +\tuint32_t matched, not_matched;\n>   \n>   \tif (fwts_button_match_state(fw, FWTS_BUTTON_LID_ANY, &matched, &not_matched) != FWTS_OK) {\n>   \t\tfwts_failed(fw, LOG_LEVEL_LOW, \"NoLIDPath\",\n> @@ -41,13 +41,16 @@ static int lid_init(fwts_framework *fw)\n>   \treturn FWTS_OK;\n>   }\n>   \n> -static void lid_check_field_poll(fwts_framework *fw,\n> -\tint button, int *matching, int *not_matching)\n> +static void lid_check_field_poll(\n> +\tfwts_framework *fw,\n> +\tconst uint32_t button,\n> +\tuint32_t *matching,\n> +\tuint32_t *not_matching)\n>   {\n>   \tint i;\n>   \n> -\tint tmp_matching = 0;\n> -\tint tmp_not_matching = 0;\n> +\tuint32_t tmp_matching = 0;\n> +\tuint32_t tmp_not_matching = 0;\n>   \n>   \tfor (i = 0; i < 100; i++) {\n>   \t\tfwts_button_match_state(fw, button,\n> @@ -63,8 +66,8 @@ static void lid_check_field_poll(fwts_framework *fw,\n>   \n>   static int lid_test1(fwts_framework *fw)\n>   {\n> -\tint matching = 0;\n> -\tint not_matching = 0;\n> +\tuint32_t matching = 0;\n> +\tuint32_t not_matching = 0;\n>   \n>   \tfwts_printf(fw, \"==== Make sure laptop lid is open. ====\\n\");\n>   \tfwts_press_enter(fw);\n> @@ -84,8 +87,8 @@ static int lid_test_state(fwts_framework *fw, int button)\n>   {\n>   \tint gpe_count = 0;\n>   \tint fd;\n> -\tint matching = 0;\n> -\tint not_matching = 0;\n> +\tuint32_t matching = 0;\n> +\tuint32_t not_matching = 0;\n>   \tint events = 0;\n>   \tsize_t len;\n>   \tchar *state;\n> diff --git a/src/lib/include/fwts_button.h b/src/lib/include/fwts_button.h\n> index 5130c0c8..bc475e91 100644\n> --- a/src/lib/include/fwts_button.h\n> +++ b/src/lib/include/fwts_button.h\n> @@ -26,6 +26,6 @@\n>   \n>   #define FWTS_BUTTON_POWER_EXISTS\t(0x00010)\n>   \n> -int fwts_button_match_state(fwts_framework *fw, const int button, int *matched, int *not_matched);\n> +int fwts_button_match_state(fwts_framework *fw, const uint32_t button, uint32_t *matched, uint32_t *not_matched);\n>   \n>   #endif\n> diff --git a/src/lib/src/fwts_button.c b/src/lib/src/fwts_button.c\n> index 6e9a0101..c9fa8ee2 100644\n> --- a/src/lib/src/fwts_button.c\n> +++ b/src/lib/src/fwts_button.c\n> @@ -35,9 +35,9 @@\n>    *\tany non-matching states found, via proc iterface\n>    */\n>   static int fwts_button_match_state_proc(\n> -\tconst int button,\n> -\tint *matched,\n> -\tint *not_matched)\n> +\tconst uint32_t button,\n> +\tuint32_t *matched,\n> +\tuint32_t *not_matched)\n>   {\n>   \tDIR *dir;\n>   \tstruct dirent *entry;\n> @@ -112,9 +112,9 @@ static int fwts_button_match_state_proc(\n>    */\n>   int fwts_button_match_state(\n>   \tfwts_framework *fw,\n> -\tconst int button,\n> -\tint *matched,\n> -\tint *not_matched)\n> +\tconst uint32_t button,\n> +\tuint32_t *matched,\n> +\tuint32_t *not_matched)\n>   {\n>   \t*matched = 0;\n>   \t*not_matched = 0;\n> \n\nAcked-by: Ivan Hu <ivan.hu@canonical.com>","headers":{"Return-Path":"<fwts-devel-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyWF15Hk4z9t42;\n\tThu, 21 Sep 2017 19:16:05 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1duxaW-0001Go-Hb; Thu, 21 Sep 2017 09:16:04 +0000","from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.86_2) (envelope-from <ivan.hu@canonical.com>)\n\tid 1duxaV-0001GR-2g\n\tfor fwts-devel@lists.ubuntu.com; Thu, 21 Sep 2017 09:16:03 +0000","from [175.181.226.10] (helo=[192.168.31.95])\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.76) (envelope-from <ivan.hu@canonical.com>)\n\tid 1duxaU-0004Jh-IF\n\tfor fwts-devel@lists.ubuntu.com; Thu, 21 Sep 2017 09:16:02 +0000"],"Subject":"ACK: [PATCH] lib: fwts_button: make button counts and button number\n\tuint32_t","To":"fwts-devel@lists.ubuntu.com","References":"<20170908092930.20559-1-colin.king@canonical.com>","From":"ivanhu <ivan.hu@canonical.com>","Message-ID":"<43bd0c9c-2983-c693-4813-2248c4678002@canonical.com>","Date":"Thu, 21 Sep 2017 17:15:59 +0800","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170908092930.20559-1-colin.king@canonical.com>","Content-Language":"en-GB","X-BeenThere":"fwts-devel@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/fwts-devel>","List-Post":"<mailto:fwts-devel@lists.ubuntu.com>","List-Help":"<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"fwts-devel-bounces@lists.ubuntu.com","Sender":"\"fwts-devel\" <fwts-devel-bounces@lists.ubuntu.com>"}}]