From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from chaosmail.tech (chaosmail.tech [77.81.229.115]) (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 221821A682E; Wed, 5 Aug 2026 16:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=77.81.229.115 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785948877; cv=none; b=gpQGPInvBNhXxiDnP5Sz/TTmI60aDxKT2wkEBX74CFlZWo0GxkAYwFaFiHBBXswi/Ui4Ino1iYtUgx1odFEryGKZjYZ7puvBAFj28Rop6vNV/bYlIcaHNijNiuVTtPQ555JFCLH63cg7T87eWsEIgzrqI0l7ZWzLVhc2tyq8yv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785948877; c=relaxed/simple; bh=tMJCv+4NABLQQGWv1Q4HaIAxmPpUFXWtHV/qO+8cing=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=UJ8Pz/7hv4diH+z2B1TQgleQD+OvGSgLRBg11JhDSuM68DSE4cJPpmqV/z4mkWYYSk4Uy3aRJa61oS+4WWv0XCVaB9gx2azEo2CVz51vlSZdy19oRi9bqzNffWx6/cnHP0KhcBh+TM5014qBnnvTygTJ+PFHcMFb6mnnoW1PYxE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=chaosmail.tech; spf=pass smtp.mailfrom=chaosmail.tech; dkim=pass (1024-bit key) header.d=chaosmail.tech header.i=@chaosmail.tech header.b=Q06ks7hU; arc=none smtp.client-ip=77.81.229.115 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=chaosmail.tech Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chaosmail.tech Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chaosmail.tech header.i=@chaosmail.tech header.b="Q06ks7hU" Received: by chaosmail.tech (Postfix) id 165641C8156; Wed, 05 Aug 2026 16:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chaosmail.tech; s=mail; t=1785948872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i4wdnIB7yu8IgdNvMRTaaDTfvRZ6N+3RnRfrYjaJiDE=; b=Q06ks7hUmJV4IInkKO9zbb+/nkToSLWu+DxBFOgN80f92c/retducvabO14uvMIEx9m2K7 2d7PwpZfIpvYefG/CBMsceKQvajBIf852sTmF+uNgzByujZhJk+OFKF8I+5YYlB9YFCb67 W/sFtyVGlC82drTh25tjfzyQxVNJGQk= Content-Type: text/plain; charset=us-ascii Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v4 4/6] spmi: apple: Implement remaining commands From: Sasha Finkelstein In-Reply-To: <20260805121956.GD832571@robin.jannau.net> Date: Wed, 5 Aug 2026 18:54:21 +0200 Cc: Sven Peter , Neal Gompa , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Alba Mendez Content-Transfer-Encoding: 7bit Message-Id: <735B8A2E-7E9B-40EC-9BAD-FE14232AAE6B@chaosmail.tech> References: <20260805-t603x-spmi-v4-0-c15a12d9a7d1@chaosmail.tech> <20260805-t603x-spmi-v4-4-c15a12d9a7d1@chaosmail.tech> <20260805121956.GD832571@robin.jannau.net> To: Janne Grunau On Aug 5, 2026, at 14:19, Janne Grunau wrote: >> >> -static int spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid, >> - u16 saddr, u8 *buf, size_t len) >> +static int spmi_raw_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid, >> + u16 param, const u8 *buf, size_t len, u8 *ibuf, size_t ilen) > > Instead of two sets of not very distinctive variable names ("buf"/"len", > "ibuf"/ilen") please use just buf/len and a boolean to indicate whether > the command is a read or write if you insists of routing all commands > through a single function. This can be simply added as first condition > in the "while" iterating over the write/read buffers. Tried it, ended up not working, as the buffers differ in constness