From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796070084; b=jNykg3NhD+6YDBHFCqX9m1mTbDUpkzqq11kVR1T6i3C3xCbF1hNYsCpjMNwqBXov+j7S U0pJCQoHrhJEbMoFIqm8hJThRXnzjTUDrY3PMA1nE19Q3aCYRFXrbhK2rNSrlv+JaSGai 7Ao1usFFmDRkDwGYrudMXnPqUgAb/74Kf5xzvtroWoq6jdkemsqbvKrlMEws9Uj+1LAz5 ZJLqPwQvvmFJmIJ/pFKAynsRd6xFh5jSt96roVPDS/eCJcKz5KO67DU2lN5nlQNw6UV4M iDbKPfN7nmUwgxT1Bq6KDUPcXh6coqa3fJPpFfAHPMZvvbZ7wnKviqyLFKLD0YV9IHA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796070084; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted: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=AzotD6w/8YRk8EO8d+8pV7HLFkIKpUnnMkP2wXQkIxanD/E3ELtyv0/K5yWnV789JzbV XcUX+qbgXa+v7VQgDojzPMjOFLcA/exyymTN0rG1QH+19nW2+Qxr/Ug7rx/XCo1SWyS6Y vP5E2wfua/BhsfX96/T0E8zF9S28sYdbsaoKLl5sqMpUTj/RnHLQ0xUedPsvy9hrOr4a9 21H1f9Ysy5dkNy0ZQLjlFhdaLoMJOU56pfGuqtop9S7K4mhN8IANscWDV5rVp/luHlfpj Y321XWalUjIFIAmZbxa9lw7i/uHlINWDti/MLBVOtA3k7GNA4kDqWPcEhKPZxMwcqDQ== 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.47 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (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 62F6E606A31A for ; Mon, 30 Nov 2026 20:21:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 62F6E606A31A 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-f47.google.com with SMTP id a92af1059eb24-1b5786e099cso10779121c88.0 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=igvlZmB8QaRPBAvVxMqLoQpxzO5AhfcxBIDHtEvjwG/TVAkualt5foyQe9K0t53FjZ sDoxE4Qp8JI1VEcgbo7X3z+zXKc2902v0cmDnuFYPvooHyoeMYbJmswgz9GxPHwoC0j4 b6tQyqG8bijMNVdZ02PY+ICIof9wIHsVYCNEy/e6U2IMXViY77irOXrFNvrOYxWoCwTI w8GgQfZHJDsKQC4kwZRSztwv3cuPkcMLzXXezaWzLlcFSxCyvG7xkbH3fVSNSDVXLTRn Pf5nEH7oXDItToZ6CJRQOMAGVwMTHQYg8uVaiRgIjSglFAIFZWAVyfugoeX7NcHhU89O kefQ== X-Forwarded-Encrypted: i=1; AL+hErHWPDi4c+0V2oRamEWh4eO0YTFgmV7JrFkJhvjq2s88qOZU57IRa03IXb+Rx2OyOYfxwrsf1pTEEBuT+b8=@vger.kernel.org X-Gm-Message-State: APuU4Z/TdEuea6f+cZRFdNsYZEiVOyKlRb8hsyc+l1Pk8fhZzmAZgIZZ 5phrU712qdkfBJXOTin4ROkOKTXnGwZmnkjMMtusbU9d20Ku7PP87gUU X-Gm-Gg: AZFdTZeVLWZv7Hg+loXBidMDTPcRh/ydd1qA/4f+tM7OAYpiWPqITGNHZmdJqAEQdlO 3VvP1+gH+G3x5CI+gbmzmKv+GnMBCL7G+K0HJRA6vJAn7dph1KA4IlExG1vNIcroAtGiqJ+w4T8 9/VECxQiotFUo8RMDOchw9LyqsC0bSBlt6iPMkEq9mxNsqzBdWwk8KpKDLdUiMxyeBCauVCLWKW 9WrtLd0+a4fTib5W8yZBTfy4O+JsERyDGtia1u2b6bG9O3hg96ZBL7EVJucoAm9O02yPlwOAY0l NnGEEyVek+jIJ4XMAtY7tcI/9VRqGqdTapgZ09G8U2W/osKjVFxPs2jPtP/4GxwBBDcHaWqx7Ik bn3iy/wvkd7ICIN/64pJ0c+F0INWzL+RSdAtc5A5WyaWaYFhk4C8uiXfw0XogKXifERVAZL6aW3 miQjPI69GVmoI0gCZGqAp86U7ojiDeMtneu3QT6AU8aiIzYizyLIAyt7O2MU6R1KexXS9Gg4gjT 3BLojwLj/+4dOzu9HmFn8Bl3QqwMflGCaB6HWYz8lUfozN7VaPCFY7TYOwQxSTDjbrnzdI7tM1o zTArqFpwn+x0+wv7ho8N8xaiOTabXAEyJCXHE8S7i7u2t7kU/PHW0UovdHiq2XYE4vqQ 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-kernel@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