Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755304AbeAIL54 (ORCPT + 1 other); Tue, 9 Jan 2018 06:57:56 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33146 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753853AbeAIL5v (ORCPT ); Tue, 9 Jan 2018 06:57:51 -0500 X-Google-Smtp-Source: ACJfBoua0jv1qijVI/K+NyxpcbTFu6UOlRyRfZZSYYyNu0knYt4UvYJZ806/ixeSCcaozWVxm5IqyQ== Date: Tue, 9 Jan 2018 12:57:48 +0100 From: Johan Hovold To: Mikhail Zaytsev Cc: Johan Hovold , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] USB: serial: ark3116: Move TIOCGSERIAL ioctl case to function. Message-ID: <20180109115748.GT11344@localhost> References: <20180106200809.41cdd723@debian> <20180106201522.7a542d44@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180106201522.7a542d44@debian> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sat, Jan 06, 2018 at 08:15:22PM +0300, Mikhail Zaytsev wrote: > The patch moves TIOCGSERIAL ioctl case to get_serial_info function. > > Signed-off-by: Mikhail Zaytsev > static int ark3116_ioctl(struct tty_struct *tty, > unsigned int cmd, unsigned long arg) > { > struct usb_serial_port *port = tty->driver_data; > - struct serial_struct serstruct; > - void __user *user_arg = (void __user *)arg; I prefer keeping this pointer here to avoid adding casts to every helper function call, so I added it back before applying. > > switch (cmd) { > case TIOCGSERIAL: > + return ark3116_get_serial_info(port, > + (struct serial_struct __user *)arg); Thanks, Johan