Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp302369ybb; Fri, 3 Apr 2020 03:03:38 -0700 (PDT) X-Google-Smtp-Source: APiQypLjgjXfKp+RrsDS5xpIeqiyTYIMTCmtGvrsEwCJ5uUFlHP4iApJnLCpopDd648+bAjzNjE0 X-Received: by 2002:a9d:344:: with SMTP id 62mr6126556otv.102.1585908218700; Fri, 03 Apr 2020 03:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585908218; cv=none; d=google.com; s=arc-20160816; b=SqGyYOq3ko/GW4+S9Cgpmc7uuIpn+mf8U2w7BBuUDfUeQHBXQxnJHZiAnqdmsxXgTy z0ChBo2f9csibNSH/FVUEGVvNN62cMexDfL4bwsgPHCWtFQOYD5ii1A7ztxlB1MJC8YF okiDVnKSMheJb4lst2E0UG9jacxujB1hWEhAH5Z8d2RxmnHj+iqtMaORMVunOTXG+iIj BVxOpEjx8t7QOZOwQpamLHwykIgdhNp0jkNf/e+oZUNyWra6TZiTdOKG/ugbfNhb0dHL 3jwwu0wzRbZGZBwFviQ/lxlk3IJhVrXUa1t4/F3xQouZ2izBxYLQHVDnyV8bnRIHrgEF s+SQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OZr4EU3q8iiI3yrKNeli5JHYv9tuf0noFETl+X6aNgU=; b=qmSH8c3hDQKxgrcH0IRGuFD6DCVAOGkHhmZHyFagzEGcjeW9w6CxCymWNaQBilus9K BWthSxJ44972CNY00IeHvStz6pCWMytCYNAiJTM7upw8LLYLiHnItiSGD7i9KNUTc8Vv Hi9iFFI6nHhkeLc2XCNP+SSkjfIBZrsjmSRqdNPtPfC0Bo59nmCybI1D/s7qIRbTWfiF bBCd4BO2VIHZGcqz8onzg3Ia0ul46Z5UYQ01Xx0vH+DNDa0KgWuoN83G+RtoEociyDG5 R7v6Uvlng4oE+1h11RLJzMNemvpJVpVlmfLRFee2cndB1Pz6fSJoOFhTT4r3vf/wzi4q Qdhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ZC0fUK0g; 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=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si3825047otc.147.2020.04.03.03.03.25; Fri, 03 Apr 2020 03:03:38 -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=@mediatek.com header.s=dk header.b=ZC0fUK0g; 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=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403806AbgDCJkz (ORCPT + 99 others); Fri, 3 Apr 2020 05:40:55 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:19623 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2403761AbgDCJku (ORCPT ); Fri, 3 Apr 2020 05:40:50 -0400 X-UUID: 598531b3813948bd82b703c1721f1a0e-20200403 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=OZr4EU3q8iiI3yrKNeli5JHYv9tuf0noFETl+X6aNgU=; b=ZC0fUK0gEDMdwtWatBTVz8U+qXfxBvlAbOsvGLyFMNNosSTGpvISAk6Z1SwHU/vc6JdWe06XsrVDw0NIRE1IpDuAbFoAtcDkUCTG1KJ1IY+VtSYi6edF7ba0W+Xf44XYn74G8z86b0s9x1NLRZsqKACRSgVcS/+fqL9sUykpdwk=; X-UUID: 598531b3813948bd82b703c1721f1a0e-20200403 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 2052643717; Fri, 03 Apr 2020 17:40:44 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 3 Apr 2020 17:40:40 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 3 Apr 2020 17:40:39 +0800 From: Xia Jiang To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Rick Chang CC: , , , , , Marek Szyprowski , Tomasz Figa , , , , , , , Xia Jiang Subject: [PATCH v8 07/14] media: platform: Use kernel native functions for improving code quality Date: Fri, 3 Apr 2020 17:40:26 +0800 Message-ID: <20200403094033.8288-8-xia.jiang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200403094033.8288-1-xia.jiang@mediatek.com> References: <20200403094033.8288-1-xia.jiang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VXNlIGNsYW1wKCkgdG8gcmVwbGFjZSBtdGtfanBlZ19ib3VuZF9hbGlnbl9pbWFnZSgpIGFuZCBy b3VuZCgpIHRvDQpyZXBsYWNlIG10a19qcGVnX2FsaWduKCkuDQoNClNpZ25lZC1vZmYtYnk6IFhp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