From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 6550D2D879E for ; Sat, 25 Jul 2026 15:09:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784992184; cv=none; b=ma2rKMid/1SpdAzzcliNaQ/JYDj+YeTtqBfVgZC8oibdb5yX3xTxUohva8tERqpE0aZMm0sQjmp9eTu9sajmRbLgqu++lqWF2hdOLvqvcHLYizkhPGBhFLg+cOcPNcvEMsxu8+6zGw6F2WFyDIaJTbnH3lNG3cF1R/FeQUJHTLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784992184; c=relaxed/simple; bh=dJAWqF/go2E982qK42RHOSYXJ02QIi7tjanV6+8seNU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bwESbJNQXqLQpUdnPY8QrTKhr1/i92FAFpHJdbOKYF0wy5e5qQP76guxCb7Pl1OXs7EZ/nrWLJQNxCJg77BmQYhm3N0nS+Yodko1L5GESMBbpuCbrotyC87Es6psFDY0XiTkSX2Rlqo0CEd4UhqevImX56mIvQwOCZefz3iK6vw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=md472HOs; arc=none smtp.client-ip=209.85.216.46 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.b="md472HOs" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-38a0c7e841fso1670450a91.2 for ; Sat, 25 Jul 2026 08:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784992183; x=1785596983; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ROYJU6UaoX6qKaAVEG8tMgZPL+bcKZcI1lu9EFKpxr8=; b=md472HOs+BqB/p8Qle8/9fmspSwjuEKIFUy6O7Ovrv6rrX3dgNreCIUIaTlpwEfRpY LtIioEwWYKB8QXjzzAUMeGKfOnYnnwTjdIt00YHTMUJgA9bXXwGNhgw4T3i9K5t1n3x/ 2VG7QnV5Snp+wHMOPytYiNZhxM83mGMmi48X5Y0QrtVfKUHb/7+LLWKMvz//U08CbH8M 3GgSTBLjLoAiZLsGV4KKfL1kWyqmjoXS2ckqgtd6SrUbrpAAQBBWMk8NFyh7jeroHaBj hctQZ2tydiY9NKk6zCxoADqyzahJK7zcwxxYs/eCvMDXnsAVjmDgfxfYUQdddeDfvsTt wGlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784992183; x=1785596983; h=in-reply-to:content-transfer-encoding:content-disposition :content-type: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:content-type; bh=ROYJU6UaoX6qKaAVEG8tMgZPL+bcKZcI1lu9EFKpxr8=; b=Yrk25ppkLdW054D5SkIU6ycE8hNsXwKkkwjZRCpRdGrXntlxT4/aQRsuTTDP/cKCEq BuNVMp15x4cP7bIYMJMmjfdtvZfpvdfMMK1dEVPE7G79sBiFZy55k4/7lxaP7G3cUcxV FfsXw8WWNXbtERzSgY+3HJ6OUNtLBgWL803mMOOG80206B/loH3CPV21/BUOQT/c0vkj l6ReE5ARtdzY8N4A4TWjydTZaa09WqDp0+3GtLGNOgFbLO8WsxTWqfKdt6XI3dg4IwhC htiMdYagkHUNyyIxWq48YZ6l10mtkpAXaCsHBzdQzJsjntqkuNI0FFNCfcDqKwAzTJb0 TU+g== X-Forwarded-Encrypted: i=1; AHgh+RomT5gxpha+qCvXLkGpUSQ288j7fhtydOw9VJdHHypK4x4k2kpIJynzX2P/cpkjZakzCmlYEM7Dtorhb00=@vger.kernel.org X-Gm-Message-State: AOJu0YzmAKktarYd3UdH1nSxc282I+kyi9/E8RFbNOn2ZB5+x2U0+/aX e4d/6ufIwQ6wEf2FP/+x+nTvRL6ERL35bULRNAuXx+Upe1TH1odj1NwS X-Gm-Gg: AR+sD124125mZdDBRXcUCE+Hmxhbf40OuWFFRStp7A899XIgMvGiQCqsmWtvQv8h/rR zxVsRrniSHIvi29e8+Uchz7X5v0nGZ2Z8hs/XIRimihYU1pjXO4Zg0rdieqBFH5yi9+C4edofNY Cq60tnms6UtsVgAuAYip3qoeKbCKB5zaQ/GZk+0nqA2OYtXfVinIGX5a4GggZUa6vzxmovlBtIp 4Racgkbke9nOWTttRszqgV2ajBkDmu49xZeNkH7TrD55LPJiUmPhrcauZdnXm0cjsjtOkySGNh3 Wiw4q2xdjZALYJHYms33crAuHcmGD+s5mpuEIdnhUL6M102+xRZfvcEcYfluAPiZFVPK7jdWEFS Sf0LpE2UAq3+Nax9jhUYswfy3hk1w2Ys6PpaBNMjmxbXeQdLzJ2z1DBUvC4UhIU9GeBKP/CYW X-Received: by 2002:a17:90b:1e48:b0:38e:5701:644a with SMTP id 98e67ed59e1d1-38f29656556mr2513470a91.27.1784992182631; Sat, 25 Jul 2026 08:09:42 -0700 (PDT) Received: from localhost ([172.216.252.11]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f05805fb2sm1740147a91.1.2026.07.25.08.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jul 2026 08:09:40 -0700 (PDT) Date: Sat, 25 Jul 2026 18:09:33 +0300 From: Dan Carpenter To: Aditya Chari Cc: gregkh@linuxfoundation.org, vaibhav.sr@gmail.com, mgreer@animalcreek.com, johan@kernel.org, elder@kernel.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] greybus: audio: Split gb_audio_gb_get_topology() into size query and data fetch Message-ID: References: <20260725143721.5908-1-adi25charis@gmail.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260725143721.5908-1-adi25charis@gmail.com> On Sat, Jul 25, 2026 at 08:07:21PM +0530, Aditya Chari wrote: > `gb_audio_gb_get_topology()` combined three separate responsibilities into > a single call: querying the topology size, allocating a buffer for it, and > fetching the topology data into that buffer. This left callers with no > way to perform any of these steps independently, and forced the kzalloc() > allocation to live inside the protocol‑layer driver rather than the > caller, as already flagged by a FIXME comment at the call site > in `audio_module.c`. > > Split the function into two: > - `gb_audio_gb_get_topology_size()` – queries only the topology size > - `gb_audio_gb_get_topology()` – fetches topology data into a > caller‑supplied buffer > of a given size > > Update the only caller, `gb_audio_probe()` in `audio_module.c`, to > query the size first, allocate the topology buffer itself, > then fetch the data into it, freeing the buffer via the existing > `free_topology` error path on failure. The topology size is now > stored as `size_t` and validated in the caller before allocation, > addressing the earlier TODO and FIXME comments. > > This resolves both the "TODO: Split into separate calls" comment > above the original function in `audio_gb.c` and the FIXME comment > at the call site in `audio_module.c`, both of which are removed > as part of this change. > > No functional change in behavior for the existing probe path. > > Reviewed-by: Dan Carpenter > Signed-off-by: Aditya Chari These should be in chronological order. > --- Why are you sending a v3 of this? Presumably I missed some critical stuff when I reviewed it but I can't be bothered to search my inbox to find out what... So partially laziness but also I would hate to miss this opportunity for SEO so it's also greed. https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/ regards, dan carpenter