Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp538715img; Fri, 22 Mar 2019 03:30:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyj6csDhFQRd8lVofk+t6TQ0PpjSbEF0sJw0IYVP6+2ZckmPXNSdEuc0uSGqoAZ0KEUHsGx X-Received: by 2002:a17:902:968a:: with SMTP id n10mr8861631plp.283.1553250636755; Fri, 22 Mar 2019 03:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553250636; cv=none; d=google.com; s=arc-20160816; b=Eq0MMZtAcWHsY6e3FEaSaxc9Becj40ypbYc8F57JDLIIUjyKWN2Yden18n86X5gQW+ JOFjrYBlhPrhrz18kBH3BVIO7LpamKVg4YmOIYT6ioZUFox7YLuCcchuh0WQVG7BD3Wj RwoaL72wgkrZnHokXLMnywejLjQ5pEl4AG8iuoiZS5YCX65V57CYXTsRRSQwt9vLuiKw rcEDwR7jYtCy9pvHEVJe3mf5hmFu1vJh6kDZY/u6CZLsSsinf0b0y3mA8VJBJLCzATfw wfrvIXIDLQMAQCnY7bCx8tBoNLNfU53NzgPl8ei/vCjRftsC+2nuRlGp3PITcBSYYOLh L4RQ== 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:dkim-signature; bh=0O1zkDSF0obwwtT/py6J6dtl46lTqaWeKMz+a7C4wtw=; b=PPtAYaXXyAJfNI+cYy3uPzoTaMkhpgkFnLMLuZlvyS6CBCtxGZnSvazvxG+zoQMxsi pHPoIz2ZVUMfpkn8ZWr18cl8TBhWYwPkl5+GTlUhIHyn3SmhR9C8du830EsDlfTu1pdf WCWzYuhynAY6JK9Bo3cXWNovCln7pnofBxRaYGbTq7gwawpE2SajOVuXOmwhu8HY+zX7 sETW/LmLZlwmqn314Tf32eYbbvW1d41QZSDpwMoknS5ZIsYUIKd79aHoxXFyuoeQuft9 tawNEMPx9nWD0IKU7PBs/BbxhvDlKHXWWIewGvsJ8Sod5JMxoLmE7Qb6Aid2rMi38iwm IBpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=a0RnkQvg; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si7094179plb.396.2019.03.22.03.30.21; Fri, 22 Mar 2019 03:30:36 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=a0RnkQvg; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727969AbfCVK3U (ORCPT + 99 others); Fri, 22 Mar 2019 06:29:20 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:60280 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727739AbfCVK3U (ORCPT ); Fri, 22 Mar 2019 06:29:20 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2MAT7B4013509; Fri, 22 Mar 2019 05:29:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1553250547; bh=0O1zkDSF0obwwtT/py6J6dtl46lTqaWeKMz+a7C4wtw=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=a0RnkQvgZx58JZhU1Go8ypJ4vatoR1dXdhWaMLGCeFNXwNfgEqFVf6gJ5NWkayzII 3s1KZH3Eg6N2a37FaxhJzjxGUsL/JQioCh4Kf+krzNbcHC8DzjBJvQN8lPCcEnzG/4 zFW2HLfv/au45IQTWqJ/mIxh/LYSdeUsW0fQ+iV0= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2MAT6NS058320 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 22 Mar 2019 05:29:07 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 22 Mar 2019 05:29:06 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5 via Frontend Transport; Fri, 22 Mar 2019 05:29:06 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2MAT3gu006787; Fri, 22 Mar 2019 05:29:03 -0500 Subject: Re: [PATCH v2 05/15] drm/bridge: tc358767: Drop custom tc_write()/tc_read() accessors To: Andrey Smirnov , CC: Archit Taneja , Andrzej Hajda , Laurent Pinchart , Andrey Gusakov , Philipp Zabel , Chris Healy , Lucas Stach , References: <20190322032901.12045-1-andrew.smirnov@gmail.com> <20190322032901.12045-6-andrew.smirnov@gmail.com> From: Tomi Valkeinen Message-ID: <19eddb76-38f7-e7cb-9a9f-5b435e67c63e@ti.com> Date: Fri, 22 Mar 2019 12:29:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190322032901.12045-6-andrew.smirnov@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/03/2019 05:28, Andrey Smirnov wrote: > A very unfortunate aspect of tc_write()/tc_read() macro helpers is > that they capture quite a bit of context around them and thus require > the caller to have magic variables 'ret' and 'tc' as well as label > 'err'. That makes a number of code paths rather counterintuitive and > somewhat clunky, for example tc_stream_clock_calc() ends up being like > this: > > int ret; > > tc_write(DP0_VIDMNGEN1, 32768); > > return 0; > err: > return ret; > > which is rather surprising when you read the code for the first > time. Since those helpers arguably aren't really saving that much code > and there's no way of fixing them without making them too verbose to > be worth it change the driver code to not use them at all. I fully agree with this patch and thought about the same thing during my work. However, the timing of this patch is not too good, as this one will totally conflict with any other patch for tc358767, and my series is still evolving. We need to figure out how to combine this series and mine, but I think either this patch should be dropped for now, and reapplied after the other patches have stabilized, or I think preferably, this one could be rebased on top of 5.1-rc1, and used as a base for all other tc358767 work. Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki