[{"id":1764220,"web_url":"http://patchwork.ozlabs.org/comment/1764220/","msgid":"<1504713173.7546.3.camel@perches.com>","list_archive_url":null,"date":"2017-09-06T15:52:53","subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","submitter":{"id":771,"url":"http://patchwork.ozlabs.org/api/people/771/","name":"Joe Perches","email":"joe@perches.com"},"content":"On Wed, 2017-09-06 at 17:47 +0200, Arnd Bergmann wrote:\n> gcc-7 notices that the pin_table is an array of 16-bit numbers,\n> but fails to take the following range check into account:\n> \n> drivers/gpio/gpiolib-acpi.c: In function 'acpi_gpiochip_request_interrupt':\n> drivers/gpio/gpiolib-acpi.c:206:24: warning: '%02X' directive writing between 2 and 4 bytes into a region of size 3 [-Wformat-overflow=]\n>    sprintf(ev_name, \"_%c%02X\",\n>                         ^~~~\n> drivers/gpio/gpiolib-acpi.c:206:20: note: directive argument in the range [0, 65535]\n>    sprintf(ev_name, \"_%c%02X\",\n>                     ^~~~~~~~~\n> drivers/gpio/gpiolib-acpi.c:206:3: note: 'sprintf' output between 5 and 7 bytes into a destination of size 5\n>    sprintf(ev_name, \"_%c%02X\",\n>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~\n>     agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',\n>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n>     pin);\n>     ~~~~\n> \n> As suggested by Andy, this changes the format string to have a fixed length.\n> Since modifying the range check did not help, I also opened a bug against\n> gcc, see link below.\n\nThe code has\n\n\tint pin\n\ndoes changing pin to unsigned int matter?\n\n> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c\n[]\n> @@ -203,7 +203,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,\n>  \n>  \tif (pin <= 255) {\n>  \t\tchar ev_name[5];\n> -\t\tsprintf(ev_name, \"_%c%02X\",\n> +\t\tsprintf(ev_name, \"_%c%02hhX\",\n>  \t\t\tagpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',\n>  \t\t\tpin);\n>  \t\tif (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-gpio\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-gpio-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.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=linux-gpio-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 3xnSxY6sYVz9t4Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 02:01:21 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754018AbdIFQBU (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 6 Sep 2017 12:01:20 -0400","from smtprelay0083.hostedemail.com ([216.40.44.83]:52849 \"EHLO\n\tsmtprelay.hostedemail.com\" rhost-flags-OK-OK-OK-FAIL)\n\tby vger.kernel.org with ESMTP id S1754005AbdIFQBT (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Wed, 6 Sep 2017 12:01:19 -0400","from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com\n\t[10.5.19.251])\n\tby smtpgrave08.hostedemail.com (Postfix) with ESMTP id 51CC5182D3218; \n\tWed,  6 Sep 2017 15:52:59 +0000 (UTC)","from filter.hostedemail.com (clb03-v110.bra.tucows.net\n\t[216.40.38.60])\n\tby smtprelay01.hostedemail.com (Postfix) with ESMTP id 987A81005E371; \n\tWed,  6 Sep 2017 15:52:57 +0000 (UTC)","from XPS-9350 (unknown [47.151.132.55])\n\t(Authenticated sender: joe@perches.com)\n\tby omf10.hostedemail.com (Postfix) with ESMTPA;\n\tWed,  6 Sep 2017 15:52:55 +0000 (UTC)"],"X-Greylist":"delayed 501 seconds by postgrey-1.27 at vger.kernel.org;\n\tWed, 06 Sep 2017 12:01:19 EDT","X-Session-Marker":"6A6F6540706572636865732E636F6D","X-Spam-Summary":"2, 0, 0, , d41d8cd98f00b204, joe@perches.com,\n\t:::::::::::::::::::,\n\tRULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2393:2559:2562:2828:2890:2902:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3874:4042:4321:4605:5007:7903:8603:9707:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12295:12296:12438:12555:12683:12740:12760:12895:13069:13161:13229:13311:13357:13439:14659:14721:21067:21080:21450:21451:21627:30001:30012:30034:30054:30070:30091,\n\t0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5,\n\tNetcheck:none, DomainCache:0, MSF:not bulk, SPF:, MSBL:0,\n\tDNSBL:none, Custom_rules:0:0:0, LFtime:1, LUA_SUMMARY:none","X-HE-Tag":"twist63_198305eba2826","X-Filterd-Recvd-Size":"2716","Message-ID":"<1504713173.7546.3.camel@perches.com>","Subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","From":"Joe Perches <joe@perches.com>","To":"Arnd Bergmann <arnd@arndb.de>,\n\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tLinus Walleij <linus.walleij@linaro.org>","Cc":"Dmitry Torokhov <dmitry.torokhov@gmail.com>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tWei Yongjun <weiyongjun1@huawei.com>,\n\tlinux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org","Date":"Wed, 06 Sep 2017 08:52:53 -0700","In-Reply-To":"<20170906154756.2133726-1-arnd@arndb.de>","References":"<20170906154756.2133726-1-arnd@arndb.de>","Content-Type":"text/plain; charset=\"ISO-8859-1\"","X-Mailer":"Evolution 3.22.6-1ubuntu1 ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","Sender":"linux-gpio-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-gpio.vger.kernel.org>","X-Mailing-List":"linux-gpio@vger.kernel.org"}},{"id":1764331,"web_url":"http://patchwork.ozlabs.org/comment/1764331/","msgid":"<CAK8P3a2RGZFc3_XpgyfuxwYy-vOoYkkamxQzma8JKwLjCCJasQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-06T19:53:51","subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","submitter":{"id":30,"url":"http://patchwork.ozlabs.org/api/people/30/","name":"Arnd Bergmann","email":"arnd@arndb.de"},"content":"On Wed, Sep 6, 2017 at 5:52 PM, Joe Perches <joe@perches.com> wrote:\n> On Wed, 2017-09-06 at 17:47 +0200, Arnd Bergmann wrote:\n\n>> As suggested by Andy, this changes the format string to have a fixed length.\n>> Since modifying the range check did not help, I also opened a bug against\n>> gcc, see link below.\n>\n> The code has\n>\n>         int pin\n>\n> does changing pin to unsigned int matter?\n\nNo difference, see also the gcc bugzilla report.\n\n        Arnd\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-gpio\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-gpio-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.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=linux-gpio-owner@vger.kernel.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=\"BhbsTmx1\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnZ5v3rStz9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 05:53:55 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752066AbdIFTxy (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 6 Sep 2017 15:53:54 -0400","from mail-oi0-f66.google.com ([209.85.218.66]:33588 \"EHLO\n\tmail-oi0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751969AbdIFTxx (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Wed, 6 Sep 2017 15:53:53 -0400","by mail-oi0-f66.google.com with SMTP id z73so174122oia.0;\n\tWed, 06 Sep 2017 12:53:52 -0700 (PDT)","by 10.157.91.35 with HTTP; Wed, 6 Sep 2017 12:53:51 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=GfL1Gem2Uqjcm2F+UAjnmvszwD6OvUWSVBOznsdKCaM=;\n\tb=BhbsTmx1fW/Wt/UFryjSK2XDW868LAYYh7eNHDsUzIhz7jO6NlWJxJUm/c8cpxJF8m\n\tRQZcjPrMjPzLNExvL/o8ATYp+C0HCZgAuu68p3wwsZK4PSaIXRvDyXzJrSwqBb3IW3/N\n\tTIVDPdGLs+ax49OE7lbPNi8V3qrE0MHzJeJcXJD2lc6fCttOpbfVOBdo02gVoJOflB55\n\tMG5tc/eyNd2w+0ISKfcpusiYZl7P85XHmYM326O6nKPtxXda3wBlUifUtvV/AwqCxD/i\n\tPTjgkCaq81htzQF1RK7lPIZLalDpXr3O7GhXLDvnuJ1rSlk4SlJSaoghMQ+nTTIskxL/\n\t1Svg==","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:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=GfL1Gem2Uqjcm2F+UAjnmvszwD6OvUWSVBOznsdKCaM=;\n\tb=ftaRqo6tmbBE57PXCq84e9p+KOtCY7z67b++cWfUEen8Ibid1ic7/l2ggECKgk82Ps\n\tGI1l3hYgY28a3sQunq/JRxQIUVoN/fA2HStNUXH3OjrgUvbkmZxrRhBu1o7+1XopmiQ3\n\tderHg5EzDOoFCkLr4wKgIfuCjzkcnWA4WLTCIjOURKUW5wUpcdPlLDSzU0lHP3EX3IRb\n\t9nxqqOUuzYhRMoKiBGwS4E9DHB53OJAOC7P4O8CxdX598WORphyA4/1nRA9CCoBXUN5T\n\t672WBJWrbm2msukfuXe+8SvmtBuWjdrUj57850h8g/QQiiQcEGnJjIv4/hrn7BykriQ6\n\trctg==","X-Gm-Message-State":"AHPjjUjn6jkR//mk825jUTrvUElYwehBrDXvuksSRzQFoqK+rPSJgnAS\n\tagCRUwMkBh4XKBykDlNrACGF6xz4wA==","X-Google-Smtp-Source":"ADKCNb6R3DRS3D7EQgihEhIMbyXsAqH5GjQUhIOqQGpUOps4BbBA5sV1eGjc8hVmohjJU/pPHqjtqBzqr+bGEtfb9Eo=","X-Received":"by 10.202.107.65 with SMTP id g62mr321217oic.227.1504727632166; \n\tWed, 06 Sep 2017 12:53:52 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1504713173.7546.3.camel@perches.com>","References":"<20170906154756.2133726-1-arnd@arndb.de>\n\t<1504713173.7546.3.camel@perches.com>","From":"Arnd Bergmann <arnd@arndb.de>","Date":"Wed, 6 Sep 2017 21:53:51 +0200","X-Google-Sender-Auth":"uZ71TUak-9CIM4_pj8twtzNV5N8","Message-ID":"<CAK8P3a2RGZFc3_XpgyfuxwYy-vOoYkkamxQzma8JKwLjCCJasQ@mail.gmail.com>","Subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","To":"Joe Perches <joe@perches.com>","Cc":"Mika Westerberg <mika.westerberg@linux.intel.com>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tLinus Walleij <linus.walleij@linaro.org>,\n\tDmitry Torokhov <dmitry.torokhov@gmail.com>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tWei Yongjun <weiyongjun1@huawei.com>, linux-gpio@vger.kernel.org,\n\tACPI Devel Maling List <linux-acpi@vger.kernel.org>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"linux-gpio-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-gpio.vger.kernel.org>","X-Mailing-List":"linux-gpio@vger.kernel.org"}},{"id":1764438,"web_url":"http://patchwork.ozlabs.org/comment/1764438/","msgid":"<1504741330.7546.6.camel@perches.com>","list_archive_url":null,"date":"2017-09-06T23:42:10","subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","submitter":{"id":771,"url":"http://patchwork.ozlabs.org/api/people/771/","name":"Joe Perches","email":"joe@perches.com"},"content":"On Wed, 2017-09-06 at 21:53 +0200, Arnd Bergmann wrote:\n> On Wed, Sep 6, 2017 at 5:52 PM, Joe Perches <joe@perches.com> wrote:\n> > On Wed, 2017-09-06 at 17:47 +0200, Arnd Bergmann wrote:\n> > > As suggested by Andy, this changes the format string to have a fixed length.\n> > > Since modifying the range check did not help, I also opened a bug against\n> > > gcc, see link below.\n> > \n> > The code has\n> > \n> >         int pin\n> > \n> > does changing pin to unsigned int matter?\n> \n> No difference, see also the gcc bugzilla report.\n\nPerhaps the bug report does not apply here as the\nfunction is casting a unsigned int to an int through\na pointer when the int could now be negative, the int\nis tested for < 256 and is then printed.\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-gpio\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-gpio-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.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=linux-gpio-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 3xng9N1kxXz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 09:42:16 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751907AbdIFXmO (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 6 Sep 2017 19:42:14 -0400","from smtprelay0245.hostedemail.com ([216.40.44.245]:50466 \"EHLO\n\tsmtprelay.hostedemail.com\" rhost-flags-OK-OK-OK-FAIL)\n\tby vger.kernel.org with ESMTP id S1751153AbdIFXmO (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Wed, 6 Sep 2017 19:42:14 -0400","from filter.hostedemail.com (clb03-v110.bra.tucows.net\n\t[216.40.38.60])\n\tby smtprelay08.hostedemail.com (Postfix) with ESMTP id 3B654182CED28; \n\tWed,  6 Sep 2017 23:42:13 +0000 (UTC)","from XPS-9350 (unknown [47.151.132.55])\n\t(Authenticated sender: joe@perches.com)\n\tby omf07.hostedemail.com (Postfix) with ESMTPA;\n\tWed,  6 Sep 2017 23:42:11 +0000 (UTC)"],"X-Session-Marker":"6A6F6540706572636865732E636F6D","X-Spam-Summary":"2, 0, 0, , d41d8cd98f00b204, joe@perches.com,\n\t:::::::::::::::::::,\n\tRULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:2902:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:4321:4605:5007:6119:7903:9707:10004:10400:10848:11232:11658:11914:12295:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21627:30012:30054:30060:30070:30090:30091,\n\t0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5,\n\tNetcheck:none, DomainCache:0, MSF:not bulk, SPF:, MSBL:0,\n\tDNSBL:none, Custom_rules:0:0:0, LFtime:1, LUA_SUMMARY:none","X-HE-Tag":"title50_303e3e830f961","X-Filterd-Recvd-Size":"1995","Message-ID":"<1504741330.7546.6.camel@perches.com>","Subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","From":"Joe Perches <joe@perches.com>","To":"Arnd Bergmann <arnd@arndb.de>","Cc":"Mika Westerberg <mika.westerberg@linux.intel.com>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tLinus Walleij <linus.walleij@linaro.org>,\n\tDmitry Torokhov <dmitry.torokhov@gmail.com>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tWei Yongjun <weiyongjun1@huawei.com>, linux-gpio@vger.kernel.org,\n\tACPI Devel Maling List <linux-acpi@vger.kernel.org>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>","Date":"Wed, 06 Sep 2017 16:42:10 -0700","In-Reply-To":"<CAK8P3a2RGZFc3_XpgyfuxwYy-vOoYkkamxQzma8JKwLjCCJasQ@mail.gmail.com>","References":"<20170906154756.2133726-1-arnd@arndb.de>\n\t<1504713173.7546.3.camel@perches.com>\n\t<CAK8P3a2RGZFc3_XpgyfuxwYy-vOoYkkamxQzma8JKwLjCCJasQ@mail.gmail.com>","Content-Type":"text/plain; charset=\"ISO-8859-1\"","X-Mailer":"Evolution 3.22.6-1ubuntu1 ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","Sender":"linux-gpio-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-gpio.vger.kernel.org>","X-Mailing-List":"linux-gpio@vger.kernel.org"}},{"id":1764537,"web_url":"http://patchwork.ozlabs.org/comment/1764537/","msgid":"<20170907065059.GD2477@lahna.fi.intel.com>","list_archive_url":null,"date":"2017-09-07T06:50:59","subject":"Re: [PATCH] gpio: acpi: work around false-positive -Wstring-overflow\n\twarning","submitter":{"id":14534,"url":"http://patchwork.ozlabs.org/api/people/14534/","name":"Mika Westerberg","email":"mika.westerberg@linux.intel.com"},"content":"On Wed, Sep 06, 2017 at 05:47:45PM +0200, Arnd Bergmann wrote:\n> gcc-7 notices that the pin_table is an array of 16-bit numbers,\n> but fails to take the following range check into account:\n> \n> drivers/gpio/gpiolib-acpi.c: In function 'acpi_gpiochip_request_interrupt':\n> drivers/gpio/gpiolib-acpi.c:206:24: warning: '%02X' directive writing between 2 and 4 bytes into a region of size 3 [-Wformat-overflow=]\n>    sprintf(ev_name, \"_%c%02X\",\n>                         ^~~~\n> drivers/gpio/gpiolib-acpi.c:206:20: note: directive argument in the range [0, 65535]\n>    sprintf(ev_name, \"_%c%02X\",\n>                     ^~~~~~~~~\n> drivers/gpio/gpiolib-acpi.c:206:3: note: 'sprintf' output between 5 and 7 bytes into a destination of size 5\n>    sprintf(ev_name, \"_%c%02X\",\n>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~\n>     agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',\n>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n>     pin);\n>     ~~~~\n> \n> As suggested by Andy, this changes the format string to have a fixed length.\n> Since modifying the range check did not help, I also opened a bug against\n> gcc, see link below.\n> \n> Fixes: 0d1c28a449c6 (\"gpiolib-acpi: Add ACPI5 event model support to gpio.\")\n> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>\n> Link: https://patchwork.kernel.org/patch/9840801/\n> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82123\n> Signed-off-by: Arnd Bergmann <arnd@arndb.de>\n\nAcked-by: Mika Westerberg <mika.westerberg@linux.intel.com>\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-gpio\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-gpio-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.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=linux-gpio-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 3xnrqy1ZxJz9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 16:57:50 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754112AbdIGG5g (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 7 Sep 2017 02:57:36 -0400","from mga01.intel.com ([192.55.52.88]:27253 \"EHLO mga01.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752021AbdIGG5f (ORCPT <rfc822;linux-gpio@vger.kernel.org>);\n\tThu, 7 Sep 2017 02:57:35 -0400","from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t06 Sep 2017 23:57:34 -0700","from lahna.fi.intel.com (HELO lahna) ([10.237.72.157])\n\tby FMSMGA003.fm.intel.com with SMTP; 06 Sep 2017 23:57:31 -0700","by lahna (sSMTP sendmail emulation);\n\tThu, 07 Sep 2017 09:50:59 +0300"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,357,1500966000\"; d=\"scan'208\";a=\"897931466\"","Date":"Thu, 7 Sep 2017 09:50:59 +0300","From":"Mika Westerberg <mika.westerberg@linux.intel.com>","To":"Arnd Bergmann <arnd@arndb.de>","Cc":"Andy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tLinus Walleij <linus.walleij@linaro.org>,\n\tDmitry Torokhov <dmitry.torokhov@gmail.com>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tWei Yongjun <weiyongjun1@huawei.com>,\n\tlinux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org","Subject":"Re: [PATCH] gpio: acpi: work around false-positive -Wstring-overflow\n\twarning","Message-ID":"<20170907065059.GD2477@lahna.fi.intel.com>","References":"<20170906154756.2133726-1-arnd@arndb.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906154756.2133726-1-arnd@arndb.de>","Organization":"Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo","User-Agent":"Mutt/1.8.3 (2017-05-23)","Sender":"linux-gpio-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-gpio.vger.kernel.org>","X-Mailing-List":"linux-gpio@vger.kernel.org"}},{"id":1766807,"web_url":"http://patchwork.ozlabs.org/comment/1766807/","msgid":"<CACRpkdYnA=gwo0B5zTMQQOtdVgWB3w4pha2wASCGMEnT9BihJg@mail.gmail.com>","list_archive_url":null,"date":"2017-09-12T09:26:08","subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","submitter":{"id":7055,"url":"http://patchwork.ozlabs.org/api/people/7055/","name":"Linus Walleij","email":"linus.walleij@linaro.org"},"content":"On Wed, Sep 6, 2017 at 5:47 PM, Arnd Bergmann <arnd@arndb.de> wrote:\n\n> gcc-7 notices that the pin_table is an array of 16-bit numbers,\n> but fails to take the following range check into account:\n>\n> drivers/gpio/gpiolib-acpi.c: In function 'acpi_gpiochip_request_interrupt':\n> drivers/gpio/gpiolib-acpi.c:206:24: warning: '%02X' directive writing between 2 and 4 bytes into a region of size 3 [-Wformat-overflow=]\n>    sprintf(ev_name, \"_%c%02X\",\n>                         ^~~~\n> drivers/gpio/gpiolib-acpi.c:206:20: note: directive argument in the range [0, 65535]\n>    sprintf(ev_name, \"_%c%02X\",\n>                     ^~~~~~~~~\n> drivers/gpio/gpiolib-acpi.c:206:3: note: 'sprintf' output between 5 and 7 bytes into a destination of size 5\n>    sprintf(ev_name, \"_%c%02X\",\n>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~\n>     agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',\n>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n>     pin);\n>     ~~~~\n>\n> As suggested by Andy, this changes the format string to have a fixed length.\n> Since modifying the range check did not help, I also opened a bug against\n> gcc, see link below.\n>\n> Fixes: 0d1c28a449c6 (\"gpiolib-acpi: Add ACPI5 event model support to gpio.\")\n> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>\n> Link: https://patchwork.kernel.org/patch/9840801/\n> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82123\n> Signed-off-by: Arnd Bergmann <arnd@arndb.de>\n\nPatch applied with Mika's ACK.\n\nYours,\nLinus Walleij\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-gpio\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-gpio-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.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=linux-gpio-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"NyvuNoGF\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xrztr4jjnz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 19:26:12 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751279AbdILJ0L (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tTue, 12 Sep 2017 05:26:11 -0400","from mail-it0-f50.google.com ([209.85.214.50]:37883 \"EHLO\n\tmail-it0-f50.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751251AbdILJ0K (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Tue, 12 Sep 2017 05:26:10 -0400","by mail-it0-f50.google.com with SMTP id o200so27002995itg.0\n\tfor <linux-gpio@vger.kernel.org>;\n\tTue, 12 Sep 2017 02:26:09 -0700 (PDT)","by 10.79.164.78 with HTTP; Tue, 12 Sep 2017 02:26:08 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=v3IBFyHHydxoupXDKJsmQpBWGLFaU+Yg8olVl9kKVUk=;\n\tb=NyvuNoGFwiH/erJ9ojPVXnokqbuE2g40QmRCPiT4Ak57xKuLwV/LfEXcvoKBVV7xtK\n\t96IVcxE/cNiwVz6osDSH1ZlqsJvywSRUhlMWhN6iCFIAL2LazkD0GLqRXd4oTOKAwvKi\n\thf6GdrUeoYTxIkCy+7D52n0emBMyRk2TEShTI=","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:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=v3IBFyHHydxoupXDKJsmQpBWGLFaU+Yg8olVl9kKVUk=;\n\tb=tbsM73FZ806lfMUDrFXSeRS+Sm5dhgZevJSrvRzTh8fz2Gm0IpwnrFysAOkO9wWN6G\n\t8AxE8E3wOpvhvkVEVbl64sWMeSax8A/bDSaH4RAz9sbfUDO6HzKQYsIQpucAS7rvao6t\n\tknZkU0IdDro/N431hvR+Vf+razN8suM4aSEw6MEndjjQ9zma+aLfoCg86DcxmFY3KB1+\n\tSTNFcVXtAP6kkX/s8npYAU1bX78wI1ez7+VZxaKOCdKgHRfVikt8bUW6Qx0+D2xYCijX\n\tWUsjeynbxzxKtNK06ngX7XlpQR4VQZA3dBodm22cw19aozJI3HLehAQuIUGGg7M+qW08\n\tzv7w==","X-Gm-Message-State":"AHPjjUg22QhD91XOB8ztTIxgqW8idr6wkTOmYEGzlre3Asdl65BQOxp3\n\t/qcHDekbVV0T2XHJ7M03mhWjyEom+ZW7Z976AXDIYQ==","X-Google-Smtp-Source":"AOwi7QCk8j7igjCAWg0IKxs0RDdEfkxbeCoBttbdpNOsRaBulWjVm7QoDuEORe6O2lCYnY2l6txT0xX/JahvaeOqDsU=","X-Received":"by 10.36.41.132 with SMTP id p126mr149377itp.84.1505208369334;\n\tTue, 12 Sep 2017 02:26:09 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170906154756.2133726-1-arnd@arndb.de>","References":"<20170906154756.2133726-1-arnd@arndb.de>","From":"Linus Walleij <linus.walleij@linaro.org>","Date":"Tue, 12 Sep 2017 11:26:08 +0200","Message-ID":"<CACRpkdYnA=gwo0B5zTMQQOtdVgWB3w4pha2wASCGMEnT9BihJg@mail.gmail.com>","Subject":"Re: [PATCH] gpio: acpi: work around false-positive\n\t-Wstring-overflow warning","To":"Arnd Bergmann <arnd@arndb.de>","Cc":"Mika Westerberg <mika.westerberg@linux.intel.com>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tDmitry Torokhov <dmitry.torokhov@gmail.com>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tWei Yongjun <weiyongjun1@huawei.com>,\n\t\"linux-gpio@vger.kernel.org\" <linux-gpio@vger.kernel.org>,\n\tACPI Devel Maling List <linux-acpi@vger.kernel.org>,\n\t\"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"linux-gpio-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-gpio.vger.kernel.org>","X-Mailing-List":"linux-gpio@vger.kernel.org"}}]