From patchwork Tue Nov 4 23:53:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Pan X-Patchwork-Id: 5231421 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A70479F295 for ; Tue, 4 Nov 2014 23:54:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D03E120155 for ; Tue, 4 Nov 2014 23:54:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3D022011D for ; Tue, 4 Nov 2014 23:54:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbaKDXyH (ORCPT ); Tue, 4 Nov 2014 18:54:07 -0500 Received: from mga09.intel.com ([134.134.136.24]:58687 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752492AbaKDXyG (ORCPT ); Tue, 4 Nov 2014 18:54:06 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 04 Nov 2014 15:52:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,316,1413270000"; d="scan'208";a="631536281" Received: from icelake.jf.intel.com ([10.7.199.64]) by orsmga002.jf.intel.com with ESMTP; 04 Nov 2014 15:54:05 -0800 From: Jacob Pan To: Linux PM Cc: Dan Carpenter , Zhang Rui , Rafael Wysocki , Jacob Pan Subject: [PATCH] Thermal/int340x: avoid unnecessary pointer casting Date: Tue, 4 Nov 2014 15:53:34 -0800 Message-Id: <1415145214-2986-1-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid pointer casting which may also lead to problems on big endian 64 bit systems. Reported-by: Dan Carpenter Signed-off-by: Jacob Pan --- drivers/thermal/int340x_thermal/acpi_thermal_rel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c index 0d8db80..ac5c405 100644 --- a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c +++ b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c @@ -317,21 +317,21 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd, { int ret = 0; unsigned long length = 0; - unsigned long count = 0; + int count = 0; char __user *arg = (void __user *)__arg; struct trt *trts; struct art *arts; switch (cmd) { case ACPI_THERMAL_GET_TRT_COUNT: - ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count, + ret = acpi_parse_trt(acpi_thermal_rel_handle, &count, &trts, false); kfree(trts); if (!ret) return put_user(count, (unsigned long __user *)__arg); return ret; case ACPI_THERMAL_GET_TRT_LEN: - ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count, + ret = acpi_parse_trt(acpi_thermal_rel_handle, &count, &trts, false); kfree(trts); length = count * sizeof(union trt_object); @@ -341,14 +341,14 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd, case ACPI_THERMAL_GET_TRT: return fill_trt(arg); case ACPI_THERMAL_GET_ART_COUNT: - ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count, + ret = acpi_parse_art(acpi_thermal_rel_handle, &count, &arts, false); kfree(arts); if (!ret) return put_user(count, (unsigned long __user *)__arg); return ret; case ACPI_THERMAL_GET_ART_LEN: - ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count, + ret = acpi_parse_art(acpi_thermal_rel_handle, &count, &arts, false); kfree(arts); length = count * sizeof(union art_object);