Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp406735pxh; Wed, 10 Nov 2021 03:45:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfuCYlxIRq5nqADQOJDHI1MEq6RQikWaSzs0Dg4EAgoHW122+INNzkDAevAQ6DhiQItct3 X-Received: by 2002:a17:902:c145:b0:142:50c3:c2a with SMTP id 5-20020a170902c14500b0014250c30c2amr15295599plj.32.1636544741986; Wed, 10 Nov 2021 03:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636544741; cv=none; d=google.com; s=arc-20160816; b=LXwlHFW5nfxv9zlLTaOjesnE/jIkUykIHjZw05HPsocc+moKtYkoI0KzDyWAer+kYy HsjmOOyLkrOoUbfIvRRTbZlKM0aPAsvnlay+bzwMT64YwJufapYvNSO7I3goZxpdwcNW +LGB6ziBxfEhueJF8rM7hz57MH/dG0RDy1QohM0VtQFHe2rTKZ9mxdGwAUevOM4Wpuo+ aJj0/3+WFAQJ/srpBCO/WbZe9BtGk79Xax6qp0frVnzm2mRhkJHoYSFudgFWiJDj9bqp pY2PkAH3zV82tSdGHJZjU1dmgO5GMEGrIaS2qfTfGlawgQ2McNW4xnu4pUjNjgF0YqDh AcbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=xWrWq2qX9snLuw2n9nvz64Qj7jtGwZCtDaZCXojMuBk=; b=wQRiMIBFY2iznyOz2r7pMNTuRNJ+JW5L6ww/9ibIFamIo6WEyWiXMh+oqSh92zrhIC HapzrZudTLX22fLlMcng+NAbsdQkSuoLmhsvLy68M6JrzAk61s/KHZaS8o7rB5pBwnDt +hndH+46FqQ6X1xxpqzCHulhH+fDltaLpQIWyLIwku4PM5s1aE+ptmaQiDUuTUnIpTIu FcBR8QtJtIAnp478tHEA5bhQm77zFOIp9uQ5uUgf955aM3fS/tDdcUAqRU3Ee4DyNIKF xZmhOBcmsFKZI01tn9AuyABuOf/8VuEPD0Gvvyc2or0QdYPeYpatncsf2muelQD5XBav asMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=D+oBXRGL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si16974455pfv.351.2021.11.10.03.45.28; Wed, 10 Nov 2021 03:45:41 -0800 (PST) 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; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=D+oBXRGL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231254AbhKJLqj (ORCPT + 99 others); Wed, 10 Nov 2021 06:46:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:47584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbhKJLqj (ORCPT ); Wed, 10 Nov 2021 06:46:39 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4D9461107; Wed, 10 Nov 2021 11:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636544631; bh=cij5tqc7NOVk9YF9EKFeRZ9Z4y/NvBQ97G0hC0bPCb4=; h=From:To:Cc:Subject:Date:From; b=D+oBXRGLIV6VqhXgjoD4Lr4QE6xCyDuyrwh8MVVRskshhGB1zVw7Easzt5DZHu4Fg Z89hwoOgILPovQh+kkPxtmteAqmmk8PWt+oAXjv0M18oygcASixtY+u0MQtCxQ2fPo MT1zbS1wFASXzasD2oKTy92GZnTy2DHwKJFGdLzIZBxPtdnh55X291aIsc1ehct8kK NrYU6STLBZrft5Hc98ysYImU4RC5AFgdZkDnjQOgCV3j4V5ya0K68LqosIY+a7ozBq wbp1/9t51j51bvH9QNtvEIA7nJWSKIr35hrYqeRNxnhLAtzk80GMFLqndEQaDFQ6+x CVSuhtU3oLLig== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mkm16-003Lvd-3p; Wed, 10 Nov 2021 11:43:48 +0000 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Alan , Alex Dewar , Aline Santana Cordeiro , Andy Shevchenko , Arnd Bergmann , Greg Kroah-Hartman , Hans Verkuil , Kaixu Xia , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , Tomi Valkeinen , Tsuchiya Yuto , Yang Li , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH] media: atomisp: get rid of atomisp_get_frame_pgnr() abstraction Date: Wed, 10 Nov 2021 11:43:46 +0000 Message-Id: <80ea920d14379124ba92aab2e6a6d12a92d79b2b.1636544620.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Simplify the code by getting rid of this function, as it ends being just a single line of code. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 16 ---------------- drivers/staging/media/atomisp/pci/atomisp_cmd.h | 2 -- drivers/staging/media/atomisp/pci/atomisp_fops.c | 2 +- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 4ef5d728cd2f..4bd5ab3a7863 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -1931,22 +1931,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr) return IRQ_HANDLED; } -/* - * utils for buffer allocation/free - */ - -int atomisp_get_frame_pgnr(struct atomisp_device *isp, - const struct ia_css_frame *frame, u32 *p_pgnr) -{ - if (!frame) { - dev_err(isp->dev, "%s: NULL frame pointer ERROR.\n", __func__); - return -EINVAL; - } - - *p_pgnr = DIV_ROUND_UP(frame->data_bytes, PAGE_SIZE); - return 0; -} - /* * Get internal fmt according to V4L2 fmt */ diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.h b/drivers/staging/media/atomisp/pci/atomisp_cmd.h index fb848d716947..ebc729468f87 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.h +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.h @@ -74,8 +74,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr); const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus( u32 mbus_code); bool atomisp_is_mbuscode_raw(uint32_t code); -int atomisp_get_frame_pgnr(struct atomisp_device *isp, - const struct ia_css_frame *frame, u32 *p_pgnr); void atomisp_delayed_init_work(struct work_struct *work); /* Get internal fmt according to V4L2 fmt */ diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index c7ac313a2edf..0a8023aaf73d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -1094,7 +1094,7 @@ static int frame_mmap(struct atomisp_device *isp, host_virt = vma->vm_start; isp_virt = frame->data; - atomisp_get_frame_pgnr(isp, frame, &pgnr); + pgnr = DIV_ROUND_UP(frame->data_bytes, PAGE_SIZE); if (do_isp_mm_remap(isp, vma, isp_virt, host_virt, pgnr)) return -EAGAIN; -- 2.33.1