Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp517520pxb; Sat, 21 Aug 2021 09:21:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRyFk8cMl1aHn9oXFjTNLY9+xfEmnw88O922KYVm51rdzT60pitfefBctq8xDaojCK/t+V X-Received: by 2002:a05:6e02:c8b:: with SMTP id b11mr17297710ile.90.1629562864148; Sat, 21 Aug 2021 09:21:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629562864; cv=none; d=google.com; s=arc-20160816; b=bWyVx7D+88TRIPScpCzZIOBQL7Lz6gQD1gdnmdVlONFAHB10ZEGAhzVlYkT6YV5pc+ vCtRhmicfT/8/BO60Dnv0dssuAjMXOU/j+DnTQJ2FfHmHnDsgVNzHFUqg/u801eWITeC ipaw6sDczS5YCQRHNBV/6mpzelCrBgDHDrwwIgCg44iO/110NBHXXzhRhbssr96kk/ww OhUsVORIv3zpHXdsayY6v4H1Xq0kHweW7/9qafRghiRs7R6avpqrdkEQTdNJJBZrJ9SF /59ymiEjsvRFxHUKBb4rBkbiKaFCnMelUQTNNYIDqH9f0E8A3zF8FSUznuWmHpIAVWrA +5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WzRDVj8kh2b1JZfWSLoz1YXoIow59eKZovHPJUZMpVE=; b=R3kAikqPvOwiBnD/G0ZF1+zEQieOOPah2fHoSQQVrQdBRUncQ9/1w8090+oLV2z6uM AMTVrrN6KxiJuMuRbjqk9fiexT5RhKahJLWoSpG2UUgZf7nXk0ldgqC9YPxtxup3oN2B fd4I4ZsyTtnKAbc3ussDNGZy/iZO5cE7uvxTZKd761WSH928uuuBmnzdzD9HHcgZyf03 SDRmfMds96M/0qwZkJkYLGqasl2+GkrnYI++aqZxOkvEycBNQGH0IeQFO1GU/3Vf1AeC J0PLApsoYlfZCeGjFw0upaatjdwwGIK+5tpHf6uUOt//QpdWSpaPekDnr3drLhMmMz1n Y4ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QpGloXqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si8989603iog.8.2021.08.21.09.20.53; Sat, 21 Aug 2021 09:21:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QpGloXqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233296AbhHUQTb (ORCPT + 99 others); Sat, 21 Aug 2021 12:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbhHUQT0 (ORCPT ); Sat, 21 Aug 2021 12:19:26 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 397FEC061575 for ; Sat, 21 Aug 2021 09:18:47 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id m24-20020a17090a7f98b0290178b1a81700so9272771pjl.4 for ; Sat, 21 Aug 2021 09:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WzRDVj8kh2b1JZfWSLoz1YXoIow59eKZovHPJUZMpVE=; b=QpGloXqfJhiLxmJuJZD9iPEr6+Xkuzp3hLhDOIc0m1UsFeZYBhYqmX0Oegg8gP+Ccs zea4M6Az7ZKcB2LmZTb0VLTsIz4DZpKNzuptK7EzrycPfimZveOIsISO1bROJ3PlzBC3 DAkJeMFRtHLXHANnyjXJ+P138lasIEnuhL9upnzCo2ugtvakByO4aXF/520kmD18pL2v 7CxVINMxfkNS+tc4nKdEVKIVz3adyt1I3rRnSPrz6/Lht+D7LoB09M7cKdGlgCOwjiv6 iAwEW1uz66FmAs2SuCNt9RsdjuBTXmyIDTcUbjrE7B5E7y7CcOZr9QCuepxKF7iPv7KM yz0Q== 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=WzRDVj8kh2b1JZfWSLoz1YXoIow59eKZovHPJUZMpVE=; b=e2YTutetViqKtxizLKtdUr6CPm51EnlrvHjBfzOfCOBHCQ5Rjala6KsCKLegbJuzcQ LXXbm3r5H96tV23UYeNZywM7Hrgu/cmIyvZ/I0LoWhq5ShHkIQCzjOVUi8wINZk3+w2C o9DKTzSCfQRtWm5oAsgDWWAFKP48CDyIWSTCUWAnjG5ta9J9qcg89jusGWUo/4vtBI8m O5d7Hm3Vfk9zeC2BorRcA7WwzIwiRAXxqPUQ7v9VXDSuThKIwo51Xik8sXNsH9p1nkV4 Oc6BNwmcRHMs7qkvNiETTJ4yylVJ5lnVfrJiZOUxBb0DC+pQ3eglJgMD4FX+92+UKNjL VSxg== X-Gm-Message-State: AOAM533dUP7MWdneUjdPdYOOlQEhuQkbkzA8mgikGJa0u9VNJrS+hEt2 /jrKiotdh67D3PJJcO1d/3w= X-Received: by 2002:a17:90a:44:: with SMTP id 4mr10392350pjb.130.1629562726785; Sat, 21 Aug 2021 09:18:46 -0700 (PDT) Received: from xps.yggdrasil ([49.207.137.16]) by smtp.gmail.com with ESMTPSA id y27sm4227011pfa.29.2021.08.21.09.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Aug 2021 09:18:46 -0700 (PDT) From: Aakash Hemadri To: Greg Kroah-Hartman , Larry Finger , Phillip Potter Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/5] staging: r8188eu: restricted __be16 degrades to int Date: Sat, 21 Aug 2021 21:48:31 +0530 Message-Id: <464cbdb48b238d6b3aca435ef4f0bd05d48e01c6.1629562355.git.aakashhemadri123@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix sparse warning: > rtw_br_ext.c:839:70: warning: restricted __be16 degrades to integer > rtw_br_ext.c:845:70: warning: invalid assignment: |= > rtw_br_ext.c:845:70: left side has type unsigned short > rtw_br_ext.c:845:70: right side has type restricted __be16 dhcp->flags is be16, so change its type to that. Change htons() to cpu_to_be16() for clarity. Signed-off-by: Aakash Hemadri --- drivers/staging/r8188eu/core/rtw_br_ext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c index 26606093a3c3..83a4594a4214 100644 --- a/drivers/staging/r8188eu/core/rtw_br_ext.c +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c @@ -641,7 +641,7 @@ struct dhcpMessage { u_int8_t hops; u_int32_t xid; u_int16_t secs; - u_int16_t flags; + __be16 flags; u_int32_t ciaddr; u_int32_t yiaddr; u_int32_t siaddr; @@ -674,13 +674,13 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) u32 cookie = be32_to_cpu(dhcph->cookie); if (cookie == DHCP_MAGIC) { /* match magic word */ - if (!(dhcph->flags & htons(BROADCAST_FLAG))) { + if (!(dhcph->flags & cpu_to_be16(BROADCAST_FLAG))) { /* if not broadcast */ register int sum = 0; DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n"); /* or BROADCAST flag */ - dhcph->flags |= htons(BROADCAST_FLAG); + dhcph->flags |= cpu_to_be16(BROADCAST_FLAG); /* recalculate checksum */ sum = ~(udph->check) & 0xffff; sum += be16_to_cpu(dhcph->flags); -- 2.32.0