From patchwork Mon May 20 13:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 164645 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp281370oca; Mon, 20 May 2019 06:54:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0yOAV3lN6BRKm5/pdNBsXYCjpLdSksbegSv++AE3zWqyQ9frAV5o9jCoCuUHSQUeWkRS6 X-Received: by 2002:a17:902:b58a:: with SMTP id a10mr46242940pls.83.1558360451622; Mon, 20 May 2019 06:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558360451; cv=none; d=google.com; s=arc-20160816; b=iviOLzSsTTX5cSVBxpsVGyk7dtxFWJWcVO7dcS4XlgHERIV78njZr+ngjePQC+9DvO pMv0TRvlv+zTopeUJuh7ayQRGEhdDWdk6R+ylspK413yzxKtDPtJ3RLyzcu3jU4iNdID 7v/0MjNGF6fYJdciYq6OispGhqL42cTDa4P15iNFPog+eIUSNV35jSctN3ilw0mc8FJ4 zLuD4ak3/o1hGnkKeaQqSb0KwoVoYRGc20zzclb18+H8Mr6v5xi5XADklML0bL3p+4fI H4W0qCcHzpH3RpyofE/EHhw09gAw3oCR0FabLbB/J6Cox1fnTNyNbWVesYmTpWRJLosU 0jvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R+Jpk+XthHVG0qFI+gAyJW+786CYrgpLqGw1dG639sc=; b=cHVNvmI+dACVzt4by250nD6pyWNlTErt5hXaRUmn2XgWooxOO/+2VGir4WjE2z8YJy K6nC5lYAZ8duP059zexTQPO/27WlE9+cOrW+pqElBL7hBYKrz/MYVcF1XsQTeRR2HFwW /xA//xMKc4zZJpqSVHBpIFeWkhJm125n1j/en1AVDMv/VP42k6erQeaPCcryiGFZ3sfR yWXpsjr4PhAQ1ul0ldYCz9sdNTaHqXBvuJ3yF5lAddknXFWcQ2PSRiVUM3tk7Svpm3S3 V3+fSqLwSbeVmGxppRbhcuoRxTbI2Ro9cmguN0aqT94O6Q12iMd+HtdMak+7BzNlSndi QfnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kUlwrKA6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay3si16687640plb.298.2019.05.20.06.54.11; Mon, 20 May 2019 06:54:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kUlwrKA6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390393AbfETNyK (ORCPT + 30 others); Mon, 20 May 2019 09:54:10 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:44800 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390239AbfETNyH (ORCPT ); Mon, 20 May 2019 09:54:07 -0400 Received: by mail-io1-f65.google.com with SMTP id f22so11033133iol.11 for ; Mon, 20 May 2019 06:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R+Jpk+XthHVG0qFI+gAyJW+786CYrgpLqGw1dG639sc=; b=kUlwrKA6Jg9T6clWLPJgeGUuaE9PZk89mqOd9MnvQdrLTvEBvGPK+iniaIoOUfuyIn QXoEpsQP3UrMYBN3jNm4JMiGQwiLHjLiNqoSubqfzcWS9J3nMo+Hq8ev5PXyG69DjXHV fcIxJ3nHRXB+WfFuhNsCaJL9aSPf0Y5+wQgDHH6x1REzX40cC8jtntFcuHXQBst6HXIF VDgfxkjCCr4/AKfVplJelzBYtiIe0RoYpR9mfu99YYKNYe5yJMuUIkEaZC6dft8Z3as9 urvLde/3DeJRDV2EZz67QkJ6chBk0YkJGVMrr0UIEB3gNKwPmIuzAloPUTyWXsOgD/2k U3qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R+Jpk+XthHVG0qFI+gAyJW+786CYrgpLqGw1dG639sc=; b=UUnUqOg0vhUu/cnZmaRtacYnaZhPfSTTURJa7F5fw55JVLS25cMaAu45z5w7EIs02x EPNBUoO4dp/HFU6aAvf0dJArMlep2Mta9cJI7lFu8Kweqef6ONbz2IHW2d61LU+p8wTH xSyemC45jQPufqfVzdI4dbT4eJfRKbGjiVzTmBm016uCO00W32MrnFkkR32abkQZN8HO o+qfEip5K1Z88/ArBFMLs9zf2alCaVYje3dhvRsFe2lbtwALIsmdiL4qtGQl2KXGosur A12L1HV2Nn8K1dQlLBmlZPMTvgE9c7ecJbwP4PJ+7jk4WStrd+c50b8EzQ4mvSqLKkj+ W6OA== X-Gm-Message-State: APjAAAWDfbvOPFojqS2qcRcgCEh3Yu/BxCwv3rkGHOMukFtOayvhWJr4 MhaYfyNOf94KQUDw++f3Eqlxfg== X-Received: by 2002:a5e:a71a:: with SMTP id b26mr12962200iod.95.1558360446575; Mon, 20 May 2019 06:54:06 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id n17sm6581185ioa.0.2019.05.20.06.54.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 06:54:06 -0700 (PDT) From: Alex Elder To: arnd@arndb.de, subashab@codeaurora.org, david.brown@linaro.org, agross@kernel.org, davem@davemloft.net Cc: bjorn.andersson@linaro.org, ilias.apalodimas@linaro.org, cpratapa@codeaurora.org, syadagir@codeaurora.org, evgreen@chromium.org, benchan@google.com, ejcaruso@google.com, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] net: qualcomm: rmnet: don't use C bit-fields in rmnet checksum trailer Date: Mon, 20 May 2019 08:53:51 -0500 Message-Id: <20190520135354.18628-6-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520135354.18628-1-elder@linaro.org> References: <20190520135354.18628-1-elder@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the use of C bit-fields in the rmnet_map_dl_csum_trailer structure with a single integral field, using field masks to encode or get at sub-field values. Signed-off-by: Alex Elder --- drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h | 6 ++++-- drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h index f3231c26badd..fb1cdb4ec41f 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h @@ -51,13 +51,15 @@ struct rmnet_map_header { struct rmnet_map_dl_csum_trailer { u8 reserved1; - u8 valid:1; - u8 reserved2:7; + u8 flags; /* RMNET_MAP_DL_* */ u16 csum_start_offset; u16 csum_length; __be16 csum_value; } __aligned(1); +#define RMNET_MAP_DL_CSUM_VALID_FMASK GENMASK(0, 0) +#define RMNET_MAP_DL_RESERVED_FMASK GENMASK(7, 1) + struct rmnet_map_ul_csum_header { __be16 csum_start_offset; __be16 csum_info; /* RMNET_MAP_UL_* */ diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c index 72b64114505a..a95111cdcd29 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c @@ -362,7 +362,7 @@ int rmnet_map_checksum_downlink_packet(struct sk_buff *skb, u16 len) csum_trailer = (struct rmnet_map_dl_csum_trailer *)(skb->data + len); - if (!csum_trailer->valid) { + if (!u8_get_bits(csum_trailer->flags, RMNET_MAP_DL_CSUM_VALID_FMASK)) { priv->stats.csum_valid_unset++; return -EINVAL; }