Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp596626pja; Thu, 19 Mar 2020 08:04:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt/WKpuQPsoW8XA4bheYn8QTF6I8HxE480lk9SVnKb+kJTJ2OkmoE//aSztdEANuvPEQtjj X-Received: by 2002:a9d:4d02:: with SMTP id n2mr2552511otf.107.1584630275991; Thu, 19 Mar 2020 08:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584630275; cv=none; d=google.com; s=arc-20160816; b=YSgC60LJzkLQhm4Pzv0Z5idLNVcj62Y9mTZIfDnDAvK5t5RuNSBqEx7SJM/Qt+g5xA tkj2sfcYfRo6iFMEIVEEKES3JUZDFI97AkYrOJ8lKPIHgb/r46igdGvgwQQ3IeAJYg5Y rJBOccxsV3d3q25hCddr+TztZBDopscSdIhISrzO1LYwYbsut2gkRPWqqbUY0MKjDUur Y+xCj/GVkGF/nuuCT/MLAUtEdY1oD92UI1pMU4+W04YmRICbD1plNO1BtGCjN5s1fifd DvkVJsfwz61pATqJEo3NlyLJq7whXsemKJw46GeVsogHIz69fJDMXN0UDAdpVZroLWl0 VB2A== 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=1r2IJC31JqLGbhoi0+030UltAOqaupLhO4RDfaBUyZ4=; b=mQO+69liFQcY0AQYywIbMi0yw0mu8wVWRHzPyghBekdZCe4cY8xy4XX2Lo9P0x/q3r 2dA5GNqT5+1dUUFogXYStocshgLWNWbmYFEmpHX57Y7oU8xyrgKb5Oy4wxaIiKFwnIbZ 8aQ2R1IlZgzDFGJUK1AS9Uw7Q4urbogl9o7L4vcKTDq5dkYkkFfJnxmY0j6v2lrOWh2M 8zxsedH29Hfg1SB5p1ElPOODL8U3bV5P3Oprbzjs+9ymMoOUqMwZnvSQTYUCdBS8sbSl zJXGMioLjZV/NUaoGVd4P/f5qnuEGkyUosAIlP6fDBBCv2EyaE2e5L/CydDXreapNLHz fKcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l75si1144074oig.59.2020.03.19.08.04.08; Thu, 19 Mar 2020 08:04:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728269AbgCSPCd (ORCPT + 99 others); Thu, 19 Mar 2020 11:02:33 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:16097 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727754AbgCSPCc (ORCPT ); Thu, 19 Mar 2020 11:02:32 -0400 IronPort-SDR: ywqCJ5OIu1WocdUXo8+6Woh83R/3/CtrN2DmMNfwtH/to564qozAv2iMTPsVHfxhg1nVOe1yRe 3qfQm1Xg2Cyb1Hv3dvlQ10CtN2l3CV9kxrL24A3SX4A3/rR3KfSd2WTZSUP+avSAAT1iysPdqk HUBeHB19ulM5gFPgzUPEF7E9BO8t+D5U77VvwCEclsbemmy+JkZGnCaa7qZyzPFJf32CT+encm DIpRq6uwEIN9Vb1VapC2DS52pdhFDTeGKPbt4G6v/x15bU9fLa1U7nzrf1hrINlI65OmqXUhI2 GXw= X-IronPort-AV: E=Sophos;i="5.70,572,1574150400"; d="scan'208";a="48850363" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 19 Mar 2020 07:02:31 -0800 IronPort-SDR: /NjeRM/tk6vq/RGBX4srdWBYpAhWY4DMAwdbnEyKmPf01VF4o5IMaH7glAFqCuf6NNW1sYWmtq oNXjnd8MOFgSbWTeAENIIkcyEbmNb+AD6YnCJ6dCpuTRjJaFZid2klSZJh99Ebqy5twf5km4Ai Oso0FqwYaLg4gCHibF/RtGV6pPSqYp506Q61aYH55+OXXpXBgu6OLFsEdARf/lBa4mWtF2mhAk jjSSb1cU5dYd202VIu1L8kNPtY5fkuW6tNuaH+2r68Xds8HrJR30+LvPao3XFXYVnYGLX2fyX3 Xxs= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v8 33/52] Input: atmel_mxt_ts - eliminate data->raw_info_block Date: Thu, 19 Mar 2020 07:59:57 -0700 Message-ID: <20200319150016.61398-34-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319150016.61398-1-jiada_wang@mentor.com> References: <20200319150016.61398-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 15bc1b1864de..48ec60be26db 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -323,7 +323,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; @@ -2067,9 +2066,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; @@ -2238,7 +2236,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 */ @@ -2289,7 +2287,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