From patchwork Thu Nov 3 11:56:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 14835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp487367wru; Thu, 3 Nov 2022 05:10:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4fJU/o/hIBLh4H4sLQyhsGT/X2o5pbt/vlAo8oypL3JiCVcOJxrumEx2m0lWUBFgPfIA/D X-Received: by 2002:a05:6402:348b:b0:45c:b22b:c4a9 with SMTP id v11-20020a056402348b00b0045cb22bc4a9mr30626842edc.65.1667477401261; Thu, 03 Nov 2022 05:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667477401; cv=none; d=google.com; s=arc-20160816; b=jvQkvY5CoBlC6elNyQLTNPXMJq9l3FDLB3TdMx1R3p8OrF+kY7BKDlT9H6yZQ6TEJ4 AgizaQlfhfQknWjOZQ4BQtyURswytbtyNv448/SrAthYbrolf27lYUtL0mcgNX9Y+wRf AmfZSGFo/GxkckpIgrsuj4C2+/CTjPyhY9ET6+kxiu7FJ/r50w6SqndxKjk4dEktJ3r0 ATb0cj1l/387wOIrtpLZsbkDDQdEyYan6cWgUJTnSrnRN1SsOzVbRGTqtVYEpAdKtvrz 0OZS1X/XyeAkLTizGTAGh3nC0Qsa2u5mn299EflrRE7m6BpClbGxB1A/v7g2u4gA0t7C BTHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=YRYTxcN8Aw4pNOcqbjOrxiSxyJbuNXVOlY+7PI4EFl4=; b=ZuOB5M9pvnS7LXCgbq9FYnQzCZM8ccZ944pRvYp6TqLjdOm+DfhW802lOBQNxIaUIa Gc1MNPIFZR8WfBKjbGvhllinvWc5UckWNTxQXxuBDP/B3kgCpDoriv9rf2A2vZe/BWjC +6mUEhWFoFWHar4I2cVJI26DarkNETGK5g3VNd6dNqeE6ZWHENRLyMgOvsq9EbjRkb31 xbHHBDy6Y9Emhm4YfpKc+iPa4kfaZHnFcDyMut/Io7vX1nWOYHMRP0+Kxxw10tqqExv/ 6l/96xTREhU9XUoErPm3sU/pZv5JEl/kfBTx63rVSv0nEMqBTNED0xEKVR9XA8Cnyip0 G+ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=X+HOMa6C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020aa7d794000000b00461af57d736si860749edq.278.2022.11.03.05.09.36; Thu, 03 Nov 2022 05:10:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=X+HOMa6C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbiKCL41 (ORCPT + 99 others); Thu, 3 Nov 2022 07:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbiKCL4X (ORCPT ); Thu, 3 Nov 2022 07:56:23 -0400 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC18B1106 for ; Thu, 3 Nov 2022 04:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1667476568; bh=/NLwbR49Avnf18FfogKpbZ5T40/76ghuIMELqgmgUkY=; h=X-EA-Auth:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type; b=X+HOMa6Cqoa27KMD5oT1MjY3Gz7vKXD/EPT7mnn+e2u8/jdt+Wa/5NI46KgaFlst5 fTU2aE87wU4JlJvUxqPZXEVz6g0qAviYe19VUTb4WTAAYMyS9QqVGyJ50modG1ya16 p3NWP+ln9ofRwUjnWtprBu3dajdSkNnXfY9Wu09k= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via [213.182.55.206] Thu, 3 Nov 2022 12:56:08 +0100 (CET) X-EA-Auth: fZNaHUg4jtpGZewYR6tJSl4CE3GuUAnFJlzHa26bu/s68tjys15zyF84sNeCegVJFSM5djMwkw2RoegSYSsa5vTs/Mtwkcxh Date: Thu, 3 Nov 2022 17:26:01 +0530 From: Deepak R Varma To: outreachy@lists.linux.dev, Larry Finger , Phillip Potter , Pavel Skripkin , Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging: r8188eu: replace one element 2D array by 1D array Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748476783758423345?= X-GMAIL-MSGID: =?utf-8?q?1748476783758423345?= A single element two dimensional array is constrained to index 0 for that element. This constraint makes it similar to a one dimensional array. Hence convert such array to a simplified one dimensional equivalent. Resultant code is simpler and easy to maintain. Suggested-by: Dan Carpenter Signed-off-by: Deepak R Varma --- drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 2 +- drivers/staging/r8188eu/include/odm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.34.1 diff --git a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c index 622f95d3f2ed..c0706c5b3fd8 100644 --- a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c +++ b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c @@ -886,7 +886,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) /* by sherry 20120321 */ if (final_candidate < 4) { for (i = 0; i < IQK_Matrix_REG_NUM; i++) - dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][i] = result[final_candidate][i]; + dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[i] = result[final_candidate][i]; dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.bIQKDone = true; } diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h index 89b01dd614ba..0008615ba858 100644 --- a/drivers/staging/r8188eu/include/odm.h +++ b/drivers/staging/r8188eu/include/odm.h @@ -166,7 +166,7 @@ struct odm_ra_info { struct ijk_matrix_regs_set { bool bIQKDone; - s32 Value[1][IQK_Matrix_REG_NUM]; + s32 Value[IQK_Matrix_REG_NUM]; }; struct odm_rf_cal {