From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 835F430E0ED for ; Sat, 29 Nov 2025 12:51:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764420692; cv=none; b=JdmySd61b6p/+81dfKKhPfx2NkCSUCfovYxTMlkp5TUotHzYnpKEtSWrA9ie17C5JORnDakfLhlu4ejHevmVlOZNHiJaTc8pDEOEANna7PJ7Dh5MOoF5m3HSCo5d+PppsMQmkaUFbigVWizUbyWYY/JoiybFPoba/6BcOkzchIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764420692; c=relaxed/simple; bh=A9txMopkvOC7mnz0cu1wJn+1qcEvsxBGhzeJftFB1Q4=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=sze/vLHaHJiuD71BmjADojAO9YzPzuFUXvMY7+mgC1QfeP1lK97AsHmSe+eZd3HAv5VkJBdVEt6S+tkcL3GSj2S5bZNzGgQTcIwnT/A937cSIW9knfJ6rHED6ZX5ZG+cQ5ixbHNOXDxlKX0uLbbqGpdTsp/6SMA/o/mJt5gFLY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=NtaM0myv; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NtaM0myv" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id AF3F9C10191; Sat, 29 Nov 2025 12:51:05 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id AD10160706; Sat, 29 Nov 2025 12:51:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AA3D5119106A0; Sat, 29 Nov 2025 13:51:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1764420688; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=eP+syvK4zuOrSrhpINnmmK/BF2Rpqc6dzW6cZoTHp7Q=; b=NtaM0myv2BC/PIPFgmb0JZRryi8XDjEJ6/fCh4QaI8LxU9Eck+Hn5PyG/rnbFUnjFWotqm fthjR752Zp5GqKLeHnbjmdaiT8jZvPfRocURWYOlN/3Ast9DQq8qQ2gePJMzKUwASTAhCn TpdU0EmzrnBciWrqOQwoh/Xin9WBVrJsDCYsGqbTe5EAit6Kxh4o+CF6lzrx/rGNZaVkPa KkL4kiBrkaHuFKBPTTu2PTo57eQ3dsjbiECD78k4FW1JgljkbWAPiPYqxaEssqwG5jPSzE 7Wim0tvuiIDhnArvJbijMFHUofPmM45tbRhBiK/st2Q78czAd2Nmd9YDTn8nTQ== From: Miquel Raynal To: Ivan Stepchenko Cc: Richard Weinberger , Vignesh Raghavendra , David Woodhouse , Jared Hulbert , Alexey Korolev , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.com In-Reply-To: <20251121115446.11421-1-sid@itb.spb.ru> References: <20251121115446.11421-1-sid@itb.spb.ru> Subject: Re: [PATCH] mtd: lpddr_cmds: fix signed shifts in lpddr_cmds Message-Id: <176442068453.77093.14391627489442582650.b4-ty@bootlin.com> Date: Sat, 29 Nov 2025 13:51:24 +0100 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="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 On Fri, 21 Nov 2025 14:54:46 +0300, Ivan Stepchenko wrote: > There are several places where a value of type 'int' is shifted by > lpddr->chipshift. lpddr->chipshift is derived from QINFO geometry and > might reach 31 when QINFO reports a 2 GiB size - the maximum supported by > LPDDR(1) compliant chips. This may cause unexpected sign-extensions when > casting the integer value to the type of 'unsigned long'. > > Use '1UL << lpddr->chipshift' and cast 'j' to unsigned long before > shifting so the computation is performed at the destination width. > > [...] Applied to mtd/next, thanks! [1/1] mtd: lpddr_cmds: fix signed shifts in lpddr_cmds commit: c909fec69f84b39e63876c69b9df2c178c6b76ba Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then). Kind regards, Miquèl