Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp382045pxb; Thu, 21 Apr 2022 01:31:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM2gKeMsf1VbpmqrVhc/47p/z1SeLHNi9v+C+gbCgWTTYLlXpElnpKB6b8/FDg/MpXFCMF X-Received: by 2002:a05:6402:35cd:b0:423:daf3:f7a3 with SMTP id z13-20020a05640235cd00b00423daf3f7a3mr23784441edc.77.1650529884739; Thu, 21 Apr 2022 01:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650529884; cv=none; d=google.com; s=arc-20160816; b=NxVLgQBcSLieYTFhfuKbny5nul4pXBg4Mdjm3N+ODXiba+X8I1kfZuN6314NhsHHbb G2LHPsS1h99eangshU0tmAYI3Utv6lY04LyMWrD71yEx4imO0Bc1VrHOvWU7lXwB0lG8 HiO2/eCljFxjBIZi5+18m+SrHKmY/qRNV+wd67AYzDPPzssaeF5TO/2hpMibmXFT3q0N vCjwmwojZgaXEcEb2Frqhcj21YDjcSvezAgRhyypsandFfQGiJTgrTsZh+VXHmFvH2Ee WRJyQ/U+f0yuElQHD6j3TcBllOmU1ELOqyn2CwO58z/biiyuNzmKdZ4B/ES7tn+cULcB ZZHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ieRvSfzJc1NYOPDOUJRBMLhqaqAbjJNtd7H/SPVP6kA=; b=nKH6AxW9DANIN/mBhj4xfAbtfeXdaQXN1uyISm6hkWcTdFD8DivBZExopdluuku+qw xndBCoD0973OcOTI7iNI0Ngcufw1unmMSgSC4iLMnjRJENh2YTcXC2vh4yrul0YicYij OcAtexMaj/lv4q0hXgpWUMW6S+PJcPJAYijGbXzOVsUeMkttwugoWwvcDRshgmLyNa2v MOt8xskkPLzrGmgSWek2yD+mJH3PzXTwdbT+bdD+6uToPT7SKqsHX8wMwIm9PfVxxWP0 8yQz6GXKWXNjgbFwHlcm85nl2F0/tQNq7Uug0RmEsEM+pCYf2kRXCYyPbQBHMbEvCwoE UGyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=b36bfNTE; 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=siemens.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a17090682c200b006df76385e42si3508188ejy.738.2022.04.21.01.31.01; Thu, 21 Apr 2022 01:31:24 -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=@siemens.com header.s=fm1 header.b=b36bfNTE; 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=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377571AbiDTKSC (ORCPT + 99 others); Wed, 20 Apr 2022 06:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377530AbiDTKRz (ORCPT ); Wed, 20 Apr 2022 06:17:55 -0400 X-Greylist: delayed 63 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 20 Apr 2022 03:15:08 PDT Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0B0962E7 for ; Wed, 20 Apr 2022 03:15:06 -0700 (PDT) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 2022042010140142f38d9dfe652359bc for ; Wed, 20 Apr 2022 12:14:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=ieRvSfzJc1NYOPDOUJRBMLhqaqAbjJNtd7H/SPVP6kA=; b=b36bfNTEUoDGWRCe8XvZHCKF3BmqBw4CWRSROYtGu6t/wgOSNn2tuLlgoF8rCNwwPiGKhW ckWXh+DPSRN0N6BMX74XspxmbVWv8vtQ/uWqdywlsx3HyafsUza/MRaGeIoTq48xmvMjnPxG e70bXuT4Y51dttt0mJvUwIGW/Za9Y=; From: "D. Starke" To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH v3 3/3] tty: n_gsm: clean up implicit CR bit encoding in address field Date: Wed, 20 Apr 2022 03:13:46 -0700 Message-Id: <20220420101346.3315-3-daniel.starke@siemens.com> In-Reply-To: <20220420101346.3315-1-daniel.starke@siemens.com> References: <20220420101346.3315-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS 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 From: Daniel Starke n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.2.1.2 describes the encoding of the address field within the frame header. It is made up of the DLCI address, command/response (CR) bit and EA bit. Use the predefined CR value instead of a plain 2 in alignment to the remaining code and to make the encoding obvious. Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) All remarks have been incorporated. The commit title was changed from fix to clean up and the fix and backporting remarks have been removed. The remaining commit message body and the code changes remain untouched. This is version 3 of the patch because the second version was missing the change remarks. Link: https://lore.kernel.org/all/YlkRvMhDfwgNZptV@kroah.com/ diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 9bf5aa508f0e..1beb4b28cd18 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -751,7 +751,7 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) *--dp = msg->ctrl; if (gsm->initiator) - *--dp = (msg->addr << 2) | 2 | EA; + *--dp = (msg->addr << 2) | CR | EA; else *--dp = (msg->addr << 2) | EA; *fcs = gsm_fcs_add_block(INIT_FCS, dp , msg->data - dp); -- 2.25.1