Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5827197ybv; Wed, 12 Feb 2020 00:47:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxLSD3yfP2YLhAxg13tWHFAXUEE/eTr+Zj0g5NttzquSbuRIZ9Sx5lZhDWph8/jkxH59iS5 X-Received: by 2002:a9d:6418:: with SMTP id h24mr8448132otl.172.1581497224031; Wed, 12 Feb 2020 00:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581497224; cv=none; d=google.com; s=arc-20160816; b=gFnCGQhKTFiq7s4BM3q1rrELpwq7IA2leunWR5VSIYvsvWV5gGbNv8fCsxLwFG5Kcc y5G3H8DzbrHgWtG5Cbu31ozf7yUFfaYt6i/5CsO+buSHsF05gZNDQxeImvtaBFS/N7/f PQnBu+y+rcJOzB1KXWEdXebUC0m30DDuVs5pFT1WzCwnxjEANqH//BLdxD2HdN565Mp4 5M7Z+LZSysm3o5yu7IEOrV9uP2ZRUai/lBswStAB0otnPn7nkwhMnZP8O8ZixjCvUrLh ZJOLPD3bxbzbEw2l5eE6Qg1WBIrLQYpYoTmOruebbQEMnSePdKLI2a/scPXyudgl6l73 WIaw== 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=LRA1PNsqM7/btp7xObJzR6e8cOV+hFULgTk7DXqlo8A=; b=TFMrd1+5KXVkQBnD+fqndyXFQB6kTEtHDajtqnBIEF26zAEeabbYYLVkFstYEd1EPt eFImb9R2+9FIiU7Xth2vOM3c18QgzXD217MlYpXNCfPnYKVtDLDsKLh6b667wkqGy3xL wz5QcIAeYztZ8Hme9bixmRs3UztV7BF1wVtZodq2efNnsgxakdRqkiyV8PS4nls2AJ45 v2Exqz0Kt1RSF88CzviUNhEGJ1R6xBqBNj5/Mf0iia2RHgVMmgeZcu5/QYWEJmaJoQnm 2NzodcLqrEE1eyggXDXODbttrO7WZdfeG8xtS10IiQZRmsRPyk1FXS92NVx+clBFzBrD bgag== 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 r82si2944597oie.116.2020.02.12.00.46.51; Wed, 12 Feb 2020 00:47:04 -0800 (PST) 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 S1728766AbgBLIqK (ORCPT + 99 others); Wed, 12 Feb 2020 03:46:10 -0500 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:34491 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728631AbgBLIqJ (ORCPT ); Wed, 12 Feb 2020 03:46:09 -0500 IronPort-SDR: A8BxmbJStKfw7wottLa3/MRM1OEIxyZ1M4fB5hjgxNkB8BTzhhlKZHNWx/xMQcoE4TYBQdbkjx Vugz8WtcWMSCL3ZTA7nbXZO5icwQNV4CBxb6dy9IXGMj3i6vxNmH8yXlcBEf95yyTn3nICUXu8 yF3mQUq/FmEz48OVRxvpapiAKyN3/kaUqzZIi8hsc0VGNbrE11ySVsLeDuwKd/SCV+mjVK6Cfw UGa7MEjxmN71wOWJbh6DlZGQY5EYnHReWo3QWFhja6TE0A3RdBrNVOuC0ZoMZydPkeY/72kxxg /Fg= X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="45686261" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 12 Feb 2020 00:46:07 -0800 IronPort-SDR: aCqCBKyAY5MB47KnhzcNC+zpDE/3ir25ohQYRk+p+iwFalMCzaJFnAtgI9C9jWgQyqZ3iiA8oI 5SW3pmKg1O7IqHFpLkMC3WScxGdYSFf8UgRHoVWF7sOmUI61wctqpAlIZNS1aHcvla9ZJuNdpb OrJr1cegHkTBAnUcCWlmVeeMuor4QwDvawxE9A37UWNFRZXy1oAfep0gOnGvpnnJUaqzCDwM8m HZU2VLbOeLi84rbmL0O4OuyZF2goVFVB1oi1IA23LfE9HIninhKYunepHzmaObL16j9Gk/FOQE pYY= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v7 30/48] Input: atmel_mxt_ts - eliminate data->raw_info_block Date: Wed, 12 Feb 2020 00:42:00 -0800 Message-ID: <20200212084218.32344-31-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200212084218.32344-1-jiada_wang@mentor.com> References: <20200212084218.32344-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 b3e3dbe7a9a0..a64793281ae8 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