Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1725616pxm; Thu, 24 Feb 2022 08:16:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuR+/51xCr4P4A7fJgWO+ByS65tAAP74ACsziXBXVq++TcDP3g8f5t/WWLsYc1LJQqTGzn X-Received: by 2002:a05:6a00:88a:b0:4df:f3a9:b246 with SMTP id q10-20020a056a00088a00b004dff3a9b246mr3324679pfj.83.1645719364612; Thu, 24 Feb 2022 08:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645719364; cv=none; d=google.com; s=arc-20160816; b=TeanepTvQ4quUDZjSZASn2csBBrINowKMKNH1eCzcWTrar2GJKN5gzMw/Yo2G5niPt YyhYRrRo0qsIBAw2cEMnkqkIIMiLotAhLwbm1hkOMLr6Oe3lNtGrmO6wzJ4UqUl7p6m7 XztBrhT/2heuO9r2UP1qUBOSzJ35FAdxmgo8gDvqNpc/XvC2WS3lo6IifUAUhL3AjNBH T8qVAsNbxF/I+i27zWlKKDz0iFhTLq15sn7FnDmla2nPma/A+Kzdk/qjbgqhBw/73qPh rOL5rzi8X1c4shQOIia9oMF7t/Bfhsla5VxkS5T5y3S4eIbF1h5/WnhgE46pW51IddtK IPOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=un0BuqJuVU1sQinMUaFtlLJAo+Lpb+W/ppoYZ+BlX8g=; b=meY1Lh/R8S5IKxzKqdVU7blRWuUkbDtTNgT2zxpmuFKlUEFGo+kSJR7r5vwth2p8eM lAwJjON4xDuRVdsw8UJLNIOEwDhRY2rTwyfOlOhF/z1GXsCpBSbEwYX5BmEYkwXtF23/ g+UdcPb6waRZZrMOsPfHX8ujM+kyYh+0ddVcYB6VB3RW4ElKk7OxxnIhe8PJXKGB6Bht yUmaskMfLDbfK4RWAhijG8CwEKL2vpNxuBqP1VWUOr4O0/cVhcZC4+FusZw0lJWe0UPg jxKatMnFlkbBzwWW4O/rFAcsdb0+++kFHEI9CDaxk5k8L32CI8RFR+Bo3Y3/guaAXlp/ ZbOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eUgnJqMN; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 130si2404145pgf.852.2022.02.24.08.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:16:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eUgnJqMN; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9ED121965FD; Thu, 24 Feb 2022 08:09:07 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233572AbiBXKmy (ORCPT + 99 others); Thu, 24 Feb 2022 05:42:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233562AbiBXKmw (ORCPT ); Thu, 24 Feb 2022 05:42:52 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C0FE16A5AA; Thu, 24 Feb 2022 02:42:22 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D288E1F37F; Thu, 24 Feb 2022 10:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1645699340; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=un0BuqJuVU1sQinMUaFtlLJAo+Lpb+W/ppoYZ+BlX8g=; b=eUgnJqMNMhrsuPaaKDC61tdG0ULuVATBZqrbXZVSyS94IBluKCFDdWdpZj7qpihfVrbpvK 3QtT0lMV2PeOadwn4RbM6SVBH2FI4/OYKmYpl2Ad2B4jJdJXNQcz8GWXFnRBxoIPVb9Di/ 69xH5Cc8FAE2KFKULBzA+bHCfp0KdHo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1645699340; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=un0BuqJuVU1sQinMUaFtlLJAo+Lpb+W/ppoYZ+BlX8g=; b=h0J/heLskiTMueR9Db4IvRC3vPtuEudjanAG3sfvRbDxd7P4sDhuhhjKhPSfAbsvcIXY25 PHdX08wy60TaT/AA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AFBE3132C1; Thu, 24 Feb 2022 10:42:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ypukKQxhF2LkQwAAMHmgww (envelope-from ); Thu, 24 Feb 2022 10:42:20 +0000 Message-ID: Date: Thu, 24 Feb 2022 11:42:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH 1/5] tty: serial: define UART_LCR_WLEN() macro Content-Language: en-US To: Greg KH Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220224095517.30872-1-jslaby@suse.cz> <20220224095558.30929-1-jslaby@suse.cz> From: Jiri Slaby In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 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 ? Or create a new: include/linux/serial_reg.h to contain only this def? thanks, -- js suse labs