Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2769580pxk; Sun, 27 Sep 2020 22:04:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfftKVW+aoWY7ivLKMFCwjzM07z8fAEd+HnbPASYaXWnjgvJ+TXCjlT4AG0yAHzIl2M/ul X-Received: by 2002:a17:906:fcc8:: with SMTP id qx8mr13597430ejb.13.1601269477353; Sun, 27 Sep 2020 22:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601269477; cv=none; d=google.com; s=arc-20160816; b=wWVAaMe0rhJ1AuYr1cJCTRE0TvphfxcJDP7FouhqR5X9ycrzSmtKu5oCD3fTvNAKNK 1hfOx/+CYOv1vY3W+fbrSM6V+lTehGkNxnsWkgjSd8blFfi7hnPscfVjaxYG1y/yo8dE qafzr4I2o5mjF9SElGCwwH6HnCL3phebwYCYnc91Ua08nwbq3eXqDTAb5uGWMkmLuxhf hdAtdsdVORhGefaOv9Vja1cXBK5PBA8eUrjiHkUlWTiXKqlrWgu2yOCkTKhi2oaWQCr+ lueBRktMeRYT+59hO+tmPPKpGlsFrN3nCFvkW7N+uQTsk4ar8PMr8pl1NP5x7Ep2pzCN 2Fgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=BUDRLP2LGLfy+3G2OFudA84w21bSzDq3Wy++I3eZCkE=; b=kucrlNMb3LMkFGZtkRq+cPNQrnBubaBcPSVFK3m+Wz36qopfERcY5shImavIpn/+nZ 6N7KY3sa+1GVOMgiYeZyvEWhofa/yMu6FdIOfzVBIyPQ2SxQFSD+eZDomgPdchWV6gMm 2id1LuJN/0i5+xl2u5a+62SIjVIuUuQkKkQtYihQfI+LA9ZXnV2ULAHeqLTUgoaBUuV3 dIa2AU2xJAgtQoHL2XUdgPdyyChWJy6/Ns3TenNmBvldxczW8BeaNuAjm6Tc9IgVujMV QY+bPpWJxjUUaA5lThLb9KmvfQNQIPWlxKfTE2TfDMj/QdEZ7i1e0K76fsx2X+VW2XAn 9tAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si6608424ejw.357.2020.09.27.22.04.14; Sun, 27 Sep 2020 22:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726485AbgI1FC1 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 28 Sep 2020 01:02:27 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40919 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725287AbgI1FC1 (ORCPT ); Mon, 28 Sep 2020 01:02:27 -0400 Received: by mail-lj1-f193.google.com with SMTP id s205so7187670lja.7; Sun, 27 Sep 2020 22:02:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=98fPA5hAP6rCEl3IEufuD9Lb3X1TaFuj1wbjNl6NBDM=; b=oqeQc6THerXQAdNlyHw82nmrQmeCF49IH8U64igcINsEcH8qjG0HwfJfOFZMeCjdoA ly6CA8fPdeyln3rQgdc5Y6A+D+jzOpDTF3r7iZKoE7qHCeiY98DXSbabXRnqpoPGHm/I 4E6k7j2VueQSV/InpGHU8IDGRf5pz3F4ubIzetZbX9CchnQufi7iFhJcWjNtJDsAc0oO +JAdWYVkrFsXw5jGi5vXj64UXMxgoupSYir0qAvDrBbsthy+nQuLHp33P25fxZHJFZFf 7LPljWTT4H3QkHYeKt45WbaPR5t9MELFaq/mnryH7Aah/R8n5fzCcmkxEcVg4LInp0xo lRtg== X-Gm-Message-State: AOAM531TwwwlO5nVMlcpb7RhvXkW6crU3FS1Hh0xQ6QuVbSLSKsyExay wsXETa25ojk++O70MIXcBXcnO8EqFWblew== X-Received: by 2002:a2e:9854:: with SMTP id e20mr4603982ljj.152.1601269344731; Sun, 27 Sep 2020 22:02:24 -0700 (PDT) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id w30sm2664044lfn.102.2020.09.27.22.02.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Sep 2020 22:02:24 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id u8so9576455lff.1; Sun, 27 Sep 2020 22:02:24 -0700 (PDT) X-Received: by 2002:a19:c6c8:: with SMTP id w191mr2894029lff.348.1601269343999; Sun, 27 Sep 2020 22:02:23 -0700 (PDT) MIME-Version: 1.0 References: <20200927192912.46323-1-peron.clem@gmail.com> <20200927192912.46323-4-peron.clem@gmail.com> In-Reply-To: From: Chen-Yu Tsai Date: Mon, 28 Sep 2020 13:02:12 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linux-sunxi] [PATCH v5 03/20] ASoC: sun4i-i2s: Change get_sr() and get_wss() to be more explicit To: =?UTF-8?B?Q2zDqW1lbnQgUMOpcm9u?= Cc: Maxime Ripard , Rob Herring , Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , Linux-ALSA , devicetree , linux-arm-kernel , linux-kernel , linux-sunxi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 12:37 PM Chen-Yu Tsai wrote: > > On Mon, Sep 28, 2020 at 3:29 AM Clément Péron wrote: > > > > We are actually using a complex formula to just return a bunch of > > simple values. Also this formula is wrong for sun4i when calling BTW, it is entirely possible that the compiler optimizes your switch-case back into the original complex formula you replaced. :) > > get_wss() the function return 4 instead of 3. > > > > Replace this with a simpler switch case. > > > > Also drop the i2s params which is unused and return a simple int as > > returning an error code could be out of range for an s8 and there is > > no optim to return a s8 here. > > > > Signed-off-by: Clément Péron > > Fixes: 619c15f7fac9 ("ASoC: sun4i-i2s: Change SR and WSS computation") > > Reviewed-by: Chen-Yu Tsai