Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5847467rwr; Mon, 24 Apr 2023 09:45:27 -0700 (PDT) X-Google-Smtp-Source: AKy350Yn+9ra8wnYn6zTeqD0JmNsN9bk7jK+ogqHNRdhr8W4f3MYU8vrCcyTcOATAd3WOuxCxlPK X-Received: by 2002:a05:6a21:78a8:b0:f3:b7:b10a with SMTP id bf40-20020a056a2178a800b000f300b7b10amr9985459pzc.15.1682354727069; Mon, 24 Apr 2023 09:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682354727; cv=none; d=google.com; s=arc-20160816; b=gVFsZfhkU9+4MwpeioIdDiucuOOlqywzp20FrICJtLjPhR8GLcW1OssR8dOvMMK0iI V3quVc3G9aIbscfU/k4KJNOLkfoKaw/7imIX5YOyrOeOn+JTnGxB9CvnGQX9b6CasMtJ SWz1zmSwn9lfitazoNOQpln4xI0el6hm5Vx+6Gg6I1phKs1QJodThN3MlYHpboagBW4j Slw8gk9fSFf2/d6zSTS5GrQIIBEBzx8tuSb9B39LlisCHwYeC7R/hFqHiqvvTS3mAO9y nlS38o9Qxpi4heNYyTqK9rI05SSj05l81ZlbAQe3Zt2G3o6vMvTSdy0TWZSXvVRdreJ2 S8cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+p+ImeeX3a/wl7cJUBJfm3rv3C2DmESRnkZhqlyPXfk=; b=Bn8ibRsIZHmkb50yYsTTXikWTQZffafVtJu1WhoFMthznW+uEDK7GlHw9K0ziOUEwn FaYUZD49ZUM0V9EahpGm9ngBAzA97hZyEQ7UpKyY2oRiwbThde4wexcQQjyaDiBdUoup eQKY3TpO+RvmbZXSg2Q6E4M/B+hSj1M125ExOMs9nu87220yI+AUpBuLVTDwr77DSdSD 1ZCrVaRVgmD28UPFnk9gPtSAHUeo+gGCX0JBVogw6hFI2dTsjCk8msbj/Rmnx4eVk9Is +KIuPYsrLH+j5+BaWKU8csbyrkKHqBODpcthn+5TcFgxzOm+bRu0BeLdI88qUWfxs/tm d0fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NhYxaezP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y24-20020a63e258000000b0051bb433f5bbsi11537064pgj.386.2023.04.24.09.45.12; Mon, 24 Apr 2023 09:45:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NhYxaezP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231975AbjDXQlH (ORCPT + 99 others); Mon, 24 Apr 2023 12:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230319AbjDXQlF (ORCPT ); Mon, 24 Apr 2023 12:41:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 532EC55B3; Mon, 24 Apr 2023 09:41:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E142F60F6F; Mon, 24 Apr 2023 16:41:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC84BC433EF; Mon, 24 Apr 2023 16:41:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1682354463; bh=uyHcrWYj6DFzE+0LxApki9WRLl5S01nZPsV5WC15KpM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NhYxaezPtvWW13PKhdHdvdL00fE/tfUpdQ9siJEuYjK6wHRqz8fAhQyUMmsNb15PM DzYBfBF+REW7gsS2RFYZS4IYbLkBYhv13tbBAX9eh1zKILJgvmgcdd/poWm6nq/Y9k 80oTWmyBcIxKUsYUNXbgXN0+wxPp8i78li59DfrY= Date: Mon, 24 Apr 2023 18:41:00 +0200 From: Greg Kroah-Hartman To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: "Starke, Daniel" , "linux-serial@vger.kernel.org" , "jirislaby@kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/8] tty: n_gsm: add restart parameter to DLC specific ioctl config Message-ID: <2023042453-dubbed-botany-2ed9@gregkh> References: <20230424075251.5216-1-daniel.starke@siemens.com> <2023042438-whole-cannot-1945@gregkh> <2023042459-humbly-confusing-9721@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 24, 2023 at 04:20:00PM +0300, Ilpo J?rvinen wrote: > On Mon, 24 Apr 2023, Greg KH wrote: > > > On Mon, Apr 24, 2023 at 11:03:26AM +0000, Starke, Daniel wrote: > > > > > --- a/include/uapi/linux/gsmmux.h > > > > > +++ b/include/uapi/linux/gsmmux.h > > > > > @@ -58,7 +58,8 @@ struct gsm_dlci_config { > > > > > __u32 priority; /* Priority (0 for default value) */ > > > > > __u32 i; /* Frame type (1 = UIH, 2 = UI) */ > > > > > __u32 k; /* Window size (0 for default value) */ > > > > > - __u32 reserved[8]; /* For future use, must be initialized to zero */ > > > > > + __u32 restart; /* Force DLCI channel reset? */ > > > > > > > > Why are you using a full 32 bits for just 1 bit of data here? Why not > > > > use a bitfield? > > > > > > The ioctrl guide states: > > > Bitfields and enums generally work as one would expect them to, > > > but some properties of them are implementation-defined, so it is better > > > to avoid them completely in ioctl interfaces. > > > > > > Therefore, I tried to avoid them here. > > > > Then use a u8? > > To add further, I think that the ioctl guidance tries to say that C > bitfields using :number postfix are not a good idea, not that much to > disallow flag like content within an integer type. Agreed.