Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3934621pxb; Tue, 2 Nov 2021 00:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOV79bBntMV1kD0GaeWsQUw7jJge10zBiAscKyCQ2t90Hos72kyZ6oPnximdl0pRn69Zi2 X-Received: by 2002:a17:906:1683:: with SMTP id s3mr29917723ejd.331.1635839148811; Tue, 02 Nov 2021 00:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635839148; cv=none; d=google.com; s=arc-20160816; b=DY0eVIuHGx3Kt75aR95R5Wdz7Dg5PkXOZdFn8fMLUy/gyTDDR+Upvl9EGcBNDxvAt2 Z1wItQPI8i1JTJt5qr/4af4bUsRcKbrfmD/hO0n2n5cpi/W0MEz46JjGvExiwU1Hc+2N +lUldva1JqQ/IB22MvRDV0hQ704nN/JegWNSH4SOJrNlFNnEIJvEDhgw8VD1OhNSqQ1I frlC2JJZYNyhyxxKcDiYQ3pWYGSTTvg9h7+iFbmCdNxkJy3nsZO3O0SoPlEGLlzpvJa+ +eLfWftkKLZj38xpsrG0SKHbWoyBKJxgat4AyQjP3HNuII2qaS7I4Wqqu0UkKlxUOVUb Gqwg== 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=YDX0EYxYXUI1I206HGN2mM/a6lx9wSJwYZ8sXcU1MhU=; b=G58EkBZbi1C8JZ/0B2Wl2OB6uIiwUxFOL2jYGilOfqW8K1DP/1BJpZiPG30DOwv8nV +FlC7lCwbQW4Snrmz44xBWzyzmMJuThdgmYKmRNyk0V41P7rDgAbFuaygMfhDQ632Kx5 1DYSBmR5ecG9XQBf4uvPRZOq6P0xAplT8RM32t5g39AATtVm0dhO+CiJcOXGw4cVu+cZ +L2Pj1maNpqAoWgMYIEREcLoe5aeJTv5EzDd5G7V+6K6oS6oQGTIkDJeRL0I05TrbAaf iSWrmOzNK9oxVhJwsCn9QxU6nRqsCXg3YGgAGL3GrZMXx5JtHlr3c/UauGIpvZoaDHEG RzPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=JYclfm0l; 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 nb28si31069936ejc.258.2021.11.02.00.45.23; Tue, 02 Nov 2021 00:45:48 -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; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=JYclfm0l; 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 S229970AbhKBHqK (ORCPT + 99 others); Tue, 2 Nov 2021 03:46:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:36414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhKBHqK (ORCPT ); Tue, 2 Nov 2021 03:46:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82BB4604AC; Tue, 2 Nov 2021 07:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635839015; bh=XMiM7tUILn/CdFEk3cemcDSZQDQhzya53qvDkGv3u6o=; h=From:To:Cc:Subject:Date:From; b=JYclfm0lVXHBLetU46MAWvUcbPBBl7lXgkoGwISBPdHyRJQg8pVNvb7WyJJB/nzvl TNwYT1hYi02L0fdIBX0YbQo7Ok0Xz83g5XLIMf79FYMAjCthEHTww2oJHltJSaPS0k W/BWs2/rjjYUnQ7c5rhN0Ai9RwYdOaeTNkiO7b78uDuIVOcylT16dwcuL2Z5U5+Klp /iMGXXZFq0RrQb5oaQ3ygFoeacvzK17tlk9x2P27PCrMTXKzTLoorIj0RShOvmCYtK Xe3bsTBsDG6tsvDDhEPeQ2SEInQ3/NsDydI9IX8362TqWRA4jlkrY7oVvMRJJjTkWA tdDRkhXAeRf6w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mhoSC-004WRy-LT; Tue, 02 Nov 2021 07:43:32 +0000 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Shevchenko , Arnd Bergmann , Dan Carpenter , Greg Kroah-Hartman , Ingo Molnar , Kaixu Xia , Mauro Carvalho Chehab , Peter Zijlstra , Sakari Ailus , Tsuchiya Yuto , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH] media: atomisp: align sizes returned by g_fmt Date: Tue, 2 Nov 2021 07:43:31 +0000 Message-Id: <5682e37ff93ec19c0fbc5dd6614d6f57281ea663.1635839008.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.31.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 Repeat the same round logic used inside s_fmt here, for the sake of sanity. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index 936516daec7d..8df052f6190d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -892,8 +892,8 @@ static int atomisp_g_fmt_cap(struct file *file, void *fh, } depth = atomisp_get_pixel_depth(f->fmt.pix.pixelformat); - f->fmt.pix.bytesperline = (f->fmt.pix.width * depth) >> 3; - f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline; + f->fmt.pix.bytesperline = DIV_ROUND_UP(f->fmt.pix.width * depth, 8); + f->fmt.pix.sizeimage = PAGE_ALIGN(f->fmt.pix.height * f->fmt.pix.bytesperline); /* * FIXME: do we need to setup this differently, depending on the -- 2.31.1