Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp142844rdb; Mon, 15 Jan 2024 15:43:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGe2jqhAqEsmBklIX/Y0rUQiS3zUjANbAd4OQCDU90ZRQTUgC4G6iz+n/E7522KiMt3nQ6X X-Received: by 2002:a17:902:e9d5:b0:1d5:8d34:1369 with SMTP id 21-20020a170902e9d500b001d58d341369mr7165509plk.135.1705362192956; Mon, 15 Jan 2024 15:43:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705362192; cv=none; d=google.com; s=arc-20160816; b=Dh4Y9TbRd1q1Z0sdar3sBwtj3TTuRny1uKKl1RER1iWW1tQt90mvOZdC276j+NQyT7 5STKEBzrn3m9lF49gW3H9xirQpePTp4H4TThzEs7PofOJOSqePq2TUfVZjpZ8x1pIDUA urHRWKzwGaaMySRGdgqTNYyLcewo0QLCccCmLEzVJy1cO6KvfZlnb9lE9CgUM/wCPw2j X7EMRT0rboaStnkODxs8ZYZ7ZW7fH32lhNlxvbVzTKlpXO3hBYwKaQVCvBCoZtCbUmOj v+E9qRi38Dgo1/7IWUA+2fMdfWfuIM6BkEmO10XzX+X48cCAizPwi3NyCOODwYrENg67 xTDg== 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=hOP/zbe1uDJgv7/l2L9vMGNtLZ90OPteyZYxZh0/mnc=; fh=1DPN4bbn3mWUF4fMW9wW7qeKjUZ5sBSu+RNuSLr4WBM=; b=d15lPH1AY4ePejLvg0pGzuOjAyeOxoWf4JvhnBSGCQrl5cLiVr+18fU2tG8ExsOR8e YxJv7GEN2IraWVibVFt3dVrecF3L/ONSzaBc4IBHCwoTQ5jzqkmMvE9RYKrLACdO5RLb CjR13sI7+uw0TlJNGfQmSNGGrY6irf6Jzvsu5hsRocE1l8Wf8c++Iu+ARctGypfobNoW blBxX7fQh9KLfaaV/hgdddr+KeKbpukPz2dnIwiWeOnQHVomxMwqsjO8IXiuopWFLT/K 6ReeinOWrtKerOyhpTK47cZ1UMAtzOp3z4AFZv8ee7V0Jxg92ZrGIsPYjdDn84HwG635 DsoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B3uCDLch; spf=pass (google.com: domain of linux-kernel+bounces-26583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b23-20020a170902b61700b001d4df274275si9891832pls.480.2024.01.15.15.43.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 15:43:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B3uCDLch; spf=pass (google.com: domain of linux-kernel+bounces-26583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26583-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 626B9B227EE for ; Mon, 15 Jan 2024 23:40:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A4261C6BB; Mon, 15 Jan 2024 23:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B3uCDLch" 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 BC3281B94F; Mon, 15 Jan 2024 23:28:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 420F8C433C7; Mon, 15 Jan 2024 23:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705361301; bh=y85cnKH5QAAhRgBFfPMsEGMGsxfCej+YC/AocRD+Lag=; h=From:To:Cc:Subject:Date:From; b=B3uCDLchDpdZ5Nl3KBdRgfu7hNunkdboVORoloXZujuIB33IDNVk/adGmgfSsRc1K iT/h9TDTdMAesqHCxefcJbbJCdxv2SoE8M99d0N9VOwnET7XaFR7Q3+bAwZUeBNcfF tWG2lz7UngF/hMgt06g1i6tQkRbvQLoyVQCqN9BIavYI6EgXlCcKhv+ucfB5GubKyx AUgD7cfGJgBCqQZyky/OQ5GPcaAkfTdf5PvPv2q9vQXF53TaEU4IPTHC0IbemVMKcv fKohPLwaeIhW84UYA4O/V4jBGfhjEax4vizBRpLfrnlsPRKecB6vOj7N7K4SM1UnZx 0V8ynB4kL8/BA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Antipov , Christian Brauner , Sasha Levin , zack.rusin@broadcom.com, mcgrof@kernel.org, pstanner@redhat.com, nick.alcock@oracle.com, code@siddh.me, ddiss@suse.de Subject: [PATCH AUTOSEL 5.10 01/10] watch_queue: fix kcalloc() arguments order Date: Mon, 15 Jan 2024 18:27:50 -0500 Message-ID: <20240115232818.210010-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.208 Content-Transfer-Encoding: 8bit From: Dmitry Antipov [ Upstream commit 1bfc466b13cf6652ba227c282c27a30ffede69a5 ] When compiling with gcc version 14.0.0 20231220 (experimental) and W=1, I've noticed the following warning: kernel/watch_queue.c: In function 'watch_queue_set_size': kernel/watch_queue.c:273:32: warning: 'kcalloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 273 | pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL); | ^~~~~~ Since 'n' and 'size' arguments of 'kcalloc()' are multiplied to calculate the final size, their actual order doesn't affect the result and so this is not a bug. But it's still worth to fix it. Signed-off-by: Dmitry Antipov Link: https://lore.kernel.org/r/20231221090139.12579-1-dmantipov@yandex.ru Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- kernel/watch_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c index 73717917d816..5f15a921a8d0 100644 --- a/kernel/watch_queue.c +++ b/kernel/watch_queue.c @@ -275,7 +275,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes) goto error; ret = -ENOMEM; - pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL); + pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); if (!pages) goto error; -- 2.43.0