Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp71115lqp; Wed, 20 Mar 2024 14:06:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqnW38FepFbNNPGuueigpON3NeaZjpJPFEutNkZdaO6C5uSLGV9jzEM2oGqpyofTj13f39PCfT9AlezFRqY+aT1070sFWxQ2OpbCOLVg== X-Google-Smtp-Source: AGHT+IEqi8OWD9AsscA3CDl5wRnzRABjOTpo9Thr4SSDOZB7q+Wvfk2XnnSY8GJGNpO9aKaO4bm8 X-Received: by 2002:a05:6870:4301:b0:21f:aad7:6888 with SMTP id w1-20020a056870430100b0021faad76888mr3366396oah.28.1710968794190; Wed, 20 Mar 2024 14:06:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710968794; cv=pass; d=google.com; s=arc-20160816; b=w7VrqynAaDUhwIxeCGdSJP3LLtzMvWmRAyiGLM17Ml68B3E5KAyj0ljcBUncihPhef 6x9Mnn0uJxdca530saEYwiQrcTQAkHaZ84kgwYVNiEPDfMPK3NxXWwTFvXT6o2lbAaXJ YnraVu0fNCfz8EVpHVsAD/PT/mg2A2PR5d+j3Doj+63xJNoNYT+pqTLv41+ni+Wt8OIM AT9kEL+dPdft1b94BRHj9Lw6+1jXH8akrTAlY+tDw8fziH6xdWDkx6Sba75qNjU6R3Rk 47jSW0tbELBGP4jMwbKj13DzrQmUBuulsBkEICm1zzrYU7odFvpSI4F2mZPO7Hb9v4+i 42dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=DaEIabmCpPYeVfCnqcTR0G+EdrgHTPTuHfPVasDyRdg=; fh=eG/NYzXTQvX/cNRpOji26sl1QJxOr68F8M9tjeGpJ7Q=; b=a3B3uoRHgslpIFeMvFWTcCeOzXwubpwNZfwKeUzRBHpPd0lB+5Dq3WL4XluSxqoOkf dAC4e/3XaABG4NVhG2eNk5Z63glVhpzALcwcndAUpnVJy7EYamC64mDe92OauSIV6TM3 AtzGDAQsPKKav4MJpB+uVtvNYkWe6rczn7ytaex17DIQdDI+P8rfcPZZ68XjqajLpvnt Va3Ob5CyAfgxKL3i+BECMrbtW4tVT5VZR1SzOc0YJY0Y549XjIJPrmEReCDwuZcs2WcU Q/5aLRMPJRwNdq3Vs4TqUDH7xDpVIkCkccNO9EDqZZWN6DGafS6nw+J/VLToKth6tBfp N+vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=kukgWbT+; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-109421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c29-20020a631c1d000000b005dc8b9af6bdsi12747831pgc.420.2024.03.20.14.06.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 14:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=kukgWbT+; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-109421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CA586B21EA0 for ; Wed, 20 Mar 2024 21:05:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC8F585947; Wed, 20 Mar 2024 21:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="kukgWbT+" Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E869EDB for ; Wed, 20 Mar 2024 21:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.134.164.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710968713; cv=none; b=kJkanMviy882z+a5lfwHLfgk1U2iaZ9TMM67o8LTP3ze9voY4ClQMyr4wk4NKCrqt22yvxO0SLmaX2YTm0kyxCDNfVOCQaTDdIDFaV/Cz2/8Zvnk0na8+O3HxMW36a2wZwlc18QPGww0t606OIN/u9gYjKtMqjUpSSdGY9OmjLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710968713; c=relaxed/simple; bh=Wyhez9FL5Ho+UmwZKIK3g6PGWtYemMdQMXRG7Iosh+s=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=Z03b5NWhQEbsgI2IoYGIeYoI+B/dhe3ixLiRy4D9sfU9BQhzF8zWA28zYj3CEW+Z7MpUnhKMrU6UwQooTaBvQRyyLtNEzPO9DV7/jahRGIGD4VyeiBPTNWTbBiBzO4F5uObrFgWu5CoAP7XGwGJe2GrSgR0Y0JyLAxW3TBBGfMA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr; spf=pass smtp.mailfrom=inria.fr; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b=kukgWbT+; arc=none smtp.client-ip=192.134.164.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=DaEIabmCpPYeVfCnqcTR0G+EdrgHTPTuHfPVasDyRdg=; b=kukgWbT+xGfq5/9uvX9N7ywdGDBTrWS+9Sf1iK73Xupv/1agITqwFMfd 6SxNUjC/9fCGjB+giKjfnqI5wuWvmBC9Pi6ZHXt50NZekstUyr6ifNu5S zgSLlzbQozMYFA4ocBzOD85Yk+8sT48SRaqbS2Wcj1yQLNfWNWuXIfvzT M=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.07,141,1708383600"; d="scan'208";a="82705121" Received: from 231.85.89.92.rev.sfr.net (HELO hadrien) ([92.89.85.231]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 22:05:04 +0100 Date: Wed, 20 Mar 2024 22:05:03 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Ayush Tiwari cc: Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, outreachy@lists.linux.dev Subject: Re: [PATCH v2] staging: rtl8712: Change type and name of local variable In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Thu, 21 Mar 2024, Ayush Tiwari wrote: > Change data type of local variable blnPending from u8 to bool and > renamed it to len_padding since it only assumes 0 or 1 values and > seems to add a padding based on wr_sz. This change also address the > checkpatch warning "Avoid Camelcase". > > Signed-off-by: Ayush Tiwari > --- > Changes in v2: Changed values of blnPending from 0/1 to false/true > and renamed blnPending to len_padding I don't think "len" is a good choice. That suggests length, which would be an integer. I suspect that bln is an abbreviation of boolean, and the while thing should go. But when you remove that, you get pending, not padding. julia > > drivers/staging/rtl8712/rtl8712_cmd.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c > index bb7db96ed821..f499bbbf5bf5 100644 > --- a/drivers/staging/rtl8712/rtl8712_cmd.c > +++ b/drivers/staging/rtl8712/rtl8712_cmd.c > @@ -284,7 +284,7 @@ int r8712_cmd_thread(void *context) > pcmd = cmd_hdl_filter(padapter, pcmd); > if (pcmd) { /* if pcmd != NULL, cmd will be handled by f/w */ > struct dvobj_priv *pdvobj = &padapter->dvobjpriv; > - u8 blnPending = 0; > + bool len_padding = false; > u16 cmdcode = pcmd->cmdcode; > > pcmdpriv->cmd_issued_cnt++; > @@ -294,12 +294,12 @@ int r8712_cmd_thread(void *context) > 0x0000ffff); > if (pdvobj->ishighspeed) { > if ((wr_sz % 512) == 0) > - blnPending = 1; > + len_padding = true; > } else { > if ((wr_sz % 64) == 0) > - blnPending = 1; > + len_padding = true; > } > - if (blnPending) { /* 32 bytes for TX Desc - 8 offset */ > + if (len_padding) { /* 32 bytes for TX Desc - 8 offset */ > pdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + > OFFSET_SZ + 8) << OFFSET_SHT) & > 0x00ff0000); > @@ -318,7 +318,7 @@ int r8712_cmd_thread(void *context) > (pcmdpriv->cmd_seq << 24)); > pcmdbuf += 2; /* 8 bytes alignment */ > memcpy((u8 *)pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); > - if (blnPending) > + if (len_padding) > wr_sz += 8; /* Append 8 bytes */ > r8712_write_mem(padapter, RTL8712_DMA_H2CCMD, wr_sz, > (u8 *)pdesc); > -- > 2.40.1 > > >