Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7535581ybi; Mon, 8 Jul 2019 23:53:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYEqKo3XG39aKH/JcdbImruJqUK1GPiwR2Te2F75nuPSYbPnTegoXT6dq8nNS84rz5uWAl X-Received: by 2002:a63:b547:: with SMTP id u7mr29355638pgo.322.1562655211099; Mon, 08 Jul 2019 23:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562655211; cv=none; d=google.com; s=arc-20160816; b=BidPn5FGVTWcwxPmIUklKEE62HDWreH87A9Y2DmtGoryGWk5nmFDQe0z5YAUA+tg2H hSayf365Y9LgKwQMPCE/279FthAJ/JeP3pyTWIIW3kvCYMdNV5/lTOZePNgM5w0fQ9gz oGeYFq0KMBYjiFfWyfKJ4xJ4v3OeTQJuLpZBFhnLnEbMpJe1FZQtXaHOyDNlyZ2dr2Lh hnog1q4h7TqyzG0YE6ecwJcWt/B2WCma5ZlRLlVqIBbFcNJZEozS64Su0bfRi3ajIUvQ X/dskkFRqNyNQObaPYLCj/6G6tIUYqgOOnzlUSXO1qrDytGYuiSiReP6NktPzOt6rvcb oC7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=rgrH5wRWzQgThsWEiCYxyXS9PbtJ3vrwTCY8JXHI6P4=; b=USfVsx+vhyRKjsdJyRidaJxZycTdmpH+PFix63ayd/yMDrVXAsesU+cuYOk8egWtpE 3mpKE08Xr7/x8JdMPm29XtwxpG2nbrWMUWftrLQ6yj4Pv1BWVRrePC8JkkLL1L/U4GvJ GxYqga8RyfQRjx9/JaWKNpw2eE57bNeg4wIl8Upet+/NQ021uBr4+LK/fXyJCLx1hWg8 PePscrChNkliorsWHDIqVVEDf1/WYTU8NutlYpT2R2mw5xQ61+msDoleIqON8BDQ0u9+ YKqPhu5MHcn2mWpSiKC3riF0/PpS5X3b0hEXIDqBDNFGuj6YFkRCb/j8PZCvsiYvHzxp IGjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=Vmkmm7eK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13si20723246pgp.214.2019.07.08.23.53.15; Mon, 08 Jul 2019 23:53:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=Vmkmm7eK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726031AbfGIGwh (ORCPT + 99 others); Tue, 9 Jul 2019 02:52:37 -0400 Received: from first.geanix.com ([116.203.34.67]:46616 "EHLO first.geanix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbfGIGwh (ORCPT ); Tue, 9 Jul 2019 02:52:37 -0400 Received: from [192.168.8.20] (unknown [85.184.140.241]) by first.geanix.com (Postfix) with ESMTPSA id BCEB9A74D; Tue, 9 Jul 2019 06:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1562655066; bh=RfeiGUEKWH7qyJygRhO8clCB6nnYi59qk/T4EI2NSKA=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=Vmkmm7eKlyoVJek7jGJmJDi6yGPdV0siQDLLGnRJxd7fZEinxlWPv4VfkdxfHD0ix J5ENPe/6AHNJlxW/RtiMlMhEujYj4n612N1foZk2NAxRPlPMzQyqqeaQ3aRF7q4RE1 EfDi9ofucO2OUj5kR6PuMdQ8xVFVZqPjRZjUGt0s9VSQSSSuTuLDFRBtc/S+Mdu3eu PUcDbDTBTifDKTuSV9mWnrIBu0d5YkGfh9MSB8h5GeFAjdRReaurwwkbnk3Q9mElrf EnoYoK6KEHMqnMvm1TBoZSTcSSZmVMx0d45Ke2NdtIGOTpii+tkMqmLWAt4TO+FFsK bIqW71YI53CLw== Subject: Re: [PATCHv2 4/4] tty: n_gsm: add ioctl to map serial device to mux'ed tty To: Jiri Slaby , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Esben Haabendal , =?UTF-8?Q?Sean_Nyekj=c3=a6r?= References: <20190709064633.45411-1-martin@geanix.com> <20190709064633.45411-4-martin@geanix.com> <97618a78-36e7-f071-47e2-beadbd505cb6@suse.com> From: =?UTF-8?Q?Martin_Hundeb=c3=b8ll?= Message-ID: <764ab112-0e0d-fa10-607a-6ffb1f53297d@geanix.com> Date: Tue, 9 Jul 2019 08:52:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <97618a78-36e7-f071-47e2-beadbd505cb6@suse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US-large Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on 884f5ce5917a Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/2019 08.49, Jiri Slaby wrote: > On 09. 07. 19, 8:46, Martin Hundebøll wrote: >> @@ -2623,6 +2624,9 @@ static int gsmld_ioctl(struct tty_struct *tty, struct file *file, >> if (copy_from_user(&c, (void *)arg, sizeof(c))) >> return -EFAULT; >> return gsm_config(gsm, &c); >> + case GSMIOC_GETBASE: >> + base = mux_num_to_base(gsm); >> + return put_user(base, (int __user *)arg); > I am not sure, but do you need the local variable at all? No, I kept it around just to avoid too many parenthesis in the put_user() call. Your call. // Martin