Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp207118ybi; Fri, 26 Jul 2019 08:27:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxaZe/RHsgHXycnArKEW2L5L0hqsS9/EqWkOvmNUNEScgJdQErF6640e9EJd6N/KLfmMF2 X-Received: by 2002:a17:90a:8a0b:: with SMTP id w11mr98040376pjn.125.1564154843923; Fri, 26 Jul 2019 08:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564154843; cv=none; d=google.com; s=arc-20160816; b=mGGlh2YR0Jsc/LFTk0oB03mxB/37ogos3cHy9aR4esQjL2WAdGkCx8ztXxZ3qZMhn9 WgXV6TYKUDoHJONpreQuhnILZ12SNpCVuV5UQM90EzejcUbhu5cm4dPXxzMUqRaqvOXr PRucymUDMcOA8mEfu4qZM5VnW7wIGCYyz8+AGLdKX5/QaNb9CfvOs3LxywuMSi2tdgmi FpLebsa8V2UPqEbKLDpB1r2CvW62D6RxjrSnbSyUsTK2KdtbSs6o7Y7fe2CiDMnaWrUU xUNAh23kckvCuiz0ubqzczvsC7iNLqmQTZ6AzD5MdorSyJwRNJuPxvf+BLe0JF/lYP25 /IXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Xfjj32wwXwJMyjbojn/UOv+UD95DSq0T3Xg+FgN9gUQ=; b=jiu/LwOkmQT8qqa+8V/xklgn9n3ssMFCpfR3cSio29Ugs7aQuygpcsM54stxLdm91/ 9euIniaNLpr5jyJOZmeQvoRS+ZHVqeYWP8EJdNhY+ydZ/eJovhghtp/bfSyJczksE4WP hnApTYV3RST0CqsnQMeWUI1a1jsfM7AWBun8zRUqNpGY9F/wmAb7iaMnNECtamYlT3JL U3Lu84jFpUGuKV3DGeJntMfnHmP7vQSP/c1EGGMwRHHBbrq4HMi/IHo4KRjk2egRIrk0 b4+/u4amNlARZPxzw8a4ZkItSWTzU3XF0ZCdeF4Of5JmetgQROS/Y15NyG6lbxv/7H0L uOjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si8477136pgp.343.2019.07.26.08.27.08; Fri, 26 Jul 2019 08:27:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387826AbfGZP0H (ORCPT + 99 others); Fri, 26 Jul 2019 11:26:07 -0400 Received: from mga11.intel.com ([192.55.52.93]:33806 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387681AbfGZP0D (ORCPT ); Fri, 26 Jul 2019 11:26:03 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2019 08:26:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,311,1559545200"; d="scan'208";a="322065176" Received: from msmall-mobl.amr.corp.intel.com (HELO [10.251.154.62]) ([10.251.154.62]) by orsmga004.jf.intel.com with ESMTP; 26 Jul 2019 08:26:01 -0700 Subject: Re: [alsa-devel] [RFC PATCH 21/40] soundwire: export helpers to find row and column values To: Guennadi Liakhovetski Cc: alsa-devel@alsa-project.org, tiwai@suse.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, vkoul@kernel.org, broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-22-pierre-louis.bossart@linux.intel.com> <20190726144325.GH16003@ubuntu> From: Pierre-Louis Bossart Message-ID: Date: Fri, 26 Jul 2019 10:26:01 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190726144325.GH16003@ubuntu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/26/19 9:43 AM, Guennadi Liakhovetski wrote: > On Thu, Jul 25, 2019 at 06:40:13PM -0500, Pierre-Louis Bossart wrote: >> Add a prefix for common tables and export 2 helpers to set the frame >> shapes based on row/col values. >> >> Signed-off-by: Pierre-Louis Bossart >> --- >> drivers/soundwire/bus.h | 7 +++++-- >> drivers/soundwire/stream.c | 14 ++++++++------ >> 2 files changed, 13 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h >> index 06ac4adb0074..c57c9c23f6ca 100644 >> --- a/drivers/soundwire/bus.h >> +++ b/drivers/soundwire/bus.h >> @@ -73,8 +73,11 @@ struct sdw_msg { >> >> #define SDW_DOUBLE_RATE_FACTOR 2 >> >> -extern int rows[SDW_FRAME_ROWS]; >> -extern int cols[SDW_FRAME_COLS]; >> +extern int sdw_rows[SDW_FRAME_ROWS]; >> +extern int sdw_cols[SDW_FRAME_COLS]; > > So these arrays actually have to be exported? In the current (5.2) sources they > seem to only be used in stream.c, maybe make them static there? > >> + >> +int sdw_find_row_index(int row); >> +int sdw_find_col_index(int col); yes, they need to be exported, they are used by the allocation algorithm (in Patch 27). Others will need this for non-Intel solutions, it's really a part of the standard definition and should be shared. I can improve the commit message to make this explicit.