From patchwork Wed Sep 3 23:19:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4840241 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 35D26C0338 for ; Wed, 3 Sep 2014 23:20:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DE56201EF for ; Wed, 3 Sep 2014 23:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19CF22018A for ; Wed, 3 Sep 2014 23:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935687AbaICXTo (ORCPT ); Wed, 3 Sep 2014 19:19:44 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40283 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935669AbaICXTn (ORCPT ); Wed, 3 Sep 2014 19:19:43 -0400 Received: from 200-100-75-232.dial-up.telesp.net.br ([200.100.75.232] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1XPJq0-0000A4-9Y; Wed, 03 Sep 2014 23:19:40 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1XPJps-000071-L9; Wed, 03 Sep 2014 20:19:32 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Hans Verkuil , Sylwester Nawrocki , Sakari Ailus , Kamil Debski , Antti Palosaari , Jonathan McCrohan Subject: [PATCH] v4l2-ctrls: avoid a sparse complain due to __user ptr Date: Wed, 3 Sep 2014 20:19:23 -0300 Message-Id: <3de557fce274288343f3ac7f5b3e0dac87f123bf.1409786360.git.m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP c->ptr was already copied to Kernelspace. So, this sparse warning is bogus: >> drivers/media/v4l2-core/v4l2-ctrls.c:1685:15: sparse: incorrect type in assignment (different address spaces) drivers/media/v4l2-core/v4l2-ctrls.c:1685:15: expected void *[assigned] p drivers/media/v4l2-core/v4l2-ctrls.c:1685:15: got void [noderef] *ptr Reported-by: kbuild test robot Signed-off-by: Mauro Carvalho Chehab Nacked-by: Hans Verkuil diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 35d1f3d5045b..ed10e4a9318c 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1682,7 +1682,7 @@ static int validate_new(const struct v4l2_ctrl *ctrl, break; } } - ptr.p = c->ptr; + ptr.p = (__force void *)c->ptr; for (idx = 0; !err && idx < c->size / ctrl->elem_size; idx++) err = ctrl->type_ops->validate(ctrl, idx, ptr); return err;