Message ID | 20240111163949.1976778-1-lee@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-23880-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1573272dyi; Thu, 11 Jan 2024 08:41:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZZbDbyuKYWTii4xI0m94+S1L2jE6r5lenzQgUwfXCk5NdMVdIeT1emu8SJjjapP5qNE9b X-Received: by 2002:a05:6808:f91:b0:3bd:5957:f1bc with SMTP id o17-20020a0568080f9100b003bd5957f1bcmr625948oiw.2.1704991277308; Thu, 11 Jan 2024 08:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704991277; cv=none; d=google.com; s=arc-20160816; b=X59aIZ4Kqbi/ymGE4zvExnot80bDS7avY+M6WsaEAFWIKsqK/d9Pb5sn6lrvwozbxN q72lJOd2RCH9zKodroWZH72DieVDW629s3R69awaaTbqbXKxU4juqG0mNENBrL573Jq0 7uqi81NPrXA3Zb3Yt+IxetZ66P107FwetHHvd+8oKUFIS4/gNF06oyP+F8WrDzvPAUi3 NLDeRhU9r3sWEWs21hSxh1FSyGQN3UA7HPwv0mWYQ04ej89x4sD0CEhCkPSyZS7uniRq gURhQ1DodmdAcHJggb1MFfteb76XPDzMKVUICOAf7UFOmBO+67tFSU24tdbFmNEWumEw dH8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=707hjnYLr3Vx1ct/Rjg8EEW9VAMa2gjb6J+FYYoY7LU=; fh=vR2Ax6G3U8MVux01d+we4aSijPPmYFDUEO71mDE/xvI=; b=mnXtdtI1mS77hQPvXw6oQbsJyhCHSxlpxRwAVSvPqeo1NC6UC0LCDCil0lDqp0Ub0j 0Bl7CO/HxyO0wix5lX7VxFNZ9mGC+Ryxw4aqmEgUxg7Ms8TWIJIing+RIfEwSlaflr9N wFWsxNtD8UT9tfTVjHYrp+dhJmfKNYYtLTpEqrHyNIJWDMfff/7aKJ2X92WMNII0zDqp FSDXRLcdnRcWHSS8S63W3RphJ6x3/owhwpt/a9WQGJywmqt1y0SaKqW3APjph1iGuPfV 3eLbQ13ygC/qUCxDiBXh+WZfqAsA9JixY+xnIYzc6OaCUTdJpp9c+XuVzGxuSfJTCkt4 v5Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nisoBO3t; spf=pass (google.com: domain of linux-kernel+bounces-23880-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23880-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d6-20020a0ce446000000b0068060842311si1084890qvm.371.2024.01.11.08.41.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 08:41:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23880-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nisoBO3t; spf=pass (google.com: domain of linux-kernel+bounces-23880-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23880-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 93FFD1C26864 for <ouuuleilei@gmail.com>; Thu, 11 Jan 2024 16:40:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44F3D51001; Thu, 11 Jan 2024 16:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nisoBO3t" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E20E50250; Thu, 11 Jan 2024 16:40:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF60AC433F1; Thu, 11 Jan 2024 16:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704991201; bh=+q75K7vH+apl/4khPV5F4/P02Rn9eXRp5swe8VqdbCE=; h=From:To:Cc:Subject:Date:From; b=nisoBO3t1G8MJenBLBJYJ2eSEgRZVUq3hy1k9wblBpjYRq49J2U8Trc7cenwMFKoD 3fxzoBofSwVs7ITy/TjLNPaea/32K4rN2BCcjh85+OVBm1xHpWSmOz/eQ9LQ6CUus4 EBOU7aQPA6giO+jqE6Lb+/WQttoBbo6D7kwnqbFhINYaw/arh7ixFbzzIGoSHdv7WB hfAP4bG8eWc9fZNHm0AkX/T8DEZS/lykAIFzleSMKMfuppPwknv/MVdFV1rIawBJIE 6WR1U3s4xbbCRn3a2PAgyk766sJ0TWo6zc2y+SAO0xguzUZfboIJkFIy84zApH1D6w JPIcRA+euir/Q== From: Lee Jones <lee@kernel.org> To: lee@kernel.org Cc: linux-kernel@vger.kernel.org, Tony Lindgren <tony@atomide.com>, Keshava Munegowda <keshava_mgowda@ti.com>, Roger Quadros <rogerq@ti.com>, linux-omap@vger.kernel.org Subject: [PATCH 1/1] mfd: omap-usb-host: Increase size of buffer to include all possible values Date: Thu, 11 Jan 2024 16:39:49 +0000 Message-ID: <20240111163949.1976778-1-lee@kernel.org> X-Mailer: git-send-email 2.43.0.275.g3460e3d667-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787812933455749583 X-GMAIL-MSGID: 1787812933455749583 |
Series |
[1/1] mfd: omap-usb-host: Increase size of buffer to include all possible values
|
|
Commit Message
Lee Jones
Jan. 11, 2024, 4:39 p.m. UTC
Avoid these nasty W=1 errors:
drivers/mfd/omap-usb-host.c: In function ‘usbhs_omap_probe’:
drivers/mfd/omap-usb-host.c:706:54: error: ‘_clk’ directive output may be truncated writing 4 bytes into a region of size between 1 and 11 [-Werror=format-truncation=]
drivers/mfd/omap-usb-host.c:705:17: note: ‘snprintf’ output between 24 and 34 bytes into a destination of size 30
drivers/mfd/omap-usb-host.c:721:56: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
drivers/mfd/omap-usb-host.c:721:33: note: directive argument in the range [-2147483640, 2147483647]
drivers/mfd/omap-usb-host.c:720:17: note: ‘snprintf’ output between 28 and 38 bytes into a destination of size 30
drivers/mfd/omap-usb-host.c:731:55: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 9 [-Werror=format-truncation=]
drivers/mfd/omap-usb-host.c:731:33: note: directive argument in the range [-2147483640, 2147483647]
drivers/mfd/omap-usb-host.c:730:17: note: ‘snprintf’ output between 27 and 37 bytes into a destination of size 30
Cc: Tony Lindgren <tony@atomide.com>
Cc: Keshava Munegowda <keshava_mgowda@ti.com>
Cc: Roger Quadros <rogerq@ti.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/omap-usb-host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 11/01/2024 18:39, Lee Jones wrote: > Avoid these nasty W=1 errors: > > drivers/mfd/omap-usb-host.c: In function ‘usbhs_omap_probe’: > drivers/mfd/omap-usb-host.c:706:54: error: ‘_clk’ directive output may be truncated writing 4 bytes into a region of size between 1 and 11 [-Werror=format-truncation=] > drivers/mfd/omap-usb-host.c:705:17: note: ‘snprintf’ output between 24 and 34 bytes into a destination of size 30 > drivers/mfd/omap-usb-host.c:721:56: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=] > drivers/mfd/omap-usb-host.c:721:33: note: directive argument in the range [-2147483640, 2147483647] > drivers/mfd/omap-usb-host.c:720:17: note: ‘snprintf’ output between 28 and 38 bytes into a destination of size 30 > drivers/mfd/omap-usb-host.c:731:55: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 9 [-Werror=format-truncation=] > drivers/mfd/omap-usb-host.c:731:33: note: directive argument in the range [-2147483640, 2147483647] > drivers/mfd/omap-usb-host.c:730:17: note: ‘snprintf’ output between 27 and 37 bytes into a destination of size 30 > > Cc: Tony Lindgren <tony@atomide.com> > Cc: Keshava Munegowda <keshava_mgowda@ti.com> > Cc: Roger Quadros <rogerq@ti.com> > Cc: linux-omap@vger.kernel.org > Signed-off-by: Lee Jones <lee@kernel.org> Reviewed-by: Roger Quadros <rogerq@kernel.org>
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index ebc62033db169..949feb03d4f8d 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -699,7 +699,7 @@ static int usbhs_omap_probe(struct platform_device *pdev) } for (i = 0; i < omap->nports; i++) { - char clkname[30]; + char clkname[40]; /* clock names are indexed from 1*/ snprintf(clkname, sizeof(clkname),