From patchwork Mon Sep 30 10:38:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 174730 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp6942998ill; Mon, 30 Sep 2019 03:39:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdgc/WxPBT28gB+tPiHFaeulpfHj2xBTnEZNvMLtkyLZC3fBSaKvXtd9ZsEodIMAD3YGtE X-Received: by 2002:a63:6b49:: with SMTP id g70mr22779139pgc.92.1569839943375; Mon, 30 Sep 2019 03:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569839943; cv=none; d=google.com; s=arc-20160816; b=k3XUSnnRT4xyRGY9VNAz9MY85QVW3IvKqgd6qnbWT3BuGKJ+8hOI9ShfVy/lhEVKnX ZB2Pi+gO+pFbEO5D1OiWa1Ob2ePLUu5SJhK208WFtdwe968pNdE/B8myec+ed7G44YJa H3JnvJgZuwNn+N9z+w2EictM0yTlXXEP++LQ61f4rh65hlMZMcY1J/RmbY1vOSBq/8+p g1ZibikUPjDfAB7lIsciF8jL0XC1XZ4lHM9SwMv8qpVb9E0+O88178wlPQ/OR104Vhjw 70aYGkymZMmP+iPDV+zNbx/RuviYQ25hnN/ePif9KHFTu7n5xRyjznzIIBL+cFBoK5sH dEsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=7Zw+WsVFYUeG4NJYqvlCPvDM9DQiFNbBZtjlIPmUilo=; b=phMS9oNHxU73acESJmvckggULxGBWuiIEW0lzg3F9GEg6nvz4LywT2CyJozlmKAOkS oTx+hroq6wjsFCVHNLjic6bRa4eesnbgU131kNAPp3w5J7HKJeUwhgNWhcHf8Aij9LG1 3z/4xW8h5gLCOTOv/Em+WEVp1MpVwQFiq9KY+GN7GPyuPo01aqrnlw4xQr/9iW4Y8HW2 nl1LWK3iPB+/zC/dwbWGYRIiCb6cK5GRBYXvGwxt5uCqGvrR82rTiZHmArCwFGLatP10 mmGKN/9nqyr0fGzU9F0f+GL40D6gsgqpURbLJhkw0CkRIZ/xmpUUp+jQv3VHlHD4wyD1 ahfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id n7si14709837pgk.209.2019.09.30.03.39.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Sep 2019 03:39:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 580896E258; Mon, 30 Sep 2019 10:39:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C9A26E258 for ; Mon, 30 Sep 2019 10:38:57 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8UAcplh088955; Mon, 30 Sep 2019 05:38:51 -0500 Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x8UAcpGe038344 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Sep 2019 05:38:51 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 30 Sep 2019 05:38:51 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 30 Sep 2019 05:38:42 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8UAck1w011864; Mon, 30 Sep 2019 05:38:50 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv2 2/7] drm/omap: avoid copy in mgr_fld_read/write Date: Mon, 30 Sep 2019 13:38:35 +0300 Message-ID: <20190930103840.18970-3-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190930103840.18970-1-tomi.valkeinen@ti.com> References: <20190930103840.18970-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569839932; bh=dyPTj9BT+kCyt9tcnbZFyEDzpxzADhv68Ba83qN+B5A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=YU6ceY0R74G8KwFMg7m71nUpASVW1mpviezWYH3/LJwGhspM0kBzr2k6WQOwa7GFj tSb2kILdJm3qBKJGdfBTzDq7Vbi8FSFCs5t+pbEDAZ5xwaSMaPM15NPuvXob2QBRyB T3lKBrAoDXfhBGqWduxdT57wFrzLDwuL0N+2Vo9k= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Jyri Sarha Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Avoid unnecessary copy in mgr_fld_read/write by taking a pointer to the reg_resc and using that. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/dss/dispc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 0dc0272569f6..3c9315b17ef2 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -365,17 +365,17 @@ static inline u32 dispc_read_reg(struct dispc_device *dispc, u16 idx) static u32 mgr_fld_read(struct dispc_device *dispc, enum omap_channel channel, enum mgr_reg_fields regfld) { - const struct dispc_reg_field rfld = mgr_desc[channel].reg_desc[regfld]; + const struct dispc_reg_field *rfld = &mgr_desc[channel].reg_desc[regfld]; - return REG_GET(dispc, rfld.reg, rfld.high, rfld.low); + return REG_GET(dispc, rfld->reg, rfld->high, rfld->low); } static void mgr_fld_write(struct dispc_device *dispc, enum omap_channel channel, enum mgr_reg_fields regfld, int val) { - const struct dispc_reg_field rfld = mgr_desc[channel].reg_desc[regfld]; + const struct dispc_reg_field *rfld = &mgr_desc[channel].reg_desc[regfld]; - REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low); + REG_FLD_MOD(dispc, rfld->reg, val, rfld->high, rfld->low); } static int dispc_get_num_ovls(struct dispc_device *dispc)