Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp450556lqb; Thu, 14 Mar 2024 16:48:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzzp+S++SNhvRqf8tsFnMaRVkqYiJuM8fGeaPTSKXLrfv1YOGVtC8Np1rrmf564G+LsRGO7Up27KwWsFuYLB/tDrYcNaSPMAu7Pj5G4w== X-Google-Smtp-Source: AGHT+IETW0O63LHmUbvS9eIszMA+CMehH2KjGUzcUAv68ZQQwYepn5ZEApLcxU2+8/JdQdk5mPQr X-Received: by 2002:a05:6402:2b8a:b0:568:9996:7cb6 with SMTP id fj10-20020a0564022b8a00b0056899967cb6mr2349595edb.14.1710460120418; Thu, 14 Mar 2024 16:48:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710460120; cv=pass; d=google.com; s=arc-20160816; b=sHYlXehTzSN2CDZzL2vFB6CnK7AZgL3Z0aE53OtejmE4TbG9et5NJukqu1Pu5QL76u zgI0AzNDGB9/q3V+Xp70/3ZpJmDMckY1Xi5Kgcy1im5NNCoh9YOnUcrqV9lL93lm6R3t 7Tzv5OLnkUL5usSoH55Ju1iVisq91k/5aUyharuDmKLz0uBDMFQMv6O9ybHupupGt5iU 2cfjL+UzVH8KsQFrU+1ngOIBeYANciDHdgPhOhOxs877TvoEp0s1izOXCbDiXU/fmR6u Gk2fvaMuQAbGIhaKROWCC60codhYpbniGvDE6rkhi80qslhIgPGgwYhK+vVH+qF+tsmR lGdQ== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=U3or76o3aT4Xhtjv310n/J7MEM9cTcyFnmdoBKMN+sc=; fh=RmrcQ0JjY9OUW+PKE93nn4e+T4mNR8fw2luKnRdM+ik=; b=lYeaL1I6d127v9JqX8qyxDVvraBR7WiQdQPu0YM0S1t9qSoAN0npMiyDukiVNwEEyJ 3xavRRdL7Hp7tk43cA4H/2sC318bIHRJcgUrha1OsAEaLMKjVM70sFo3zPXUsA46u6BE PqbEJNiTMrStxzXinf5CEpldpRzo8UGd/tZCewU1PjxQLn9KOfYNR6V6x6jm27Wy1z/q /+PuqCeL8lZlv97PTQNaSTlStiUQ9XKue9pYqBAHG61dyCAYYS7oXSd7BYqUoR1VS3rW t5X1ASlxGgkPzC+wZjf7pYsy4LJg0Iz8M1MbYM6w7q44g1XRERkf6cPCeDp1uuKSUOhl ZTjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gcHAZhzR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-103922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id er6-20020a056402448600b005683afb9079si1193494edb.106.2024.03.14.16.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 16:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gcHAZhzR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-103922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103922-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 27ADD1F2145C for ; Thu, 14 Mar 2024 23:48:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE20112B95; Thu, 14 Mar 2024 23:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gcHAZhzR" 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 14680FC02; Thu, 14 Mar 2024 23:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710460108; cv=none; b=Bu5NOc+P/TCE7IFB9HsWZSTFv1kdkCrtHwdXBoH1JylSpIasgnHWw0id/pn62H4I6Tb/zg7bmKu6tnhubSAla/ljJzEgY4+KRs8kzPLMHki6ufCc0sSdQSUH/vQXdQwDzXiqMOck/ic7MciKbnxEDBMTEyJgG7wo8fhtFhScQNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710460108; c=relaxed/simple; bh=5hBfl7rp5xpyFDv/cfYVaSlK2zQRJq4wKIsO53dJ7tI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gABXUvJw3Q8NTbxwoWQXIRnlnXp3v8c+gzW79kR753PnAMKoMdb+vflz6bCMYN9qjzt23M8jII0vvawvyR5qm2OkErsO2Y1EB/4srLNrNrWZmKsO6gQp53X6kd37KTpJbh5Wmes9I0S7PssqsDIM9rmwujU9PATcF/5F9lt7znY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gcHAZhzR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E9FCC43390; Thu, 14 Mar 2024 23:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710460107; bh=5hBfl7rp5xpyFDv/cfYVaSlK2zQRJq4wKIsO53dJ7tI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gcHAZhzRO3WLjK06BBhvdYkEU55HOM07N7Z54T8yrDgl2qRZ7EWusm2wcqfR6KFzB ic7I8wiIBr1WHnPfTV/567CvFmIgKyjSOsbUY6zsc3ZiWFDuqMMbzMoF3yPN+NARLH epD+iK5mxncgoZp2i3QkykpUKjwy3SG89/FGcWsbgzqclw2c3bfF8PBnZpk0o05vz6 WMbJNJ2Wz3uN054THrlW4IJ4lN0ZEyIy9lcnWtfEYnjj+xNRRotxyMQ29LDb1LtBl7 nPfiZyHtbDubQntaJuHzceZtOrIanFP76q32VjZVI//QkkfN0WwW1roUz9Z27eSKrF pmVuribwbC27A== Date: Thu, 14 Mar 2024 16:48:26 -0700 From: Jakub Kicinski To: Nikita Kiryushin Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Paolo Abeni , Oleksij Rempel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH net] net: phy: fix phy_read_poll_timeout argument type in genphy_loopback Message-ID: <20240314164826.161bd398@kernel.org> In-Reply-To: <031a0fe6-79dc-464b-b8d9-946f75971378@ancud.ru> References: <031a0fe6-79dc-464b-b8d9-946f75971378@ancud.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 14 Mar 2024 14:15:37 +0300 Nikita Kiryushin wrote: > read_poll_timeout inside phy_read_poll_timeout can set val negative > in some cases (for example, __mdiobus_read inside phy_read can return > -EOPNOTSUPP). > > Supposedly, commit 4ec732951702 ("net: phylib: fix phy_read*_poll_timeout()") > should fix problems with wrong-signed vals, but I do not see how > as val is sent to phy_read as is and __val = phy_read (not val) > is checked for sign. > > Change val type for signed to allow better error handling as done in other > phy_read_poll_timeout callers. This will not fix any error handling > by itself, but allows, for example, to modify cond with appropriate > sign check or check resulting val separately. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 014068dcb5b1 ("net: phy: genphy_loopback: add link speed configuration") > Signed-off-by: Nikita Kiryushin Please use git send email, the patch is mangled. -- pw-bot: cr