From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 913AEECDFBB for ; Fri, 20 Jul 2018 06:19:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3706C20647 for ; Fri, 20 Jul 2018 06:19:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3706C20647 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbeGTHGV (ORCPT ); Fri, 20 Jul 2018 03:06:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34214 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbeGTHGV (ORCPT ); Fri, 20 Jul 2018 03:06:21 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 03A1941C; Fri, 20 Jul 2018 06:19:43 +0000 (UTC) Date: Fri, 20 Jul 2018 07:43:00 +0200 From: Greg Kroah-Hartman To: Todd Poynor Cc: Rob Springer , John Joseph , Ben Chan , devel@driverdev.osuosl.org, Zhongze Hu , lkml , Simon Que , Guenter Roeck , Todd Poynor , Dmitry Torokhov Subject: Re: [PATCH 17/32] staging: gasket: annotate ioctl arg with __user Message-ID: <20180720054300.GA26447@kroah.com> References: <20180717205712.29495-1-toddpoynor@gmail.com> <20180717205712.29495-18-toddpoynor@gmail.com> <20180719093743.GC14301@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 19, 2018 at 07:44:53PM -0700, Todd Poynor wrote: > >> /* Type of the ioctl permissions check callback. See below. */ > >> typedef int (*gasket_ioctl_permissions_cb_t)( > >> - struct file *filp, uint cmd, ulong arg); > >> + struct file *filp, uint cmd, void __user *arg); > >> > >> /* > >> * Device type descriptor. > >> @@ -549,7 +549,7 @@ struct gasket_driver_desc { > >> * return -EINVAL. Should return an error status (either -EINVAL or > >> * the error result of the ioctl being handled). > >> */ > >> - long (*ioctl_handler_cb)(struct file *filp, uint cmd, ulong arg); > >> + long (*ioctl_handler_cb)(struct file *filp, uint cmd, void __user *arg); > > > > Why are you not using the typedef above? > > There's a typedef for the permissions check callback, but not for the > handler callback. It's a bit confusing, so I tried adding a typedef > for the handler, but now checkpatch is spanking me for adding new > typedefs -- maybe I should drop the existing typedef? No, typedefs for function pointers is just fine, checkpatch should not be complaining about that. And even if it is, it's just a guideline, not a hard rule that you have to abide by everything it says :) thanks, greg k-h