From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28194C61D97 for ; Thu, 23 Nov 2023 17:23:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345622AbjKWRXE (ORCPT ); Thu, 23 Nov 2023 12:23:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345674AbjKWRWv (ORCPT ); Thu, 23 Nov 2023 12:22:51 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8173D7D for ; Thu, 23 Nov 2023 09:22:56 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA634C43391; Thu, 23 Nov 2023 17:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700760176; bh=r3SxNvUBmnsHaNki4VDL+z3dKpTAlqM3g+IFMWeGKZw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sbXjB2BocU+UI6sPiH8wBmSuXF7P0SStfzI8JAEYAWKM3au6YJa39iCCw7SDXOwlY ljrhBwcyrIuHfmpzSQC7CBDkk1v0o4e+IsC+K6+9VPipuEqZB3SSqjqBdqS2J5s7ET Amz+cMRpcuOPsrttCpogfe/jwqPsnfWep011zalw= Date: Thu, 23 Nov 2023 14:16:46 +0000 From: Greg Kroah-Hartman To: Crescent CY Hsieh Cc: Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v5] tty: serial: Add RS422 flag to struct serial_rs485 Message-ID: <2023112346-immunity-clamshell-51c7@gregkh> References: <20231121095122.15948-1-crescentcy.hsieh@moxa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231121095122.15948-1-crescentcy.hsieh@moxa.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 21, 2023 at 05:51:22PM +0800, Crescent CY Hsieh wrote: > --- a/include/uapi/linux/serial.h > +++ b/include/uapi/linux/serial.h > @@ -11,6 +11,7 @@ > #ifndef _UAPI_LINUX_SERIAL_H > #define _UAPI_LINUX_SERIAL_H > > +#include > #include > > #include > @@ -137,17 +138,19 @@ struct serial_icounter_struct { > * * %SER_RS485_ADDRB - Enable RS485 addressing mode. > * * %SER_RS485_ADDR_RECV - Receive address filter (enables @addr_recv). Requires %SER_RS485_ADDRB. > * * %SER_RS485_ADDR_DEST - Destination address (enables @addr_dest). Requires %SER_RS485_ADDRB. > + * * %SER_RS485_MODE_RS422 - Enable RS422. Requires %SER_RS485_ENABLED. > */ > struct serial_rs485 { > __u32 flags; > -#define SER_RS485_ENABLED (1 << 0) > -#define SER_RS485_RTS_ON_SEND (1 << 1) > -#define SER_RS485_RTS_AFTER_SEND (1 << 2) > -#define SER_RS485_RX_DURING_TX (1 << 4) > -#define SER_RS485_TERMINATE_BUS (1 << 5) > -#define SER_RS485_ADDRB (1 << 6) > -#define SER_RS485_ADDR_RECV (1 << 7) > -#define SER_RS485_ADDR_DEST (1 << 8) > +#define SER_RS485_ENABLED _BITUL(0) > +#define SER_RS485_RTS_ON_SEND _BITUL(1) > +#define SER_RS485_RTS_AFTER_SEND _BITUL(2) > +#define SER_RS485_RX_DURING_TX _BITUL(3) > +#define SER_RS485_TERMINATE_BUS _BITUL(4) > +#define SER_RS485_ADDRB _BITUL(5) > +#define SER_RS485_ADDR_RECV _BITUL(6) > +#define SER_RS485_ADDR_DEST _BITUL(7) > +#define SER_RS485_MODE_RS422 _BITUL(8) You just broke userspace by changing the flags for existing values :( Please be much more careful in the future, do not do "cleanup" patches along with a "add a new feature" patch, as it would have been much more obvious as to what happened here if you had done that. thanks, greg k-h