From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 971ED2E9733 for ; Fri, 6 Mar 2026 13:02:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772802174; cv=none; b=rapUaVsY6Z8Hfo75yd3VNJ2auRC6COSfoyWdfAUgJyJ6+XJ3HGx0bawUT7QitYw3zxFpSibmLPSd24ALmkYVpYDQII1aTTIJuObSPO6xLO+tT5+b/ym0m2M9yuMxInQFWJHtq1JVgV7v3wsI4bpESNknnbm3GYhsXCEDikFOlH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772802174; c=relaxed/simple; bh=iVZ5wZb1aswb1Zi+n2j3lS0Ym4mLi0D4f00SVw5e36U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jXJ2XDdfpDCnKyyFS4LhrdBtR1mMzko387aJKv40kwgglFljMyGZN084kzqWU1uKR9W2qy2c61p574tNadO0GEc+lbGJBCBZaCzrIAHZunyxLdLwM3R+bdqYJaDFHJE5rJpo4I5yLAFg1xzNkpZ4hQHSS9n1+gcgxr3ju7dUPfQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=vYR02sgn; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vYR02sgn" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-439ce3605ecso1385370f8f.0 for ; Fri, 06 Mar 2026 05:02:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772802172; x=1773406972; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gct6C4Eht5wyc/ZmOWSkz/guh8IEwIRge1zzV0cuCzE=; b=vYR02sgnbspribaroZ/a4wAhiMWceqNuvTE9NZoiDCy8hM9LnBjtkwk0q65YXgt1k8 hLwE4PPxbfzA4Nk+povcEMFcfc4up8VZwOJq+V/H26zO1rVWKFQwRe7gh8Hx4iWyfdpw RQc1hVxrkOj9L7Dm8gjMqvpifnFO0481hDkF3A0y9huhuw2svAW8Z4/WzIWZYzuWEItC 7bzKt3Fw/I0RV1QHvINruQ0FuR2Xb3WGpnSfu7n4cUk3YOjGXfs264qokuz0mlHgXyZp eM2feOtagIOzUamOzPx0MSUgVQc9Mwu6RMB1MyyKLOPkxHNsDprqusT5ss02AK3ZPedD RzEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772802172; x=1773406972; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gct6C4Eht5wyc/ZmOWSkz/guh8IEwIRge1zzV0cuCzE=; b=VA+V7pcmgfoyxqUvHMY+lu/0I+g6k6h9tF4a7fBl12rFr7nn5P4LxxnQDu4BQI3clE enWmdrP/I1/M9bGSYDOT7/M/4qhsxejKmOoWIN1cDgPQovTnlaWHTJzxstffkVCNYDdf xgfThEf/wdw36yvYcq3cD/TqLocoq/ZOEbOmIZXI/qc7QrdrQx1TaxbR6Xfktc3hbHSw TMQVFRnAZubWbguAhiiUag/AZmwmTtCV9lnZwHSIrX/lGE+E7vP+9NZq6PAKnxokKc9D iJDfZpkT+9X64N8MXN/RaMAyQJhUcphjlG+QmtQ8w1esgt67OTW5uX//oZUiYgIZG6jw J1dw== X-Forwarded-Encrypted: i=1; AJvYcCVMwOu1GG8w+xQQbDJQCJBGNrB7HvpO6KjZu7j24OccW2J2dvWGhT/QhPhq85XKW1tGUr4Ar26F6ZxiKNs=@vger.kernel.org X-Gm-Message-State: AOJu0YxpL3rp093JszK2wjia0z2oElwgef0GZ18m8Y6isNIdW/gSI+jl p2f+fquRi010g0p9TJTOj2QfvpAYFeYXnDACDOdZT+m4qY50LFfrrwLgQdCnTaTNg2E= X-Gm-Gg: ATEYQzxIO+7TDBNRdStKLSUAbv5u8HMMh9u/aS/bT19Sp3A2Ei9FD7skDf8ZFrJFXcj YToQTwYCwrADI4Oz/7xZQrwVYmiZxPYhAsflD/LVRaYqmSa9o+vf2U4I9bbuMk1/SEt5ufFtw4Y La3X/lqAmaDC4loxdNi0KCSkLD0T254AJDKWlI2V9fkCVBhL/f6EPoW63p0AXpUEFO6rjw6u6SB t8u+fWJ+kEOrWIyZE8Bqm+8cU/emROh2I8LI8fHtQ05DAhd9T1Mu5bwDgJRp3Z/4O+mxVE3SI5d 8/OkmfSOUaUY4O3XHRyCnjG4U+KfeuLniJCqf8pmxzNxxdu3mvtrzmY1k66RodxqUyemMCJUu2T yq2n6VBXt9fOxdG6zbSZx+Ddf9P8Bj/5dxFqg/R6JV857WhUP3dB2jPa+tvXJSaFsrrvRm/kQYJ Xy93irzzkW2jREilLCE2n9iXXcWDrCK1x+kmX6LH8= X-Received: by 2002:a5d:64e7:0:b0:439:af81:1b21 with SMTP id ffacd0b85a97d-439da118cbamr3302588f8f.0.1772802171875; Fri, 06 Mar 2026 05:02:51 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dae2b9d8sm3776403f8f.21.2026.03.06.05.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 05:02:51 -0800 (PST) Date: Fri, 6 Mar 2026 16:02:48 +0300 From: Dan Carpenter To: Richard Lyu Cc: Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: staging: ipu3: img-mmu: fix sign-to-unsigned conversion Message-ID: References: <20260306104352.629177-1-richard.lyu@suse.com> 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-Disposition: inline In-Reply-To: <20260306104352.629177-1-richard.lyu@suse.com> On Fri, Mar 06, 2026 at 06:43:59PM +0800, Richard Lyu wrote: > imgu_mmu_unmap() returns size_t (unsigned), representing the number of > bytes successfully unmapped. However, when the alignment check fails, > it currently returns -EINVAL. > > On 64-bit systems, this negative error code is implicitly converted > to a very large unsigned value (18446744073709551594), That happens on a 32bit also, although of course, the number would be smaller. > incorrectly > indicating that memory was unmapped and potentially breaking the > caller's logic. > All the callers ignore the return value so it doesn't actually affect anything. The commit message needs to say this. > Return 0 when the alignment check fails to correctly indicate that > no bytes were unmapped while resolving the following > -Wsign-conversion warning: > > drivers/staging/media/ipu3/ipu3-mmu.c:393:24: warning: unsigned > conversion from 'int' to 'size_t' {aka 'long unsigned int'} changes > value from '-22' to '18446744073709551594' [-Wsign-conversion] > 393 | return -EINVAL; > > Signed-off-by: Richard Lyu Please add a Fixes tag. Otherwise, the fix looks okay to me. regards, dan carpenter