Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1559460rdd; Thu, 11 Jan 2024 02:57:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsfepE+L6ARE2mtF9ufuHuBHLB8jkkSFo7BXZbMaB4DDKOkE8FJgnQ0k6/BVu4ce9fP3Xr X-Received: by 2002:a17:902:db10:b0:1d4:bce3:8638 with SMTP id m16-20020a170902db1000b001d4bce38638mr956686plx.77.1704970631546; Thu, 11 Jan 2024 02:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704970631; cv=none; d=google.com; s=arc-20160816; b=Pexr+hh2TugWhgDreumxZoD6BE4Q7gubdefXbXmxYnl6OfY6P52orFwioNOYgYXONx R1YMqCLlxO260PUskDTSOYxAFnElou8VYr1YhnmkOiwCd1v3fOSMYrxWBKFqv3IKgOO9 ZydH1aA6+y6S9DJqaDdwR6MPBtFUvWa7orATlgore0VEOWFnGPfvT9sdKK5vT7CAkr0G A1s3s6sunDAGtZeVyK3zmpru0uI36+D3ddZitWCbER3eEdChBxAP3CPnbNfSXtKLg8yk +YWqswiYMpwggnHQc23ipncqcMKarMvQUxI9eDrXu48IUwFx7Icdldvnpjcz2YeHpXiW j95g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=jq+uHNfAdgj4VYwtCu/iicdtHSNHFVZ2tWMOkO/+mO0=; fh=425/InZ20Hji6SnV2CjVhfF0tmoG50JFDPv3kvqvqro=; b=N04Zn88PNrSk++3dnS+x8y9C+2lJQiKiqLN5e9qpkBy3dVWqnHkYxsTr5nU0Hm+pPl CvJoP6xBjMiaofCLbkR3EawKp3cYoa7/hL3amcEjwfGH7IJkw/HRGiOIxsQ3zv66bUGy ORAZD2tRTpUFdjD0LVszHPduc7WwNpkkMSBnL4byKoKwYOCwwwHUeg2IoWMsMghxVP7/ u30Oc5IdSDp7Z9KT6WHFY8kt9q2psEcMYmoLg89Bu+PF/2mQGWhFTlPO/9xKLqACM5fK LrroxugxvdoPSGj3ac5Vlp0yyVMss2cXK4zPL3UqnyoVAIBG94rVlCjXArV+JJcyv6Ah FBzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pJzifp7H; spf=pass (google.com: domain of linux-wireless+bounces-1706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bc4-20020a170902930400b001d58bf4c7a4si799100plb.522.2024.01.11.02.57.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 02:57:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pJzifp7H; spf=pass (google.com: domain of linux-wireless+bounces-1706-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1706-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 37475282AEC for ; Thu, 11 Jan 2024 10:57:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2612154B6; Thu, 11 Jan 2024 10:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pJzifp7H" X-Original-To: linux-wireless@vger.kernel.org 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 97873154A0 for ; Thu, 11 Jan 2024 10:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ABC2C433F1; Thu, 11 Jan 2024 10:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704970479; bh=YAn0gW7c9S02X1yQRKBnWhUNi7TdPFazJhFyTkhUOZg=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=pJzifp7HCNC7XfYHkeAVVINdNvWxHPUoEj7idL6i+Qfaca+/n0MxNAIDRkQyAMsRR 09JwFjDCM53kXeJcm9AEieB+zekQWSCcxKkrY7FYjsqgfz75p50eV2XP1bUT2BllFh EflGX7gN0XFUJFMLScrme+KHMPIZgc8uPQ7MNiStVemeyIoLcez8hAZulDQQuOQjKp TRNjAMz1v5NfzIkRb3nhvJ6llKEqMUmKctSJf3Jvi9CxpW7Hh74uXyMZUdLKcr7STT t9t112PW0Q5Zf4Hemc+afZXJBMMYlZvfLYJRyIgHwc9kwVP1DZKlYLmGqRImSK0IdL 6l7MlNTIZxK5A== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: wifi: p54: fix GCC format truncation warning with wiphy->fw_version From: Kalle Valo In-Reply-To: <20231219162516.898205-1-kvalo@kernel.org> References: <20231219162516.898205-1-kvalo@kernel.org> To: Kalle Valo Cc: linux-wireless@vger.kernel.org, chunkeey@googlemail.com User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170497047613.594140.11830619859424475231.kvalo@kernel.org> Date: Thu, 11 Jan 2024 10:54:38 +0000 (UTC) Kalle Valo wrote: > GCC 13.2 warns: > > drivers/net/wireless/intersil/p54/fwio.c:128:34: warning: '%s' directive output may be truncated writing up to 39 bytes into a region of size 32 [-Wformat-truncation=] > drivers/net/wireless/intersil/p54/fwio.c:128:33: note: directive argument in the range [0, 16777215] > drivers/net/wireless/intersil/p54/fwio.c:128:33: note: directive argument in the range [0, 255] > drivers/net/wireless/intersil/p54/fwio.c:127:17: note: 'snprintf' output between 7 and 52 bytes into a destination of size 32 > > The issue here is that wiphy->fw_version is 32 bytes and in theory the string > we try to place there can be 39 bytes. wiphy->fw_version is used for providing > the firmware version to user space via ethtool, so not really important. > fw_version in theory can be 24 bytes but in practise it's shorter, so even if > print only 19 bytes via ethtool there should not be any practical difference. > > I did consider removing fw_var from the string altogether or making the maximum > length for fw_version 19 bytes, but chose this approach as it was the least > intrusive. > > Compile tested only. > > Signed-off-by: Kalle Valo > Acked-by: Christian Lamparter # Tested with Dell 1450 USB Patch applied to wireless.git, thanks. 989cd9fd1ffe wifi: p54: fix GCC format truncation warning with wiphy->fw_version -- https://patchwork.kernel.org/project/linux-wireless/patch/20231219162516.898205-1-kvalo@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches