From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796070085; b=TiNn1Mfh9vaKiDezWUt+GDDSJ8tc+c7K92A2ZndCOXRQYewZXyAVPED17FZ+HK4jDAzm diAh70A9bk0tIl5bdtwNW5AMPFePFE7AqMaQs1uNpFpNv2SBJomNBIasEkQm5hz1/ouHP Yuu4hMT+tzJ31NxonqSYZ1dBhL4O+Vp5MhwTCQb20fCEaaITE5Xqt145n324cxUxE2tCI MiIwOcAun62eztnaW0u9rBNx2GtIFtt/l3wjya1LqIQ22AYJ6ZRy/a3SrVaTIveAvZd9V MA7cndviMXvKgFQJC9Srz/ldJdansHG0YXt6GUAv1/zFoHIASuw2RcUmhQ6tXwCQItw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796070085; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:Message-ID:From: To:Cc:Subject:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-Disposition; bh=yrHBUxNDpOkJc3U9/cz7/FH4HhRJHvwd60+x+9pw+kM=; b=pTa4HOHdA2srdlI0Xi2cQ4Ze9YWTTQrNMHfzDqXREhBD+pc6SCjHzYMOr8wZdq5QdinV 21oTv3bteLYmrEgr+VACtgB47JXT2R5Y2wNTe76CVycOCv6Uh+hbcNR0IBzb31eTM5rFK UfnhR6tpaPEXflAp5Md+1mGjHMVULIg14EIaAbQUd1JpVK9DTAaPCqCepnCI0JO80seaA R/+w1l6GzN+oC0WeBYGd+MNh+NHeWDojZ9vBbqThAo9tVB3L+6MfznkkUeq3YjEHmfIxo /M2FRCtAkI2BFLleraeQLd0U40Cw+3as78Q64RvADzqivSYiEtFro21U1YYY9LMs0qg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rbt1xaeF; arc=none smtp.remote-ip=74.125.82.50 Received: from mail-dl1-f50.google.com (mail-dl1-f50.google.com [74.125.82.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 649BB606A320 for ; Mon, 30 Nov 2026 20:21:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 649BB606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rbt1xaeF Received: by mail-dl1-f50.google.com with SMTP id a92af1059eb24-1b563e32936so6542202c88.1 for ; Mon, 30 Nov 2026 12:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796070083; x=1796674883; darn=vger.kernel.org; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=yrHBUxNDpOkJc3U9/cz7/FH4HhRJHvwd60+x+9pw+kM=; b=rbt1xaeFUDzoSEcxSutSXVxqqqxbteIP52+RszulLDO8PPF0d4vsSfkK4Ycbkpy0tD ky7zeRQZAWPX638FTXTB+j6BtduOzVwKEik8opojcH1/AG1QQ8fuTPCCowwkolmPCXMY djhwV8ncRO6TrdZ1CZDQK+nknS32dzQUU3Ih6fdMiJlmpMaaXeUjIrDAZlZr82B9Gq68 gOx/vRCmOE//IP0UD9+jHrr8/vUpTzzwJrOgCOcyBeC6l0YlVo0GMSrL9IyXTk4oxsin WTuEwSdbJNgLM1z8/LtzUEN1pgFMAvPmdnyNXmDLhc0dpej9fBuo+ZrSBm234gz20zdL lXAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796070083; x=1796674883; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=yrHBUxNDpOkJc3U9/cz7/FH4HhRJHvwd60+x+9pw+kM=; b=LD9sz0g0R6Z2Ig8DG1dMTomUorI4roqBKRzpe0PzgHTjoRznHCXxLL6ivu6CDiUVEF g3ABWTVU3qm/gxFdLy3lcFwe+JDb9NPltPdIoMjXzMFV8eUYgMSVKiCQbIMA6RsAz6ni P55ENOpmI4aYIHCF/bX7Iy443Gfkp3bUGtltXgxJDwTbug3iFkO0ILoTVRHTpDppRrO4 8Y1LOYj5IyBTeWN3DLhWDyDnkrF3nUdfW2yl/zrRm7VET5xQTwnV+4n1+6PVZEUQaGPH MDllbPG0VWGBG1gTiEVR5AAHpKPDsiZ3U4I7sGf7M8qV8XUtmKgdrgLA2xGUBMkvQh7J eVzw== X-Gm-Message-State: APuU4Z8QqJh58vOFLzfw1KGK23ITlYfdtOXR62rHiQgydTknpTeUGOSb 6nZffngwbo5qPXF5I4zJdg/jiTzStNtPHFs+iSSUNfyb1422txkAGmlb X-Gm-Gg: AZFdTZcCaygcVbpE+uxSpyfK9UpGJ9g/Vq5ReXGEPk7xMiLfwv/KwbNvu4rZqozZAy2 0yBwhEhChgH4m9aIomVFhXVt9WUwFQ9ITY+Kz9+VhMv21B0e9Koe6InTY03JEgQ3G5Q4JaH2ClV C8Df317d0hxMaVNOfcVS5gBQkND/dvODD57gghToLgG4W//hwlv0YUevzWdMN2p6ljAE5JhOkky KP5O91nFeh0No3AeGVf9yikM3x6/ZsIvPijQiWx3bDu/blsp5TqudIzhASJ/GwMFufwEDGoTjTP 9FZ7J2O8trtUkBh4u/Shl/weCeGOfU9L9UCsnlfIttI/rpNAaWec1MGxtvOA0J3ayrOrIEQ4FNI jZrBzc3wrqavtp5xjavvRwaWGvquFAfHMyUFp5t9bSewuqEhdRmYIbroNIpCZLh9SXm+M91nWQP bWN/4K3bjLObzTUBE0jpujsRX2FBxJ4mUYhuybG7VqjK4FMtZlnezye8H9HAacfao2X2T+oLtca FbzTz+1KYjt1eILxFJeTUFOPHOq8EFX/nQwX/f+iOW9/9Bed8qYd0uwuiFKvSwzpMxP4BB5OnCf ytwHfvaxmru8jXV0laVV1VLYPiMYFbLr1AdkqmyWsDytQ9b4hpJOJzArop2WwEECVywR X-Received: by 2002:a05:701a:cccd:20b0:1b5:3819:f8f with SMTP id a92af1059eb24-1b55692aa4emr33141019c88.36.1796070083296; Mon, 30 Nov 2026 12:21:23 -0800 (PST) Received: from localhost ([2a00:79e0:2ebe:8:9f42:1ffe:38c8:d6a]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5566c1142sm77727699c88.2.2026.11.30.12.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 12:21:22 -0800 (PST) Date: Mon, 30 Nov 2026 12:21:21 -0800 Message-ID: <1ca7055b40b6f0c6e71f2d2582c4c5ad@gmail.com> From: Dmitry Torokhov To: Aibing Chen Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, sashiko-bot Subject: Re: [PATCH] Input: ili210x - widen firmware address types to u32 In-Reply-To: <20261129090341.1179-1-chenaibing@cmss.chinamobile.com> References: <20261129090341.1179-1-chenaibing@cmss.chinamobile.com> X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Aibing, On Sun, Nov 29, 2026 at 05:03:41PM +0800, Aibing Chen wrote: > Widen the address types to u32 so that the full 3-byte address range > is usable and the upper byte in the write command reflects the actual > address. For the CRC field, write 0x00 for the upper byte directly: > CRC-CCITT always produces a 16-bit value, so the upper byte is > constant, which also silences the Smatch warning about shifting a > 16-bit value by 16. > > Suggested-by: sashiko-bot > Signed-off-by: Aibing Chen Please address the two issues Sashiko pointed out: widen ac_end and df_end to u32 in ili210x_firmware_update() as well (otherwise 0x10000 is still truncated back to 0 before reaching ili210x_do_firmware_update()), and add the Fixes tag: Fixes: c6ac8f0b4ca9 ("Input: ili210x - add ili251x firmware update support") Please also keep the Reported-by and Closes tags for the kernel test robot Smatch report from your earlier patch, and mark the respin as v2 so it is clear it supersedes the previous submission. ... > @@ -717,7 +717,7 @@ static int ili251x_firmware_write_to_ic(struct device *dev, const u8 *fwbuf, > u8 cmd_wr[10] = { > REG_WRITE_ENABLE, 0x5a, 0xa5, dataflash, > (end >> 16) & 0xff, (end >> 8) & 0xff, end & 0xff, > - (crc >> 16) & 0xff, (crc >> 8) & 0xff, crc & 0xff > + 0x00, (crc >> 8) & 0xff, crc & 0xff > }; Please use put_unaligned_be24() instead of open-coding the byte shifts: u8 cmd_wr[10] = { REG_WRITE_ENABLE, 0x5a, 0xa5, dataflash }; put_unaligned_be24(end, &cmd_wr[4]); put_unaligned_be24(crc, &cmd_wr[7]); Separately, as a follow-up cleanup patch, could you also update the firmware update and cached-state helpers to take "struct ili210x *priv" directly (starting from ili210x_firmware_update_store() and ili210x_i2c_probe()) instead of bouncing between dev, client, and priv and repeating to_i2c_client() / i2c_get_clientdata()? While at it, ili210x_firmware_update() and the four ili251x_firmware_update_*() helpers returning ssize_t can switch to int. (Keep ili210x_hardware_reset() taking reset_gpio since probe calls it before priv is allocated.) Thanks. -- Dmitry