From patchwork Wed Sep 26 13:20:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 147598 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp717289lji; Wed, 26 Sep 2018 06:20:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV620nMZyg1AiwcTbznxETqSVmucyC+wkuWAro8QOK2wuhWMCLTVYiA7ecl8M09tD0LHukUMQ X-Received: by 2002:a63:e318:: with SMTP id f24-v6mr5679188pgh.175.1537968040963; Wed, 26 Sep 2018 06:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537968040; cv=none; d=google.com; s=arc-20160816; b=0aakHUAd6KMfd3VRsvBrqbNoH/MoSdVPcsPfjw+Lp1UVjf6cEvCN62pPY11a3uUohL hYmU2nmwvhsOgprNB7AqS0Vdw0/PzTxdsJToHQ3bg4tYi1bmZax2cbtlnxp8CvbFcFg8 r0jIDz50HV0UduvM/QWvmbpQ0Z8aT+M18zxrf4RyYmGGvnWByanTFC6RwC23p6lfUU6V VcbkWtoYn0z9yErSuTiIXxtJdovngQy9fnPALoFloEmSVC+OzCrHHoLCc1zYPmmtuekp icMd5qx2WBqyLKPyRsfKAZHqi648e7ZOXudiqfr4uo+fSBOZLb1rw36vOUSCa0jgkc8t GQ6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Z9x/ovcYDiovrI0x06Oz+CaSBGbLZgtGGEK6WSubfFk=; b=JVgXUxtuOzI1tY9MI6SatDL8aypw8bhOPy1hrsmSr+MQdPxBIKZqsTQIxpUs3FWbvz kFwzVzNgqHIgSG/9UMQjYAkYz/b04qRddDfAlIUve9UIlFAmuwvlLN8ixT/ZB170qSh+ TsnE9kkeE7QPVk3+UliESjtQOnGJHHkJpGtD3xTYJNN2Lwcz2qd1lIoF21gbo6mZIm96 y3nwh5pBIXcP2KCjzJwrjiMWbqfWUW8VHkwFCteuklYxuVyVZmij8ofCfdjj02FoQGzJ 47Zomlw6T3AL8P3Hr6YvTzoycP4JzMyH146TbZmCeUK0ZXDd2ASK4LxZwJZ/h6jB4izD ZG4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t90-v6si102365pfi.221.2018.09.26.06.20.40; Wed, 26 Sep 2018 06:20:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728587AbeIZTdd (ORCPT + 32 others); Wed, 26 Sep 2018 15:33:33 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:55235 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbeIZTdd (ORCPT ); Wed, 26 Sep 2018 15:33:33 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1N6t3Z-1fhDTK30P9-018NiY; Wed, 26 Sep 2018 15:20:25 +0200 From: Arnd Bergmann To: Andrew Lunn , Florian Fainelli , "David S. Miller" Cc: Arnd Bergmann , Quentin Schulz , Alexandre Belloni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] phy: mscc: fix printf format Date: Wed, 26 Sep 2018 15:20:11 +0200 Message-Id: <20180926132021.2933754-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:behdl5ImikeaUmM9kv+B3TQeYIgg1qSeX2uRr7hnq3nMzMyN0Ux nqPWyRSOcqXdnFqLZV4NUfkpDx/NkdGeVdEf43R6uDhamWu2TUmS/6S6e9SIDsp6ODHyG8b q6+0ZynYNA2T5k9aaJ665IkTaDWvir180cx0XJki6bJ4vWocikQfmUdu8+fkngPOSnDK+Ue QOsvA7WQDooILzOmcyQIg== X-UI-Out-Filterresults: notjunk:1; V01:K0:13x7nZJE5wk=:1BeVTDfjafCMgsvY1Pm1ca SLV40bQd07cC4UJvhcrcopXjZRnTWr2/is1ZmZL42xf6lV1BGJJITGnQgB83zVMAIqcuCI56x KwznwRE86lU23Yqyc2iDXWuT6/4JmZksiJ7+pRUEnZgd2LlTc1ZO5FRsbr2eaDb3rtPAyxY2h y2zLWYvXWsXZW1ya+OplPuUcDX6Vv/0mbb/Vnd448omHn64AZzaptxhQ3OT+2xDu3kEFQ5urI JwEH+Ku3PS8M72xNmWGrq5XfP+fCR93pBjgmVZsT6HSmuZmwhusFBP8w7MSrV0fPAYt29tFpG cn6bVbm8obbl4GifgPWvsJmoaZzmudYBD7d2W4pSew9lr7nhsy7+wo9tGApbojiuDw0DPmr0a 11V8ORINl2rGJ2BdTd5nmReaKpU8rIbXEBMpZGm7n5acwNgW04HdpFvwBT2peqlOyN3FQLgTh YkgQPHu3ZuqEBMGRbD8H+bXDGba2Lkht/sNdnq4rN/WoLQ54Ht9BFDKim0UqJB0NZt4cRTNGs uBY7Y7fu2myKf3Pk0aJ575O0kNbYTyHOZlhU9jo7PgrtopX9Vdi9BqwxK2UkSCyfp/Y4SDIz2 u/Sv1878LOnm/YJTdNfqvsiZjlf/pYOpvV+9M1uNRyzcF1tpBxSDAj24fIWW+9q29wfOAQjGk 8MM2+6lLTOC97cFpowhHbtfhyzGpBifqUBnbHxLqDh+NIEvHzV1Rs3jdLywkppFWzdCk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc points out that the length of the temporary buffer may not be sufficient for large numbers of leds: drivers/net/phy/mscc.c: In function 'vsc85xx_probe': drivers/net/phy/mscc.c:460:45: error: '-mode' directive writing 5 bytes into a region of size between 0 and 9 [-Werror=format-overflow=] ret = sprintf(led_dt_prop, "vsc8531,led-%d-mode", i); ^~~~~ drivers/net/phy/mscc.c:460:9: note: 'sprintf' output between 19 and 28 bytes into a destination of size 22 ret = sprintf(led_dt_prop, "vsc8531,led-%d-mode", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ While we can make a reasonable assumption that the number of LEDs is small, the cost of making the buffer a little bigger is insignificant as well. Fixes: 11bfdabb7ff5 ("net: phy: mscc: factorize code for LEDs mode") Signed-off-by: Arnd Bergmann --- drivers/net/phy/mscc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.18.0 Reviewed-by: Alexandre Belloni diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c index 2d9676d78d3f..7d0384e26c99 100644 --- a/drivers/net/phy/mscc.c +++ b/drivers/net/phy/mscc.c @@ -453,7 +453,7 @@ static int vsc85xx_dt_led_modes_get(struct phy_device *phydev, u32 *default_mode) { struct vsc8531_private *priv = phydev->priv; - char led_dt_prop[19]; + char led_dt_prop[28]; int i, ret; for (i = 0; i < priv->nleds; i++) {