Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1368575ybj; Thu, 7 May 2020 23:02:01 -0700 (PDT) X-Google-Smtp-Source: APiQypK2WBv5MJxmQ2A3YatAf+aLTelTZjcPkZnbRaKCR0vxQNA07fEW6CjD06j68PD241EC9pP+ X-Received: by 2002:a17:906:3584:: with SMTP id o4mr533251ejb.70.1588917721083; Thu, 07 May 2020 23:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588917721; cv=none; d=google.com; s=arc-20160816; b=ib0cLIP4e1bkGKbpVVA5ISHsh30+BlpxoxOMaxR7PXxYlzvDwuVTqEgIzD4xcxxiKV gMMp7pTA2ESVDOfKxOVA6WBGZBlSMWXxJ6Epn2Fv1AqMvxCkLDSZ5ZholOx5FnGgzKWW tT6bLxfrgBtrTssNQ9Dj//afwKEM8d342VNSJnes+PuLmMstcvGriqPd9JglrltTAKgR aZl1sm/hfakxUG9ZM3+cuVNL78ci7X3xjIVpFuxtC4GzGfWSRrSw6o9CxpVCKWTPYO8+ jmOIe5otGsX0jFDWA6cx35DGSCS4yHl5s5AIhAWyTR6UvgOxpG8hHuQDdDHS+aFjcGmG Qg7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=kLqUD+U9XE84lBMZs+oqoq6SmIjQBvnBxVazl+p3HWQ=; b=lpGlUQi2SPSbQpVo2Avu/pHqxxUguDiPQHUsYndggaJtD4vl0v8nRIMzoJDMCi5EQI Ziq+HflogwU9H3VPEmXUyGGW2XzXGp1LHMDUHUIjWdFpB7qD0PjuyL7JrLjY1xmjlYQs dPT9PT9D4CW9Ca9XpwaPmKBX//rJZSd3hUaSu6LcaxR/RECV09aingP6sxKGWkwoIlaW JhXR9MFYKMo+H0qH/XMHcoq4KmJ8Tx/Ob40TaqEOihwmbDnLwKkKUkHZRY0Cj9xRuW5b YF6YNX2kTW3x4E6qb/j8AG6e4CmyngdDxTHufsELLF3pHmyy6teAUBOC3+604pbFjUIH N6gw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si370535ejr.55.2020.05.07.23.01.38; Thu, 07 May 2020 23:02:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728191AbgEHF71 (ORCPT + 99 others); Fri, 8 May 2020 01:59:27 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:22062 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726807AbgEHF70 (ORCPT ); Fri, 8 May 2020 01:59:26 -0400 IronPort-SDR: jfVFPUQOF/0KVTqimvcqRSg3Ipr5j7ROEDr5w5XAO8n3vjFBZ/CPWi+Y2AFz4z4wS3Vu3MLV90 C9DZO7zuyu1qcLF1of4GblJui2hvwFj7TyHz11Ny8BwltI6mlTq07aHD+b0fBq2c8R09Py/nEg WXhWrJF5cpsKqI7zHFmRqEhR6qI2V71/CC6ky73CZn+td6LbEmzJ9FnSMRDciaGBv5rG+xg4lF WZ6UaBAmnH+WQqAUss/nJZlIGSoQap3sUZX3ejwI096L2zCLFvyudyuLmu53jakozxwIYf8brR uvI= X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="48589126" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 07 May 2020 21:59:25 -0800 IronPort-SDR: L3NrtHh3nnZ6Sw1G2JDvUzOhqhU6HO2PJGQe51mZTeWccV8WdD2EOxp5hpXykDPc9s6/o3GOUn E9qaBdRtW5x38c5kjZKFUbn6OqkB69946fkXCmL9a+Lrm2kBG9AdaDV7s3kYJqQLumW/TWZaV8 xDWxhwnzZs/JFRtb9W31LM6broVp+e7dH1nfm5tzwcnKw59KuwOAhlC+rbMXudcdMJfRLQzXl1 An3u/EgLjUh5CsI0AkzJ71ZZdQwGgNkIk/1XNAeParC29Gc+4JH93AxzTLdS4vwyWE61xGMbrr Rkk= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v11 38/56] Input: atmel_mxt_ts - eliminate data->raw_info_block Date: Thu, 7 May 2020 22:56:38 -0700 Message-ID: <20200508055656.96389-39-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508055656.96389-1-jiada_wang@mentor.com> References: <20200508055656.96389-1-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dynamically allocated in mxt_read_info_block() buffer buf is assigned both to data->info and data->raw_info_block, having both data->info and data->raw_info_block is redundant and confusing. This patch eliminates data->raw_info_block. Signed-off-by: Jiada Wang Signed-off-by: George G. Davis Signed-off-by: Vladimir Zapolskiy --- drivers/input/touchscreen/atmel_mxt_ts.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 92c883087a4f..a92ad9a103a1 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -324,7 +324,6 @@ struct mxt_data { char phys[64]; /* device physical location */ struct mxt_object *object_table; struct mxt_info *info; - void *raw_info_block; unsigned int irq; unsigned int max_x; unsigned int max_y; @@ -2053,9 +2052,8 @@ static void mxt_free_object_table(struct mxt_data *data) v4l2_device_unregister(&data->dbg.v4l2); #endif data->object_table = NULL; + kfree(data->info); data->info = NULL; - kfree(data->raw_info_block); - data->raw_info_block = NULL; kfree(data->msg_buf); data->msg_buf = NULL; data->T5_address = 0; @@ -2224,7 +2222,7 @@ static int mxt_read_info_block(struct mxt_data *data) u8 *crc_ptr; /* If info block already allocated, free it */ - if (data->raw_info_block) + if (data->info) mxt_free_object_table(data); /* Read 7-byte ID information block starting at address 0 */ @@ -2275,7 +2273,6 @@ static int mxt_read_info_block(struct mxt_data *data) goto err_free_mem; } - data->raw_info_block = id_buf; data->info = (struct mxt_info *)id_buf; dev_info(&client->dev, -- 2.17.1