Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1505524pxm; Thu, 24 Feb 2022 04:38:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyf4Fb4c5VqmwPKIFOBhIxm9ZZhVu7hux82pPjUYfmvDOiMmRNf/x62TgDwwD8tSyNycGSJ X-Received: by 2002:a63:f0d:0:b0:374:916e:52a4 with SMTP id e13-20020a630f0d000000b00374916e52a4mr2120023pgl.457.1645706311835; Thu, 24 Feb 2022 04:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645706311; cv=none; d=google.com; s=arc-20160816; b=Apxem+mKfbYw3IKrBZNge91XY+2V0cCYzCSUsvQU+VYaVjQ/3EFUUh6WrYrtiGGi0u QVrVR3+ZveYeyOZjSE7ENJ7AO9igoDzYJsuTfZw/1Okk7h67oEvdagLMZLv18hX5e30J KoC96cNQahC4qnxo+mbGwJapxIBk/3G2IuyWtIMlKR5AdsyGlR9zkqzco8vlbZVllHs9 iRc6Pm2ly0n/Z+k9RfFqyFN+gV+9ACxP4PXU1ZknF2qM69Axv2Smpva+ojnLxE7V30mG c+KqXwWFGaqay+nSvL3OTWtEbtJ4/3GhjlNZ/gPMm9XutdscNha4hkhSo+xUTFO/eOq4 7qCw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IiAaN0t6Ov/cI9WQlsTy2ivkU3CfzXRAkP4azJ7nE9I=; b=f9Jxi6AOGewkaSWkdRyyswvH0XpGC45z+c80ec0dDQFDksM/yaAaQ1mgsmAYzw7r0M Mkxhvu0eJiVUEtRenknPIC+Oh/QIJRrVwZX7wmJ/vnqd652FItJ9Gihizc21KCCYxUPg v5KIi8zIWtGXzP+We5L47u5K2/Lb/2gnOHZA+4I532cvdTGh408zpdx3jP/KSs17HpGD ryYA+FSlD/P67CQ/tmgccsqVlfW+xFcF2xuHgXxvYqQQLuqf4tGCY5VdB0zOSU+wP0HL uX47dqpuI8Z15mAcTHO7izoYhEi8v5am4zEyiXXZNRlEVW6DTkaOYEKTERfQ4eTjn+K/ gtLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D6zEhiIv; 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 q4si2936437pgu.96.2022.02.24.04.38.16; Thu, 24 Feb 2022 04:38:31 -0800 (PST) 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=D6zEhiIv; 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 S234198AbiBXLYS (ORCPT + 99 others); Thu, 24 Feb 2022 06:24:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234195AbiBXLYQ (ORCPT ); Thu, 24 Feb 2022 06:24:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A33331A39CA; Thu, 24 Feb 2022 03:23:46 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 5996FB82555; Thu, 24 Feb 2022 11:23:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D0FCC340E9; Thu, 24 Feb 2022 11:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645701824; bh=PfnAcggG5LYjrhSuAQO1oKSGXquWacV/TfdmY6pLmzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D6zEhiIvRb4C0tZPv/NtHRY4UyjYBUGEcYfgbK7m1i3F7kJhLzsAOV2fHMVt8ia0w X+Ir2uO/FrMjmfBIvyE4KVlhmmcE95+rmsRIaOFyklhxoRvFWZvbNobYmpZE+uW/26 cs7EGrvom2dpU1/20BPvwP/uNFerJAzAiss/LqiM= Date: Thu, 24 Feb 2022 12:23:41 +0100 From: Greg KH To: Jiri Slaby Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] tty: serial: define UART_LCR_WLEN() macro Message-ID: References: <20220224095517.30872-1-jslaby@suse.cz> <20220224095558.30929-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 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 Thu, Feb 24, 2022 at 11:42:20AM +0100, Jiri Slaby wrote: > On 24. 02. 22, 11:10, Greg KH wrote: > > On Thu, Feb 24, 2022 at 10:55:54AM +0100, Jiri Slaby wrote: > > > Define a generic UART_LCR_WLEN() macro with a size argument. It can be > > > used to encode byte size into an LCR value. Therefore we can use it to > > > simplify the drivers using tty_get_char_size() in the next patches. > > > > > > Signed-off-by: Jiri Slaby > > > --- > > > include/uapi/linux/serial_reg.h | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h > > > index f51bc8f36813..c9d5ff6dd4c6 100644 > > > --- a/include/uapi/linux/serial_reg.h > > > +++ b/include/uapi/linux/serial_reg.h > > > @@ -111,6 +111,7 @@ > > > #define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */ > > > #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ > > > #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ > > > +#define UART_LCR_WLEN(x) ((x) - 5) > > > > I'm all for this, but why does it need to be in a uapi .h file? > > I'd love to put it somewhere else. But I didn't find an appropriate place. > Should I put it simply to > include/linux/serial_core.h > or > include/linux/serial.h This one would make sense. > ? Or create a new: > include/linux/serial_reg.h > to contain only this def? Nah, no need to create a whole .h file for a single macro :) thanks, greg k-h