Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1032690pxb; Sun, 21 Feb 2021 08:59:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGAeToyWbGA9NmhYDwoLvp3DpG36zhZ3rfPckF5D41KrYHdPVZeEDThb8GY8PT7eypUCfP X-Received: by 2002:a17:906:7f95:: with SMTP id f21mr16114852ejr.312.1613926796983; Sun, 21 Feb 2021 08:59:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613926796; cv=none; d=google.com; s=arc-20160816; b=WN5LJPMyq50eLGHXJC07ilzOJ7m8OmRWOubUlZFhWrE3IIFxUOvkoyMW6AwGlqgR7p 7OexGuSHbnoHP1WsFiGBtZhmBYSjJ9kaEHCsTB6fLfG4HjjkrGYg5J8lXUal8i3idlJS NT1vaK8Lwxc/DRj5XXy47w6HNclCkl6q9cNBbZ1+NQ7JkqGUS0cljj923lfVz01GTEZe o4WE/T74hBocO1dgtvY0yI+G40ri5aBvZrTHNMcmZ3tVp1pL5oBfR71qyMxMmqZGckD+ yWP1dfVg5yg3VEGxdwnpkTMZuEiKUxjTBFY4VXeofJGNxJEnRlTkPMmOr2WEhI5JwRXF C2SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=B9cs96qNn/BeukNEOSHYwqQI5Bj2awUMTvneDxh78vM=; b=fxcD2FKA0wzHiyqL7sZA9N6cMOOJHRf1iPmyKpOhks4QxBU9GvrOLsyw6NGeM7kcXV I1Qpw3lfhiv4rLjn+OynLRYAltrzvPSd5kOpQV3NBGqSW7CUgiB4NfsxKa42Ad52VnNj 98h1ajdBR/BTrqf9D1kDuiWZD1YuxTm7c96ETjJ4VuHXRu6dDA9dXPVhMhwO95+32Mxt wvWmmSiPA9qLzLm1ZO99UkcgwBz4NJ3tovZpIQPqsCn3tfbjI0NCSvHauouf8BwXvGMZ h0dMKaZb9agvc6YXFs4FQiPq3tjpEW/jxckrtS/hjzhph1bE3ZTPBHdqYmd4r8u4mBOH nFLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RIJBhiNz; 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 26si8243561edw.488.2021.02.21.08.59.34; Sun, 21 Feb 2021 08:59:56 -0800 (PST) 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=RIJBhiNz; 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 S230147AbhBUQ6R (ORCPT + 99 others); Sun, 21 Feb 2021 11:58:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbhBUQ6J (ORCPT ); Sun, 21 Feb 2021 11:58:09 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67DCAC061574 for ; Sun, 21 Feb 2021 08:57:29 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id n10so8580720pgl.10 for ; Sun, 21 Feb 2021 08:57:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=B9cs96qNn/BeukNEOSHYwqQI5Bj2awUMTvneDxh78vM=; b=RIJBhiNzg9f0xT4DSNmlxIQgvreGmdXvKswmbFltyAnWrrdd6cGcdaJEqtP8TJk78Q o76k9/bbe8lldi2Wg3Zz+sLbp4AbAxCTInkhydh81RjkCVvKLA11CDWMAacSeCX6PcLQ mw1lC+p7tuZet02I15TF7yuEmv+AQKrFyaeqPltP6XKVO7w/GRssM9cC5GWdzTj0cFf4 922aGSnTYtzH2NsQRYGHCoC/IzKbaX11LN2Uq4LD0Gz3oJbv+vQUtfOATlqm7IAUsfHC yniZ/Yynt8Vl+/0ZAN+PVeVarHCrtpZg1VIidLtCN7dlAC5xu4YMZaeqP5PFFfzONiHU sSaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=B9cs96qNn/BeukNEOSHYwqQI5Bj2awUMTvneDxh78vM=; b=gfproRgBELN+cI/KkNU+15kkOJA8/oMSQpau4f/pvUb/Ayip7xGN+Pm0KhI3HemLc5 Y32A2mLfGOzPtSVdM/K9Ns7xwJkJBiuakO215qmMyEzKIXD46rWb6F6pL1gtft25zmky /pmCWjV5PYHwIRbe8k637XJlAlQDk66w+0tJdNQLB/QwhWn9Cox94miWPJ3SZVdVCqXE NG6RsaxvjHgJ5clk+gX4AKpWtu5X/oNg5Zzvid53OkL6enVHOVIAx3OLaKOa4e7Hv1w+ sgTI0XA8lUrsTAlKrC/MHXRxnHBPTYhR3ZwuGlt1IJDmuHiYC5CmquIbvSDbHVZmSit3 hWyg== X-Gm-Message-State: AOAM533iT1LTAZ0pH3oPRe3JwYk38luzhfrKlHpXUFPZfuAFLk98u1ti K90oGLQ0BMDw/cAvFDvhsjs= X-Received: by 2002:aa7:9d9b:0:b029:1ed:6c08:b93c with SMTP id f27-20020aa79d9b0000b02901ed6c08b93cmr6544126pfq.37.1613926648929; Sun, 21 Feb 2021 08:57:28 -0800 (PST) Received: from atulu-nitro ([2401:4900:3155:5620:9c4f:6a05:4186:f552]) by smtp.gmail.com with ESMTPSA id v16sm15310543pfu.76.2021.02.21.08.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 08:57:28 -0800 (PST) Date: Sun, 21 Feb 2021 22:27:21 +0530 From: Atul Gopinathan To: Greg KH Cc: tiwai@suse.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, gustavo@embeddedor.com Subject: Re: [PATCH 2/2] staging: rtl8192e: Change state information from u16 to u8 Message-ID: <20210221165721.GA10040@atulu-nitro> References: <20210220182154.9457-1-atulgopinathan@gmail.com> <20210220182154.9457-2-atulgopinathan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 21, 2021 at 02:08:26PM +0100, Greg KH wrote: > On Sat, Feb 20, 2021 at 11:51:55PM +0530, Atul Gopinathan wrote: > > The "CcxRmState" field in struct "rtllib_network" is defined > > as a u16 array of size 2 (so, 4 bytes in total). > > > > But the operations performed on this array throughout the code > > base (in rtl8192e/) are all in byte size 2 indicating that this > > array's type was defined wrongly. > > > > There are two situation were u16 type of this field could yield > > incorrect behaviour: > > > > 1. In rtllib_rx.c:1970: > > memcpy(network->CcxRmState, &info_element->data[4], 2); > > > > Here last 2 bytes (index 4 and 5) from the info_element->data[] > > array are meant to be copied into CcxRmState[]. > > Note that "data" array here is an array of type u8. > > > > 2. In function "update_network()" in staging/rtl8192e/rtllib_rx.c: > > memcpy(dst->CcxRmState, src->CcxRmState, 2); > > > > Here again, only 2 bytes are copied from the source state to > > destination state. > > > > There are no instances of "CcxRmState" requiring u16 data type. > > Here is the output of "grep -IRn 'CcxRmState'" on the rtl8192e/ > > directory for reviewing: > > > > rtllib_rx.c:1970: memcpy(network->CcxRmState, &info_element->data[4], 2); > > rtllib_rx.c:1971: if (network->CcxRmState[0] != 0) > > rtllib_rx.c:1975: network->MBssidMask = network->CcxRmState[1] & 0x07; > > rtllib_rx.c:2520: memcpy(dst->CcxRmState, src->CcxRmState, 2); > > rtllib.h:1108: u8 CcxRmState[2]; > > You just changed the logic in line 1975 in that file, right? Are you > _SURE_ that is ok? Do you have a device to test this on? I'm sorry, I didn't quite get you. By line 1975 in rtllib_rx.c, did you mean the following line?: network->MBssidMask = network->CcxRmState[1] & 0x07; network->CcxRmState is being fed with 2 bytes of u8 data, in line 1970 (as seen above). I believe my patch doesn't change the logic of an "&" operation being performed on it with 0x07, right? (I'm sorry if I'm missing something quite obvious, could kindly elaborate the change in logic that you are referring to?) Many thanks for the reviewing it during this time! Atul