From nobody Sat Feb 7 21:53:11 2026 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C3CE1A9B32 for ; Sat, 8 Feb 2025 08:16:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739002598; cv=none; b=SIi0FSXIy/JdE1BCvCZDN2UrdqtSkuaFL/gBKz7rX59jRssnsISs3QSpkBfjLq3CUvF10Nr/CNLWlvPvpaYFwuc0wy8v9+qYdWhUY0Tg74szH7MrVCp5fN2LoGTiL4iE0T85hpaIpy8HtzjDyDdW6u+ZsG8IuUjLtn3sGaI4jdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739002598; c=relaxed/simple; bh=hoK6kVOl90R9ZDB6MrJ7GFKqUrExq0t/KrPdz5I4iNM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=htCr5/S9fir/x30qlaH2r0fO4ZYGBY0ferWYZ3KEUhf2fZNzDJPjo+qW12a4dTFz4Wx+LhJBmRoNYxg52N8QarS8vNTY001E1bayvPIjc/rXR9ZthbN1xBGWq7SMg7qlp2NhedKeP5Chk4efLVSifgSOV3WmTlY7C8vLkphIYG8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k6sDGPx2; arc=none smtp.client-ip=209.85.167.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k6sDGPx2" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3ebb2d8dac4so1731084b6e.0 for ; Sat, 08 Feb 2025 00:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739002596; x=1739607396; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=034aISQuP2pj9Ag8Kzle6unMeO4J8N/HAuZ/EK4mAcY=; b=k6sDGPx2BTM6huhRTHY7rL/9pyVWw3wtHPS3p7mHlV2ZWM5iqimSUgopG12iX0n894 uRmXPmTsNEvfWtVfB5GnBWYmRLxkHHxhYWr2eswpDHUSKcx9pFWGJk+OVVhmtD1rsWBY 2lJ5ABZZqhJ7sQDVq55o5h3Mf/4rLvXasGNxiR5nOUFKPNZAuoDgZupLY5rGFjY249CK oNWugjp6uOaFXhA5rNpUfLfPVvLxxc9AMMgRqg4bsJove5NSOivCzaInJCPNmJDgkUHB U9KGcZCrnsli5QBvE3VXPMdqH88SnxuIBpf41ZWUgEFC7grGUqszkERTAb/PG1+H7iFU Qlnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739002596; x=1739607396; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=034aISQuP2pj9Ag8Kzle6unMeO4J8N/HAuZ/EK4mAcY=; b=BrVmKSGPa4JYD6z/JFSMkEPFB9PV/DhRzc4dwuSdpAhVFaW1f4KrgIvBBfWa13mGdN kZ9+nZ3uQawE2jxAL1SDxZN67qMg+L5trx04yrH2w+JnKQzeFd+lpkuc/nrGHOf5Xd18 qptAxtVvbZC2zSaTmAY8k/QDxAe7jbILiSbhyCK9mB8xMm3WNOP1aIN8mW97NEDHGYOo +t2DFca2JKwuymCjxJGeyDyQXZknnLlpM3McITofknVkIRA0ARcLnEh4647fz7d5Akvk i5S7E5PEX9Ai1XOSJwmvJxXtYVKw4gXSEryM9v4IVdWowHcrkbt6ZnyxSkZZFqCOHTue /MnQ== X-Forwarded-Encrypted: i=1; AJvYcCV0G9RA6rCKfbIerHJBASgXoPdHVgwCqJRBUbK1nkGtDvN438NQq/MV1PvnSNZhhZp5HktxEpsaW4xDhdc=@vger.kernel.org X-Gm-Message-State: AOJu0YxmYeSZyX1RCbkZeIREOBfFrQm4prVtTD+fC31haJ692eIZLSyj 1T1+v/8W1e1j4/pxxADNLNySpgpQCjNlYkRUt1Ue02cLZ0iE9Ng9 X-Gm-Gg: ASbGncvfgGebtvn6kAzl/KgOddaOWmPQco5AoFsIB2xdj34bmvUVhq+I2G8y1Ozb5pg XghvvnP4Btu9YFjyYI9rCmrjxLqRTPS0mNs9qD/gAP3leUtCYv1QJucpfyV9u99glBZ4SEOqWWB HCIHcmG4LfzfDfMZtyKnoSeJqJE2sO/nHAJ97sFkkBGK8UaRc3JIFrt8bqN4tfAmQy8wXaqFOc1 EyReUzR93dgRrJzv9LpCyMul/ywc7ytSdec9NXIbAlU2w22Np1HGH/3Lui2eMJVSUM40WnKoe98 w04c2apSqU3Rh/JBvTxguLbQwwyIdjfGd5ISWewznUoQ+zLepe5UCAeY0/xBuWLESKpHoH3awNO b X-Google-Smtp-Source: AGHT+IGkgJRWdGhjMT5V05IN9A23cZqkeUrU/gnxlMZkF2B/AXcpktdMTkpzlL+zdsxALdZu/NGRWw== X-Received: by 2002:a05:6808:23c3:b0:3db:1cd1:cadd with SMTP id 5614622812f47-3f3922bb3c5mr3941813b6e.18.1739002595998; Sat, 08 Feb 2025 00:16:35 -0800 (PST) Received: from DESKTOP-GL3U3CJ (162-207-94-177.lightspeed.irvnca.sbcglobal.net. [162.207.94.177]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f389fd5d48sm1185571b6e.42.2025.02.08.00.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 00:16:35 -0800 (PST) From: Ian To To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Ian To Subject: [PATCH 1/3] staging: rtl8723bs: format comments Date: Sat, 8 Feb 2025 00:15:54 -0800 Message-ID: X-Mailer: git-send-email 2.45.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6384; i=onlyian4981@gmail.com; h=from:subject:message-id; bh=hoK6kVOl90R9ZDB6MrJ7GFKqUrExq0t/KrPdz5I4iNM=; b=owEBbQKS/ZANAwAIAepTOeN7sYcPAcsmYgBnpxK4ChSQoc+I4fuI0bz7+uSSvavF50RYe1oHR BIpY5Ph1i6JAjMEAAEIAB0WIQRWEQChjkHIk0vVfn3qUznje7GHDwUCZ6cSuAAKCRDqUznje7GH D/pTEADAbvj1/lSpFJtJvhO6JgeQ+MTqqa2JVUeFEqjm+o7tP3mIvAjRypxk48ycEofEts/rAaE 2gLnC1G/yQfxE6ck/lZDimR/KZeU2zsJNtd1HVSZCTaJFVFZYo0mxKy5WyV0NzOcfOrJtTnJTDd gznyyhCxi2kF5O60V7YMYnalmNu1DyjJnKtiBk+li/kMlfWc+FNE8CP0azWZGfeSTtePeUqzVfs 0+1gT7ItnDaJki3XqwddBDUEQyvMPkebZKQ5EfT9w1y/ED7l7rLCtDqiCXjftPYiAW1oVclbHEu T9K81BfKqhFR1xDmhlRn9S6UddHiepQGk8vXvfsc8tN76YE3IZ3lSusPmZrw5eWadvEt75wsPwj dwPY3H6TZdR/YCiAoaYLImDuAnwmfp1QnhqX3CiRA3ek75GgGXuKqhHMrD41Rj2LrBZA9Hx9rQD J7zYTWhkf30nLo7Shp3QwCIO1qpCDZb7SfX8Bl5az1aoMvgGOaV+47FRpjrnutnxr3BPh8fDxXy 7WQseiFNmrqe5+0/rkr+xPcsBIj5pJD4QrB4ALk+9a5D4cxjN+dEjDyY+9i/ljDXD5BDyQudBGo E6OXMUY57D7zIoN3Kx/xiti24hYY8YgXMwpe5sL1UwzrzSCrkq6aXxU/ywxXjSJzPRUnUoL23Be VeBmTiVGY2DDb6w== X-Developer-Key: i=onlyian4981@gmail.com; a=openpgp; fpr=561100A18E41C8934BD57E7DEA5339E37BB1870F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some comments were not formatted correctly. Reported by checkpatch. Signed-off-by: Ian To --- drivers/staging/rtl8723bs/core/rtw_security.c | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/stagin= g/rtl8723bs/core/rtw_security.c index 1e9eff01b1aa..3281751436fd 100644 --- a/drivers/staging/rtl8723bs/core/rtw_security.c +++ b/drivers/staging/rtl8723bs/core/rtw_security.c @@ -30,10 +30,10 @@ const char *security_type_str(u8 value) /* WEP related =3D=3D=3D=3D=3D */ =20 /* - Need to consider the fragment situation -*/ + * Need to consider the fragment situation + */ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) -{ /* exclude ICV */ +{ /* exclude ICV */ union { __le32 f0; unsigned char f1[4]; @@ -342,23 +342,23 @@ static const unsigned short Sbox1[2][256] =3D { = /* Sbox for hash (can be in R } }; =20 - /* -********************************************************************** -* Routine: Phase 1 -- generate P1K, given TA, TK, IV32 -* -* Inputs: -* tk[] =3D temporal key [128 bits] -* ta[] =3D transmitter's MAC address [ 48 bits] -* iv32 =3D upper 32 bits of IV [ 32 bits] -* Output: -* p1k[] =3D Phase 1 key [ 80 bits] -* -* Note: -* This function only needs to be called every 2**16 packets, -* although in theory it could be called every packet. -* -********************************************************************** -*/ +/* + ********************************************************************** + * Routine: Phase 1 -- generate P1K, given TA, TK, IV32 + * + * Inputs: + * tk[] =3D temporal key [128 bits] + * ta[] =3D transmitter's MAC address [ 48 bits] + * iv32 =3D upper 32 bits of IV [ 32 bits] + * Output: + * p1k[] =3D Phase 1 key [ 80 bits] + * + * Note: + * This function only needs to be called every 2**16 packets, + * although in theory it could be called every packet. + * + ********************************************************************** + */ static void phase1(u16 *p1k, const u8 *tk, const u8 *ta, u32 iv32) { signed int i; @@ -374,39 +374,38 @@ static void phase1(u16 *p1k, const u8 *tk, const u8 *= ta, u32 iv32) /* size on the 80-bit block P1K[], using the 128-bit key TK[] */ for (i =3D 0; i < PHASE1_LOOP_CNT; i++) { /* Each add operation here is mod 2**16 */ - p1k[0] +=3D _S_(p1k[4] ^ TK16((i&1)+0)); - p1k[1] +=3D _S_(p1k[0] ^ TK16((i&1)+2)); - p1k[2] +=3D _S_(p1k[1] ^ TK16((i&1)+4)); - p1k[3] +=3D _S_(p1k[2] ^ TK16((i&1)+6)); - p1k[4] +=3D _S_(p1k[3] ^ TK16((i&1)+0)); + p1k[0] +=3D _S_(p1k[4] ^ TK16((i & 1) + 0)); + p1k[1] +=3D _S_(p1k[0] ^ TK16((i & 1) + 2)); + p1k[2] +=3D _S_(p1k[1] ^ TK16((i & 1) + 4)); + p1k[3] +=3D _S_(p1k[2] ^ TK16((i & 1) + 6)); + p1k[4] +=3D _S_(p1k[3] ^ TK16((i & 1) + 0)); p1k[4] +=3D (unsigned short)i; /* avoid "slide attacks" */ } } =20 - /* -********************************************************************** -* Routine: Phase 2 -- generate RC4KEY, given TK, P1K, IV16 -* -* Inputs: -* tk[] =3D Temporal key [128 bits] -* p1k[] =3D Phase 1 output key [ 80 bits] -* iv16 =3D low 16 bits of IV counter [ 16 bits] -* Output: -* rc4key[] =3D the key used to encrypt the packet [128 bits] -* -* Note: -* The value {TA, IV32, IV16} for Phase1/Phase2 must be unique -* across all packets using the same key TK value. Then, for a -* given value of TK[], this TKIP48 construction guarantees that -* the final RC4KEY value is unique across all packets. -* -* Suggested implementation optimization: if PPK[] is "overlaid" -* appropriately on RC4KEY[], there is no need for the final -* for loop below that copies the PPK[] result into RC4KEY[]. -* -********************************************************************** -*/ + ********************************************************************** + * Routine: Phase 2 -- generate RC4KEY, given TK, P1K, IV16 + * + * Inputs: + * tk[] =3D Temporal key [128 bits] + * p1k[] =3D Phase 1 output key [ 80 bits] + * iv16 =3D low 16 bits of IV counter [ 16 bits] + * Output: + * rc4key[] =3D the key used to encrypt the packet [128 bits] + * + * Note: + * The value {TA, IV32, IV16} for Phase1/Phase2 must be unique + * across all packets using the same key TK value. Then, for a + * given value of TK[], this TKIP48 construction guarantees that + * the final RC4KEY value is unique across all packets. + * + * Suggested implementation optimization: if PPK[] is "overlaid" + * appropriately on RC4KEY[], there is no need for the final + * for loop below that copies the PPK[] result into RC4KEY[]. + * + ********************************************************************** + */ static void phase2(u8 *rc4key, const u8 *tk, const u16 *p1k, u16 iv16) { signed int i; @@ -1456,7 +1455,7 @@ static void gf_mulx(u8 *pad) pad[AES_BLOCK_SIZE - 1] ^=3D 0x87; } =20 -/** +/* * omac1_aes_128_vector - One-Key CBC MAC (OMAC1) hash with AES-128 * @key: 128-bit key for the hash operation * @num_elem: Number of elements in the data vector @@ -1530,7 +1529,7 @@ static int omac1_aes_128_vector(u8 *key, size_t num_e= lem, return 0; } =20 -/** +/* * omac1_aes_128 - One-Key CBC MAC (OMAC1) hash with AES-128 (aka AES-CMAC) * @key: 128-bit key for the hash operation * @data: Data buffer for which a MAC is determined @@ -1541,7 +1540,8 @@ static int omac1_aes_128_vector(u8 *key, size_t num_e= lem, * This is a mode for using block cipher (AES in this case) for authentica= tion. * OMAC1 was standardized with the name CMAC by NIST in a Special Publicat= ion * (SP) 800-38B. - * modify for CONFIG_IEEE80211W */ + * modify for CONFIG_IEEE80211W + */ int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac) { return omac1_aes_128_vector(key, 1, &data, &data_len, mac); --=20 2.45.3 From nobody Sat Feb 7 21:53:11 2026 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A2B31AF0CB for ; Sat, 8 Feb 2025 08:16:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739002601; cv=none; b=FF94aYiZbDYEQcBq9WxS73j+WdKYJQXUwBzF27z7SDnrziOZCIuD+Ju0dyPV2E3tpMK/nI3m6KmhKSkSHqKGLzhHZaCTVujtkmJOPL3rhsoqdfJJTukzrJiUcgixKyXYp8mZStBFf+dnNAoBYoLz/YwhxrYniz4XE60KOGFuNX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739002601; c=relaxed/simple; bh=n9CAaUySQhQlxLGra9vISpqse25aiGAxjeymW89Rapk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rAU1ZBAPk3g5MYoQ3IMumdMIk2F1aqgSrzgXvqRbFTajZn1fqoUIXQ44sQj69PT/ewmthlSuaTDIGUJAgOldjs9n26XNJn7ih+JtOO+y/pHsm7Fo8rcMEP4DYKOzmm/+6GNY6dgywQylmkQiPSGteuo8aNu31gfz5g4Pw4BTv6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ADovv5vB; arc=none smtp.client-ip=209.85.161.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ADovv5vB" Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5fa2685c5c0so1118846eaf.3 for ; Sat, 08 Feb 2025 00:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739002598; x=1739607398; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zvH6zYruV3R+pLZlTPyxREbVhpSdp2y4jHvklQV4/fU=; b=ADovv5vBu/fH4kQ1Jp0sJaAGFJVjtYhUUZ4ynq0aVBCKoS4ntfx4McRiA05Tzl9V5C 0S24nfNCw6QxyhsEk9PIZaKfhGSN1L+1e7x6YJLbAKwOvgJTZSpuOJ3JhYolfn4kf7gU tkNQyf9EKc1kQMWWM2JoaK5Tmm5hJQ6LjuFrwCNQYeH+lwylg9DxGSKtO6mU/kOUu+Md A3bGq3y3QI6nYkFJZP6bJy1Bqbpq0M6Tx0JYSxG/L5d9AFIAFf+Z/dBouEgquf4JC2nU +POUdGSE638Ma5byb2e4dnk7zRvMhQwi+6WYttuz6kv/tUcSWzRtrAoRtgAZmJ/LRaaA ZEIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739002598; x=1739607398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zvH6zYruV3R+pLZlTPyxREbVhpSdp2y4jHvklQV4/fU=; b=hLglRKETORDbqmFhdscNUjnpA4UAiyhHTVQDTmvB2sYlKZ0UaOIQpj+nPnFbxJhhrg WyPZIK9HqyV5F4DV1G15ENenlViSomyrp8B9FxOp/Z2ygc1UtlvvzmNevoUcgnqBKUP+ 4LEuQM0oVU1poNfULaFPbRabugUkYNwypy5fu9RU+VsLmQN0shIbOzp3NQS8UPZql7EF R7C+b/WgJTs64495Zj4rNMK6oRvYvk5T7kIMCvxvev6dukfuiTi3Pl6bbSJ7lO23T4JE 4098w68qdrWs3QNc4knDlv/Wbru00GUJIjyk2BqsWh0BeZauqJAyT82aG1bRvvpBWY9h 07DQ== X-Forwarded-Encrypted: i=1; AJvYcCUcE6S7apvem4ZtSP56MQhNGQH0GQIMW3hDVMhC0JnMgb+LMMOjG3lN6NbAt8aVKXiv4L4DIJD+vmWnxEc=@vger.kernel.org X-Gm-Message-State: AOJu0YzvZAqCkHUK98y20mfptUsKi9yzVNPpl3RN0l5xnlOPaCaqLAwC 8/hZjQu5b8lVhzhGZO2sqEbIFW+2WalEtpAHwcqE6th3Yw/1OqVyzPtfl9TE X-Gm-Gg: ASbGncujaew/HN/tKpfT5Dgb1unfSCcVMAgr8Vqv6akjNVcKufAzZD200AiOeGLoT7m KY2qySed03jpTR00Ypbfaw0ypJvatBHXMkNmec2dE8QwlrchJZ5x1xzt9Hxf4p5jdHxDmPHh4F4 0TR8XfafA3QWaNw07BvDFuloL+BcVD5xb31YDkRNYEfNpc0wlYC9MfaIhQFdNBs7PuRJ6DHsjo1 Npqy53gOBBxbRhWr4v1ccOvxLTlOr4o76nHivhDqAPhtiS9oC9ZbdA+e4g5mFA+tkPKEbw99tnt 5Z4UCsrNtZ1e65LIejtJFKXyWJ9svUfyJsqcibHpc8raCWNxGErv/UNeCzpp3Y1ysjsmsO2VHdq s X-Google-Smtp-Source: AGHT+IF1nfHFesvyC7XVS1zMJMt0YH/gyC5fXeGTEbkUfEAmVkZsMWqJkAEzXs7mI9pMCsC+ffxm5w== X-Received: by 2002:a05:6820:612:b0:5fa:5c7d:db42 with SMTP id 006d021491bc7-5fc5e444891mr3899471eaf.0.1739002597870; Sat, 08 Feb 2025 00:16:37 -0800 (PST) Received: from DESKTOP-GL3U3CJ (162-207-94-177.lightspeed.irvnca.sbcglobal.net. [162.207.94.177]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5fc545bafe7sm1241055eaf.30.2025.02.08.00.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 00:16:37 -0800 (PST) From: Ian To To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Ian To Subject: [PATCH 2/3] stagin: rtl8723bs: fix spacing Date: Sat, 8 Feb 2025 00:15:55 -0800 Message-ID: <163cf9064401145bb38035aedd3b1d3fee43079a.1739001527.git.onlyian4981@gmail.com> X-Mailer: git-send-email 2.45.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=21806; i=onlyian4981@gmail.com; h=from:subject:message-id; bh=n9CAaUySQhQlxLGra9vISpqse25aiGAxjeymW89Rapk=; b=owEBbQKS/ZANAwAIAepTOeN7sYcPAcsmYgBnpxK40WElvT3F3+8JF3/93CjO9Czihc75i4liM wly9kaTQVeJAjMEAAEIAB0WIQRWEQChjkHIk0vVfn3qUznje7GHDwUCZ6cSuAAKCRDqUznje7GH D8kXD/433MZ2zTKpdYUMYhuVq/WGDTtFNtmHQoRRzDF7In2yCBdwvb3fEqPsvUy3ip/C+dO5y3L H6IB9YkZmw/odr++SNM//rMx/mbgnafadix3S8vP7TUfEfUvSPJNlalMuCHtQkWJw7xweRrPev0 ythjuEz6++DumuQURe+7teSaJBEI26FlQcOHaMF82sm/pnSWHwfhON9gvvwZuf14JrxNg148RXx xBdxlst9nCo5FhB8geIIjYPH8ygylCvQk6Ze2NAFc0d9GCqSaA+9+DRlOYXdwaHyc97cL9LlHAB kVoHlojg7phiM5YYGTg/KjdkpxtymUhqt2VZRV0eBlSv3+yeHMetAmsKXQK4EiN8jjchVurIQLe SNubU3hO0WTWVan8ZnWgfAQW9eXmbxTHZLOZt9dy0w4igOA0CldTHBaJA2KaffB9U8XpzZbJHc3 DyrQiyiVKPA03f5n6DeseZsJsayanXxVpg1J/E/KnbnI42j/Bu1gWl8RkX0PXbQxIClln5xXyzE XU+22XpF6Dma7kI2s2dwkScKrKRaafmjswu40ll60W/2CagV79ErzqQIAt3wZtSFZNmAKxl9yVh 8VbnG6kHlSYeerlhVQIofWo/zVlpLqJEqalqv1RRHmilqdvzE7tOg/qgB+ZVbFegIi1/6m6PpY3 gdszIJljIgH64ig== X-Developer-Key: i=onlyian4981@gmail.com; a=openpgp; fpr=561100A18E41C8934BD57E7DEA5339E37BB1870F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fixed spacing issues. Reported by checkpatch. Signed-off-by: Ian To --- drivers/staging/rtl8723bs/core/rtw_security.c | 166 +++++++++--------- 1 file changed, 82 insertions(+), 84 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/stagin= g/rtl8723bs/core/rtw_security.c index 3281751436fd..394f164b3bf4 100644 --- a/drivers/staging/rtl8723bs/core/rtw_security.c +++ b/drivers/staging/rtl8723bs/core/rtw_security.c @@ -61,14 +61,14 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmi= tframe) keylength =3D psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyK= eyIndex]; =20 for (curfragnum =3D 0; curfragnum < pattrib->nr_frags; curfragnum++) { - iv =3D pframe+pattrib->hdrlen; + iv =3D pframe + pattrib->hdrlen; memcpy(&wepkey[0], iv, 3); memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11Priv= acyKeyIndex].skey[0], keylength); - payload =3D pframe+pattrib->iv_len+pattrib->hdrlen; + payload =3D pframe + pattrib->iv_len + pattrib->hdrlen; =20 - if ((curfragnum+1) =3D=3D pattrib->nr_frags) { /* the last fragment */ + if ((curfragnum + 1) =3D=3D pattrib->nr_frags) { /* the last fragment */ =20 - length =3D pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattr= ib->icv_len; + length =3D pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len -= pattrib->icv_len; =20 crc.f0 =3D cpu_to_le32(~crc32_le(~0, payload, length)); =20 @@ -77,7 +77,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitf= rame) arc4_crypt(ctx, payload + length, crc.f1, 4); =20 } else { - length =3D pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib= ->icv_len; + length =3D pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - p= attrib->icv_len; crc.f0 =3D cpu_to_le32(~crc32_le(~0, payload, length)); arc4_setkey(ctx, wepkey, 3 + keylength); arc4_crypt(ctx, payload, payload, length); @@ -106,16 +106,16 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *p= recvframe) =20 /* start to decrypt recvframe */ if ((prxattrib->encrypt =3D=3D _WEP40_) || (prxattrib->encrypt =3D=3D _WE= P104_)) { - iv =3D pframe+prxattrib->hdrlen; + iv =3D pframe + prxattrib->hdrlen; /* keyindex =3D(iv[3]&0x3); */ keyindex =3D prxattrib->key_index; keylength =3D psecuritypriv->dot11DefKeylen[keyindex]; memcpy(&wepkey[0], iv, 3); /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11Pr= ivacyKeyIndex].skey[0], keylength); */ memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylen= gth); - length =3D ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen= -prxattrib->iv_len; + length =3D ((union recv_frame *)precvframe)->u.hdr.len - prxattrib->hdrl= en - prxattrib->iv_len; =20 - payload =3D pframe+prxattrib->iv_len+prxattrib->hdrlen; + payload =3D pframe + prxattrib->iv_len + prxattrib->hdrlen; =20 /* decrypt payload include icv */ arc4_setkey(ctx, wepkey, 3 + keylength); @@ -147,7 +147,7 @@ static void secmicputuint32(u8 *p, u32 val) long i; =20 for (i =3D 0; i < 4; i++) { - *p++ =3D (u8) (val & 0xff); + *p++ =3D (u8)(val & 0xff); val >>=3D 8; } } @@ -173,7 +173,7 @@ void rtw_secmicsetkey(struct mic_data *pmicdata, u8 *ke= y) void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b) { /* Append the byte to our word-sized buffer */ - pmicdata->M |=3D ((unsigned long)b) << (8*pmicdata->nBytesInM); + pmicdata->M |=3D ((unsigned long)b) << (8 * pmicdata->nBytesInM); pmicdata->nBytesInM++; /* Process the word if it is full. */ if (pmicdata->nBytesInM >=3D 4) { @@ -260,7 +260,7 @@ void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, = u32 data_len, u8 *mic_cod #define Mk16(hi, lo) ((lo) ^ (((u16)(hi)) << 8)) =20 /* select the Nth 16-bit word of the temporal key unsigned char array TK[]= */ -#define TK16(N) Mk16(tk[2*(N)+1], tk[2*(N)]) +#define TK16(N) Mk16(tk[2 * (N) + 1], tk[2 * (N)]) =20 /* S-box lookup: 16 bits --> 16 bits */ #define _S_(v16) (Sbox1[0][Lo8(v16)] ^ Sbox1[1][Hi8(v16)]) @@ -415,7 +415,7 @@ static void phase2(u8 *rc4key, const u8 *tk, const u16 = *p1k, u16 iv16) for (i =3D 0; i < 5; i++) PPK[i] =3D p1k[i]; /* first, copy P1K to PPK */ =20 - PPK[5] =3D p1k[4]+iv16; /* next, add in IV16 */ + PPK[5] =3D p1k[4] + iv16; /* next, add in IV16 */ =20 /* Bijective non-linear mixing of the 96 bits of PPK[0..5] */ PPK[0] +=3D _S_(PPK[5] ^ TK16(0)); /* Mix key in each "round" */ @@ -443,15 +443,13 @@ static void phase2(u8 *rc4key, const u8 *tk, const u1= 6 *p1k, u16 iv16) rc4key[2] =3D Lo8(iv16); rc4key[3] =3D Lo8((PPK[5] ^ TK16(0)) >> 1); =20 - /* Copy 96 bits of PPK[0..5] to RC4KEY[4..15] (little-endian) */ for (i =3D 0; i < 6; i++) { - rc4key[4+2*i] =3D Lo8(PPK[i]); - rc4key[5+2*i] =3D Hi8(PPK[i]); + rc4key[4 + 2 * i] =3D Lo8(PPK[i]); + rc4key[5 + 2 * i] =3D Hi8(PPK[i]); } } =20 - /* The hlen isn't include the IV */ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) { /* exclude ICV */ @@ -490,20 +488,20 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *px= mitframe) prwskey =3D pattrib->dot118021x_UncstKey.skey; =20 for (curfragnum =3D 0; curfragnum < pattrib->nr_frags; curfragnum++) { - iv =3D pframe+pattrib->hdrlen; - payload =3D pframe+pattrib->iv_len+pattrib->hdrlen; + iv =3D pframe + pattrib->hdrlen; + payload =3D pframe + pattrib->iv_len + pattrib->hdrlen; =20 GET_TKIP_PN(iv, dot11txpn); =20 pnl =3D (u16)(dot11txpn.val); - pnh =3D (u32)(dot11txpn.val>>16); + pnh =3D (u32)(dot11txpn.val >> 16); =20 phase1((u16 *)&ttkey[0], prwskey, &pattrib->ta[0], pnh); =20 phase2(&rc4key[0], prwskey, (u16 *)&ttkey[0], pnl); =20 - if ((curfragnum+1) =3D=3D pattrib->nr_frags) { /* 4 the last fragment = */ - length =3D pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-patt= rib->icv_len; + if ((curfragnum + 1) =3D=3D pattrib->nr_frags) { /* 4 the last fragmen= t */ + length =3D pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len = - pattrib->icv_len; crc.f0 =3D cpu_to_le32(~crc32_le(~0, payload, length)); =20 arc4_setkey(ctx, rc4key, 16); @@ -511,7 +509,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmi= tframe) arc4_crypt(ctx, payload + length, crc.f1, 4); =20 } else { - length =3D pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattri= b->icv_len; + length =3D pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - = pattrib->icv_len; crc.f0 =3D cpu_to_le32(~crc32_le(~0, payload, length)); =20 arc4_setkey(ctx, rc4key, 16); @@ -599,14 +597,14 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *pr= ecvframe) prwskey =3D &stainfo->dot118021x_UncstKey.skey[0]; } =20 - iv =3D pframe+prxattrib->hdrlen; - payload =3D pframe+prxattrib->iv_len+prxattrib->hdrlen; - length =3D ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrle= n-prxattrib->iv_len; + iv =3D pframe + prxattrib->hdrlen; + payload =3D pframe + prxattrib->iv_len + prxattrib->hdrlen; + length =3D ((union recv_frame *)precvframe)->u.hdr.len - prxattrib->hdr= len - prxattrib->iv_len; =20 GET_TKIP_PN(iv, dot11txpn); =20 pnl =3D (u16)(dot11txpn.val); - pnh =3D (u32)(dot11txpn.val>>16); + pnh =3D (u32)(dot11txpn.val >> 16); =20 phase1((u16 *)&ttkey[0], prwskey, &prxattrib->ta[0], pnh); phase2(&rc4key[0], prwskey, (unsigned short *)&ttkey[0], pnl); @@ -721,8 +719,8 @@ static void construct_mic_iv(u8 *mic_iv, for (i =3D 8; i < 14; i++) mic_iv[i] =3D pn_vector[13 - i]; /* mic_iv[8:13] =3D PN[5:0] */ #endif - mic_iv[14] =3D (unsigned char) (payload_length / 256); - mic_iv[15] =3D (unsigned char) (payload_length % 256); + mic_iv[14] =3D (unsigned char)(payload_length / 256); + mic_iv[15] =3D (unsigned char)(payload_length % 256); } =20 /************************************************/ @@ -787,7 +785,7 @@ static void construct_mic_header2(u8 *mic_header2, =20 if (!qc_exists && a4_exists) { for (i =3D 0; i < 6; i++) - mic_header2[8+i] =3D mpdu[24+i]; /* A4 */ + mic_header2[8 + i] =3D mpdu[24 + i]; /* A4 */ } =20 if (qc_exists && !a4_exists) { @@ -797,7 +795,7 @@ static void construct_mic_header2(u8 *mic_header2, =20 if (qc_exists && a4_exists) { for (i =3D 0; i < 6; i++) - mic_header2[8+i] =3D mpdu[24+i]; /* A4 */ + mic_header2[8 + i] =3D mpdu[24 + i]; /* A4 */ =20 mic_header2[14] =3D mpdu[30] & 0x0f; mic_header2[15] =3D mpdu[31] & 0x00; @@ -844,8 +842,8 @@ static void construct_ctr_preload(u8 *ctr_preload, for (i =3D 8; i < 14; i++) ctr_preload[i] =3D pn_vector[13 - i]; /* ctr_preload[8:13] = =3D PN[5:0] */ #endif - ctr_preload[14] =3D (unsigned char) (c / 256); /* Ctr */ - ctr_preload[15] =3D (unsigned char) (c % 256); + ctr_preload[14] =3D (unsigned char)(c / 256); /* Ctr */ + ctr_preload[15] =3D (unsigned char)(c % 256); } =20 /************************************/ @@ -861,7 +859,7 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) } =20 static signed int aes_cipher(u8 *key, uint hdrlen, - u8 *pframe, uint plen) + u8 *pframe, uint plen) { uint qc_exists, a4_exists, i, j, payload_remainder, num_blocks, payload_index; @@ -880,7 +878,7 @@ static signed int aes_cipher(u8 *key, uint hdrlen, uint frtype =3D GetFrameType(pframe); uint frsubtype =3D GetFrameSubType(pframe); =20 - frsubtype =3D frsubtype>>4; + frsubtype =3D frsubtype >> 4; =20 memset((void *)mic_iv, 0, 16); memset((void *)mic_header1, 0, 16); @@ -895,9 +893,9 @@ static signed int aes_cipher(u8 *key, uint hdrlen, else a4_exists =3D 1; =20 - if (((frtype|frsubtype) =3D=3D WIFI_DATA_CFACK) || - ((frtype|frsubtype) =3D=3D WIFI_DATA_CFPOLL) || - ((frtype|frsubtype) =3D=3D WIFI_DATA_CFACKPOLL)) { + if (((frtype | frsubtype) =3D=3D WIFI_DATA_CFACK) || + ((frtype | frsubtype) =3D=3D WIFI_DATA_CFPOLL) || + ((frtype | frsubtype) =3D=3D WIFI_DATA_CFACKPOLL)) { qc_exists =3D 1; if (hdrlen !=3D WLAN_HDR_A3_QOS_LEN) hdrlen +=3D 2; @@ -916,11 +914,11 @@ static signed int aes_cipher(u8 *key, uint hdrlen, } =20 pn_vector[0] =3D pframe[hdrlen]; - pn_vector[1] =3D pframe[hdrlen+1]; - pn_vector[2] =3D pframe[hdrlen+4]; - pn_vector[3] =3D pframe[hdrlen+5]; - pn_vector[4] =3D pframe[hdrlen+6]; - pn_vector[5] =3D pframe[hdrlen+7]; + pn_vector[1] =3D pframe[hdrlen + 1]; + pn_vector[2] =3D pframe[hdrlen + 4]; + pn_vector[3] =3D pframe[hdrlen + 5]; + pn_vector[4] =3D pframe[hdrlen + 6]; + pn_vector[5] =3D pframe[hdrlen + 7]; =20 construct_mic_iv(mic_iv, qc_exists, @@ -976,12 +974,12 @@ static signed int aes_cipher(u8 *key, uint hdrlen, =20 /* Insert MIC into payload */ for (j =3D 0; j < 8; j++) - pframe[payload_index+j] =3D mic[j]; + pframe[payload_index + j] =3D mic[j]; =20 payload_index =3D hdrlen + 8; for (i =3D 0; i < num_blocks; i++) { construct_ctr_preload(ctr_preload, a4_exists, qc_exists, pframe, /* mess= age, */ - pn_vector, i+1, frtype); + pn_vector, i + 1, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, &pframe[payload_index], chain_buffer); @@ -993,13 +991,13 @@ static signed int aes_cipher(u8 *key, uint hdrlen, /* If there is a short final block, then pad it,*/ /* encrypt it and copy the unpadded part back */ construct_ctr_preload(ctr_preload, a4_exists, qc_exists, pframe, /* mess= age, */ - pn_vector, num_blocks+1, frtype); + pn_vector, num_blocks + 1, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ =20 for (j =3D 0; j < 16; j++) padded_buffer[j] =3D 0x00; for (j =3D 0; j < payload_remainder; j++) - padded_buffer[j] =3D pframe[payload_index+j]; + padded_buffer[j] =3D pframe[payload_index + j]; =20 aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); @@ -1015,7 +1013,7 @@ static signed int aes_cipher(u8 *key, uint hdrlen, for (j =3D 0; j < 16; j++) padded_buffer[j] =3D 0x00; for (j =3D 0; j < 8; j++) - padded_buffer[j] =3D pframe[j+hdrlen+8+plen]; + padded_buffer[j] =3D pframe[j + hdrlen + 8 + plen]; =20 aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); @@ -1055,12 +1053,12 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *p= xmitframe) prwskey =3D pattrib->dot118021x_UncstKey.skey; =20 for (curfragnum =3D 0; curfragnum < pattrib->nr_frags; curfragnum++) { - if ((curfragnum+1) =3D=3D pattrib->nr_frags) { /* 4 the last fragment */ - length =3D pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattr= ib->icv_len; + if ((curfragnum + 1) =3D=3D pattrib->nr_frags) { /* 4 the last fragment= */ + length =3D pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len -= pattrib->icv_len; =20 aes_cipher(prwskey, pattrib->hdrlen, pframe, length); } else { - length =3D pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib= ->icv_len; + length =3D pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - p= attrib->icv_len; =20 aes_cipher(prwskey, pattrib->hdrlen, pframe, length); pframe +=3D pxmitpriv->frag_len; @@ -1072,7 +1070,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxm= itframe) } =20 static signed int aes_decipher(u8 *key, uint hdrlen, - u8 *pframe, uint plen) + u8 *pframe, uint plen) { static u8 message[MAX_MSG_SIZE]; uint qc_exists, a4_exists, i, j, payload_remainder, @@ -1093,7 +1091,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen, uint frtype =3D GetFrameType(pframe); uint frsubtype =3D GetFrameSubType(pframe); =20 - frsubtype =3D frsubtype>>4; + frsubtype =3D frsubtype >> 4; =20 memset((void *)mic_iv, 0, 16); memset((void *)mic_header1, 0, 16); @@ -1105,9 +1103,9 @@ static signed int aes_decipher(u8 *key, uint hdrlen, =20 /* start to decrypt the payload */ =20 - num_blocks =3D (plen-8) / 16; /* plen including LLC, payload_length and m= ic) */ + num_blocks =3D (plen - 8) / 16; /* plen including LLC, payload_length and= mic) */ =20 - payload_remainder =3D (plen-8) % 16; + payload_remainder =3D (plen - 8) % 16; =20 pn_vector[0] =3D pframe[hdrlen]; pn_vector[1] =3D pframe[hdrlen + 1]; @@ -1121,9 +1119,9 @@ static signed int aes_decipher(u8 *key, uint hdrlen, else a4_exists =3D 1; =20 - if (((frtype|frsubtype) =3D=3D WIFI_DATA_CFACK) || - ((frtype|frsubtype) =3D=3D WIFI_DATA_CFPOLL) || - ((frtype|frsubtype) =3D=3D WIFI_DATA_CFACKPOLL)) { + if (((frtype | frsubtype) =3D=3D WIFI_DATA_CFACK) || + ((frtype | frsubtype) =3D=3D WIFI_DATA_CFPOLL) || + ((frtype | frsubtype) =3D=3D WIFI_DATA_CFACKPOLL)) { qc_exists =3D 1; if (hdrlen !=3D WLAN_HDR_A3_QOS_LEN) hdrlen +=3D 2; @@ -1162,13 +1160,13 @@ static signed int aes_decipher(u8 *key, uint hdrlen, /* If there is a short final block, then pad it,*/ /* encrypt it and copy the unpadded part back */ construct_ctr_preload(ctr_preload, a4_exists, qc_exists, pframe, pn_vect= or, - num_blocks+1, frtype); + num_blocks + 1, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ =20 for (j =3D 0; j < 16; j++) padded_buffer[j] =3D 0x00; for (j =3D 0; j < payload_remainder; j++) - padded_buffer[j] =3D pframe[payload_index+j]; + padded_buffer[j] =3D pframe[payload_index + j]; =20 aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); @@ -1177,25 +1175,25 @@ static signed int aes_decipher(u8 *key, uint hdrlen, } =20 /* start to calculate the mic */ - if ((hdrlen + plen+8) <=3D MAX_MSG_SIZE) - memcpy((void *)message, pframe, (hdrlen + plen+8)); /* 8 is for ext iv l= en */ + if ((hdrlen + plen + 8) <=3D MAX_MSG_SIZE) + memcpy((void *)message, pframe, (hdrlen + plen + 8)); /* 8 is for ext iv= len */ =20 pn_vector[0] =3D pframe[hdrlen]; - pn_vector[1] =3D pframe[hdrlen+1]; - pn_vector[2] =3D pframe[hdrlen+4]; - pn_vector[3] =3D pframe[hdrlen+5]; - pn_vector[4] =3D pframe[hdrlen+6]; - pn_vector[5] =3D pframe[hdrlen+7]; + pn_vector[1] =3D pframe[hdrlen + 1]; + pn_vector[2] =3D pframe[hdrlen + 4]; + pn_vector[3] =3D pframe[hdrlen + 5]; + pn_vector[4] =3D pframe[hdrlen + 6]; + pn_vector[5] =3D pframe[hdrlen + 7]; =20 - construct_mic_iv(mic_iv, qc_exists, a4_exists, message, plen-8, pn_vector= , frtype); + construct_mic_iv(mic_iv, qc_exists, a4_exists, message, plen - 8, pn_vect= or, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ =20 construct_mic_header1(mic_header1, hdrlen, message, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ construct_mic_header2(mic_header2, message, a4_exists, qc_exists); =20 - payload_remainder =3D (plen-8) % 16; - num_blocks =3D (plen-8) / 16; + payload_remainder =3D (plen - 8) % 16; + num_blocks =3D (plen - 8) / 16; =20 /* Find start of payload */ payload_index =3D (hdrlen + 8); @@ -1230,11 +1228,11 @@ static signed int aes_decipher(u8 *key, uint hdrlen, =20 /* Insert MIC into payload */ for (j =3D 0; j < 8; j++) - message[payload_index+j] =3D mic[j]; + message[payload_index + j] =3D mic[j]; =20 payload_index =3D hdrlen + 8; for (i =3D 0; i < num_blocks; i++) { - construct_ctr_preload(ctr_preload, a4_exists, qc_exists, message, pn_vec= tor, i+1, + construct_ctr_preload(ctr_preload, a4_exists, qc_exists, message, pn_vec= tor, i + 1, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ aes128k128d(key, ctr_preload, aes_out); @@ -1247,13 +1245,13 @@ static signed int aes_decipher(u8 *key, uint hdrlen, /* If there is a short final block, then pad it,*/ /* encrypt it and copy the unpadded part back */ construct_ctr_preload(ctr_preload, a4_exists, qc_exists, message, pn_vec= tor, - num_blocks+1, frtype); + num_blocks + 1, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ =20 for (j =3D 0; j < 16; j++) padded_buffer[j] =3D 0x00; for (j =3D 0; j < payload_remainder; j++) - padded_buffer[j] =3D message[payload_index+j]; + padded_buffer[j] =3D message[payload_index + j]; =20 aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); @@ -1268,7 +1266,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen, for (j =3D 0; j < 16; j++) padded_buffer[j] =3D 0x00; for (j =3D 0; j < 8; j++) - padded_buffer[j] =3D message[j+hdrlen+8+plen-8]; + padded_buffer[j] =3D message[j + hdrlen + 8 + plen - 8]; =20 aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); @@ -1355,7 +1353,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *pre= cvframe) prwskey =3D &stainfo->dot118021x_UncstKey.skey[0]; } =20 - length =3D ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrle= n-prxattrib->iv_len; + length =3D ((union recv_frame *)precvframe)->u.hdr.len - prxattrib->hdr= len - prxattrib->iv_len; =20 res =3D aes_decipher(prwskey, prxattrib->hdrlen, pframe, length); =20 @@ -1380,7 +1378,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *prec= vframe) __le16 le_tmp; __le64 le_tmp64; =20 - ori_len =3D pattrib->pkt_len-WLAN_HDR_A3_LEN+BIP_AAD_SIZE; + ori_len =3D pattrib->pkt_len - WLAN_HDR_A3_LEN + BIP_AAD_SIZE; BIP_AAD =3D rtw_zmalloc(ori_len); =20 if (!BIP_AAD) @@ -1391,28 +1389,28 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *pr= ecvframe) /* mapping to wlan header */ pwlanhdr =3D (struct ieee80211_hdr *)pframe; /* save the frame body + MME */ - memcpy(BIP_AAD+BIP_AAD_SIZE, pframe+WLAN_HDR_A3_LEN, pattrib->pkt_len-WLA= N_HDR_A3_LEN); + memcpy(BIP_AAD + BIP_AAD_SIZE, pframe + WLAN_HDR_A3_LEN, pattrib->pkt_len= - WLAN_HDR_A3_LEN); /* find MME IE pointer */ - p =3D rtw_get_ie(BIP_AAD+BIP_AAD_SIZE, WLAN_EID_MMIE, &len, pattrib->pkt_= len-WLAN_HDR_A3_LEN); + p =3D rtw_get_ie(BIP_AAD + BIP_AAD_SIZE, WLAN_EID_MMIE, &len, pattrib->pk= t_len - WLAN_HDR_A3_LEN); /* Baron */ if (p) { u16 keyid =3D 0; u64 temp_ipn =3D 0; /* save packet number */ - memcpy(&le_tmp64, p+4, 6); + memcpy(&le_tmp64, p + 4, 6); temp_ipn =3D le64_to_cpu(le_tmp64); /* BIP packet number should bigger than previous BIP packet */ if (temp_ipn <=3D pmlmeext->mgnt_80211w_IPN_rx) goto BIP_exit; =20 /* copy key index */ - memcpy(&le_tmp, p+2, 2); + memcpy(&le_tmp, p + 2, 2); keyid =3D le16_to_cpu(le_tmp); if (keyid !=3D padapter->securitypriv.dot11wBIPKeyid) goto BIP_exit; =20 /* clear the MIC field of MME to zero */ - memset(p+2+len-8, 0, 8); + memset(p + 2 + len - 8, 0, 8); =20 /* conscruct AAD, copy frame control field */ memcpy(BIP_AAD, &pwlanhdr->frame_control, 2); @@ -1420,14 +1418,14 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *pr= ecvframe) ClearPwrMgt(BIP_AAD); ClearMData(BIP_AAD); /* conscruct AAD, copy address 1 to address 3 */ - memcpy(BIP_AAD+2, pwlanhdr->addr1, 18); + memcpy(BIP_AAD + 2, pwlanhdr->addr1, 18); =20 if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->security= priv.dot11wBIPKeyid].skey , BIP_AAD, ori_len, mic)) goto BIP_exit; =20 /* MIC field should be last 8 bytes of packet (packet without FCS) */ - if (!memcmp(mic, pframe+pattrib->pkt_len-8, 8)) { + if (!memcmp(mic, pframe + pattrib->pkt_len - 8, 8)) { pmlmeext->mgnt_80211w_IPN_rx =3D temp_ipn; res =3D _SUCCESS; } else { @@ -1573,7 +1571,7 @@ u8 rtw_handle_tkip_countermeasure(struct adapter *ada= pter, const char *caller) if (securitypriv->btkip_countermeasure) { unsigned long passing_ms =3D jiffies_to_msecs(jiffies - securitypriv->bt= kip_countermeasure_time); =20 - if (passing_ms > 60*1000) { + if (passing_ms > 60 * 1000) { netdev_dbg(adapter->pnetdev, "%s(%s) countermeasure time:%lus > 60s\n", caller, ADPT_ARG(adapter), --=20 2.45.3 From nobody Sat Feb 7 21:53:11 2026 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 918F71A314C for ; Sat, 8 Feb 2025 08:16:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739002603; cv=none; b=hrI00yGpQgQR1JQr93EbhqFG7RYHklmU6xyDqSGvGRB2WOKXudGb6QhJH2kvkm13B8bd3a5RaXmHi/td3vVypIuXySySXe8eqWbeUwKu6XcKiBrUsdpT7vdRbHiJzp9JfbDjlPsLxPP+eERaTwFNnn5DZ6yu6xNVBDq1xs0S5h8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739002603; c=relaxed/simple; bh=6SyAjLBH1UP/Lg4IawurSIwuUj6Az2WGwaEx0NGxizE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gEQAsBpVGr1fTIYskFrbbXbdpKTYCQq2YphrTGNpBzvNNc0eE2KHs3sBZON9BUcybcUjTlxYtOp2+Awj5W9+eBdI8nF1ZvWEBpfPgrJWEQm0G357+IIjuiDeGVQ8VXWAhsyaU9ahEJgaivS+PA7RA17RNoQ6fni0z6QezHTLl5c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wp/U9/yY; arc=none smtp.client-ip=209.85.167.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wp/U9/yY" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3eb9de518e2so1521758b6e.2 for ; Sat, 08 Feb 2025 00:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739002599; x=1739607399; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5rTLiEPTqOtFdHsQfnTiaTuKmKAVDOacAUIwSfTExLc=; b=Wp/U9/yYHgFFXLlJPorVoS0MFqKg2VKNoezfE3Dl4H+s5HhsX8iUGx9sSNlM+Ms+F+ vikeYprmuwSo9DxCF5UTB7v68Wr+TZ6w4TpmFsUtgwe1ZzcwQy84OLhvR1PRx82IoED2 6LNiTQyrvY6LHYa8OhgVnCXTE7HtGYfifbZqe7UoI0XqopKl9kG3iGwJVBdXQF+d64c6 ZTiBjSCC20AfEFSmyW7gzw9ivpSUCcXrIZnKEpVVOqV1nLL5Sh5dOsguufYwrb3aD4Sq /0hggYDWZu0U244iG8+YYWqf/pdPD/iF8/TwfyQSdKsBuLHsXhJ1P06tT/II12vz7jPP XxWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739002599; x=1739607399; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5rTLiEPTqOtFdHsQfnTiaTuKmKAVDOacAUIwSfTExLc=; b=IvWweGqO4tesEMcjR8pGFFxlXhwjzlfc6IGcQJBzFMIOfTcpTdk+GvzodBMm1aI/mq msmntsxcT4BP+S8gGAqkaImB5I5J9ExgVQenpgFTu0yRGpPIaSDInCh9YufdI89AqFCY kFT8wvWO983WkOrRlkELCdI+9EGqNDJfl/RV4/9yvco+cAZIioyDTLsLNbHbDKrxzaSL FrbJ81UAZ6p3yl7/MnlF4kIgK+qX/iXA9X0RaUpbaGe8UoL2BMjQaQxjhnPBmpeEDgCd gXD6odhoXDOXkJB1+aR8fMn0c5HyVoThOq6un78JIGlraxo+DM9jaGOppW/ovUCHKk4n 5aOA== X-Forwarded-Encrypted: i=1; AJvYcCXr6clC6gMrzJnD42nysFKe46OqaYegSfUi/jTMCi1Sl0HQmITtwoHVQdUoO8oBrhS5tIKIDTOSycuAefI=@vger.kernel.org X-Gm-Message-State: AOJu0YzOcQb/EdTUbR/zq60EpZ7RNnpsaPiCJfN31/nS9oJLK9MSRFu2 LM83GIotYlVXIQYmNnwwOCiIi1qh2FdhRlzOoSVn35YKGi4OIZDsZwFV/6Oe X-Gm-Gg: ASbGnctbyUU66HEe7dQu+zVfOqotqlIHDfVzb6ZWY0K2bVqDdMh7wyffYac8u9KY5sx JuNaV1a0+0Rf9KgRL6SdJ49syqAuYA5+R5ypSfWKjHAA5+MfpyjwxeB4D9V2kCx3OHHGJHFWK2X QPwkUILHgfVPVIsXce0h+Cu6IsYWDUbgFUOBsuS1OvZVIs1X7FIeV1zqG3+Fr72AWSEgWBPgaV2 RmmlhE9XUcjPEXBRZK3RmmPF2i1XrMPUd8YEE06luBV91ZFUY8B7v5G+bFC7d3Nb7RcbDWXlg6+ AdqVFYJZio+HhDQ71YJBqcWXGd+RPOYUgpT3yGN/HDoXFI5eyMUlSejHa7OhRygoJQZBSxxJ9YH n X-Google-Smtp-Source: AGHT+IE2WGlva6FTkAjphQq4bYqpI2OIjtaeysunDsrNWQKaw2VxgxJTFyepe9N0rP/jtNDMpO5LRA== X-Received: by 2002:a05:6808:13cb:b0:3f1:d489:3d95 with SMTP id 5614622812f47-3f3922634b5mr3818812b6e.17.1739002599612; Sat, 08 Feb 2025 00:16:39 -0800 (PST) Received: from DESKTOP-GL3U3CJ (162-207-94-177.lightspeed.irvnca.sbcglobal.net. [162.207.94.177]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f389ed1ca2sm1200833b6e.11.2025.02.08.00.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2025 00:16:39 -0800 (PST) From: Ian To To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Ian To Subject: [PATCH 3/3] staging: rtl8723bs: remove extra blank lines Date: Sat, 8 Feb 2025 00:15:56 -0800 Message-ID: X-Mailer: git-send-email 2.45.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2687; i=onlyian4981@gmail.com; h=from:subject:message-id; bh=6SyAjLBH1UP/Lg4IawurSIwuUj6Az2WGwaEx0NGxizE=; b=owEBbQKS/ZANAwAIAepTOeN7sYcPAcsmYgBnpxK4Tg+ke+DkqXQY+DGfEz01D0W09bzg1VHiQ ZDmAoPWZUqJAjMEAAEIAB0WIQRWEQChjkHIk0vVfn3qUznje7GHDwUCZ6cSuAAKCRDqUznje7GH D2zcEAC684ltAhCp4oUzvtzqxJHgy7S3OOgPNGwpx/zsIQ3kk6rG9j8Mi86X8zEZeqSxlZWMTI8 2k/nO0THwryNsq5kEC1CAHkLj3kSuHxsepWS30inhPF5YYgYctSQ7y/X33YMaNILUGHnMbw/K69 4oOZnusckXTvgiQDzrbqp83B6qenVQ9iNlXsGNkLmz7EyTUIsufsX2DTXY8k1ZqhPe7cGic4rO1 MIQGCZZXO4KzGWfY94bacrNUJTYUl5onqx9hgnXPBH5xHT2R4b1hiJ1IrHoPwpBPw0OFxngQ+oI a0o9f8TqNdQa4+7TixSuCW8x0tLYsIw5GOYgjVbVvXcwkiMckPMWngnYkP8NkI1dCzDukAA7Ks5 vCXzv+xLmiSueLWrf1mBqv27+uGVCZkTDJVyVhz6XYDsn1Dxi+0XhwGr0NgRfM2rVkn48bzX52g EGeCraBrCW4QnwBkQYs4XH2IKt+ubXx1Ebbb3sKqEA4JTWM//dHUaoLFsd1foHiulVhnFo2do/u tsSwwpE6VkDOx1N6QaH98BBtTXtZOulD+ylprrzla+L1KkkXEYc1zImm1u9kmAc0tZDQhE6GTu6 rFlaVH7lPBOYHrWhqAAy6EZxY+ch+YM2d7Ad/620IvNuzg2d2qAhSCiXUlo1mOMODxOKIgEn666 dDY//L3cPhuKiaA== X-Developer-Key: i=onlyian4981@gmail.com; a=openpgp; fpr=561100A18E41C8934BD57E7DEA5339E37BB1870F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Repeated blank lines were present and removed. Reported by checkpatch. Signed-off-by: Ian To --- drivers/staging/rtl8723bs/core/rtw_security.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/stagin= g/rtl8723bs/core/rtw_security.c index 394f164b3bf4..4b3e7f40bb93 100644 --- a/drivers/staging/rtl8723bs/core/rtw_security.c +++ b/drivers/staging/rtl8723bs/core/rtw_security.c @@ -123,7 +123,6 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *pre= cvframe) =20 /* calculate icv and compare the icv */ *((u32 *)crc) =3D ~crc32_le(~0, payload, length - 4); - } } =20 @@ -219,10 +218,8 @@ void rtw_secgetmic(struct mic_data *pmicdata, u8 *dst) secmicclear(pmicdata); } =20 - void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, u32 data_len, u8 *m= ic_code, u8 pri) { - struct mic_data micdata; u8 priority[4] =3D {0x0, 0x0, 0x0, 0x0}; =20 @@ -245,7 +242,6 @@ void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, = u32 data_len, u8 *mic_cod } rtw_secmicappend(&micdata, &priority[0], 4); =20 - rtw_secmicappend(&micdata, data, data_len); =20 rtw_secgetmic(&micdata, mic_code); @@ -305,7 +301,6 @@ static const unsigned short Sbox1[2][256] =3D { /*= Sbox for hash (can be in R 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A, }, =20 - { /* second half of table is unsigned char-reversed version of first! */ 0xA5C6, 0x84F8, 0x99EE, 0x8DF6, 0x0DFF, 0xBDD6, 0xB1DE, 0x5491, 0x5060, 0x0302, 0xA9CE, 0x7D56, 0x19E7, 0x62B5, 0xE64D, 0x9AEC, @@ -480,7 +475,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmi= tframe) =20 /* 4 start to encrypt each fragment */ if (pattrib->encrypt =3D=3D _TKIP_) { - { if (is_multicast_ether_addr(pattrib->ra)) prwskey =3D psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XG= rpKeyid].skey; @@ -525,7 +519,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmi= tframe) return res; } =20 - /* The hlen isn't include the IV */ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) { /* exclude ICV */ @@ -627,11 +620,8 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *pre= cvframe) return res; } =20 - /* 3 =3D=3D=3D=3D=3DAES related =3D=3D=3D=3D=3D */ =20 - - #define MAX_MSG_SIZE 2048 =20 /*****************************/ @@ -664,7 +654,6 @@ static void construct_ctr_preload(u8 *ctr_preload, =20 static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext); =20 - /****************************************/ /* aes128k128d() */ /* Performs a 128 bit AES encrypt with */ --=20 2.45.3