Received: by 10.223.176.5 with SMTP id f5csp3455739wra; Mon, 29 Jan 2018 13:27:19 -0800 (PST) X-Google-Smtp-Source: AH8x225N9rfTK711Ymce1RCewgWucQStmGpJKp5E4Wv12KNTOIXH1LY1vLi3ZWBnA+VYf1oqTRjp X-Received: by 10.99.132.200 with SMTP id k191mr21721997pgd.177.1517261239807; Mon, 29 Jan 2018 13:27:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517261239; cv=none; d=google.com; s=arc-20160816; b=Rc9s3vS5hoNFMFr4feR3KycT/W9xteaSPjghetysMi40ZG0BXRNBaoR31ZRCeiStUv 7o+B3J1b5k9eXWBmm5xTDhMRUrFV2axJda2bAXJY+Sn5QlORkGyuQhFYfZsKP8wiLMBP baxJfUK5yyjpw+w25wRFXQ/bfYU+bWTWWOzT+xKXOTsp0UOLu+n9hVJpQ1aKuzmejOOZ HRrv7tb7V6awXvfZDSAwaX1n5LeOBaMYF2s4miItvlCj23hsaJ91LwYVvif+hghlC2ku 6v3yixgaQ5457UKYGQNyaxQzt5wvPmQ+ze+u+GC4gzz7ow6KOZEjXMMaqtt2KXFbmzx9 FuEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:arc-authentication-results; bh=0xHrD5mb0lsgr8uFMm+VyjmgsVB/Mom2fkmHqiAiP5c=; b=pJ8ep1UyMNP4YR0O6zrXcUd2KHjwH/1SFpgGMAZ1vkAyYu2Cp7cjbtTbt2YPR7gp18 dny2YeettZeP4WQkbFjV3AO0tBEsvcPWaIJvv4rwmUOsxMzjhugvFOPvqrs23TlxN79i ke7640d1oGitoqKqZWYMqzcdBGnizHBQ0wZf3mhpRHLsnlquSUJMNv41Os02EEZCqOJg v4IApkKLW++6fJaCoidvV/YmYW6WzcDYRRJyKAOWd0ZMTx5Vuz3fN56NHTE3hs2EeeEM AjO99a4NyHJoDw+42QPZ4HUCzJCZ2DGwsav7iZqoqpmvAHgw+GSgi0Hma0q2/VeYd78O hL+w== 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si7898163pgp.671.2018.01.29.13.27.04; Mon, 29 Jan 2018 13:27:19 -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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751771AbeA2V0k (ORCPT + 99 others); Mon, 29 Jan 2018 16:26:40 -0500 Received: from mout.web.de ([212.227.15.3]:61956 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbeA2V0i (ORCPT ); Mon, 29 Jan 2018 16:26:38 -0500 Received: from [192.168.1.2] ([77.181.96.112]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MUir6-1eH4XX3a8K-00Y6BU; Mon, 29 Jan 2018 22:26:19 +0100 To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org, Hartmut Knaack , Jiri Kosina , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Srinivas Pandruvada Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] iio/orientation: Delete an error message for a failed memory allocation in two functions Message-ID: Date: Mon, 29 Jan 2018 22:26:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:tCfgkEJpQcMPUSHUF3a7hWQK7bet7xxSQMmIaa/ICRkMKIPifMR AEHitkL6F0bHzhhmm6E/VMil6DekrKqeBcbbsGVvd/RDbwWCxFzJ+BNTZBxiu7hEXlVRD8I 46I7k3WYQJ0fLH20DevdJPNA4ZTQBT0tzDD1aCfKs/PUUJt5CB4r0iFKK1gaIeYFw9EX5GB vwNJMTLo2wePVFG8vc/zw== X-UI-Out-Filterresults: notjunk:1;V01:K0:0C2A+irfkzs=:+dmilspa5ScKCLooHNrMm8 Y4lHGPd31Qb6WWxUQS2keswTtGJRd5D9V5Z+WgjJJMNTE9XM7IAvoce771BfQtiRxsArehcXG 8Ce+HyQMiCyA64EFwRSnR6yfryZm2/NAjKLgBGRg11wSMtX+GDPJjydEzB9j4Zozz2DdKxU8Y CrDEoGzaHw0WeU+7a7Xh3ngdEGymhhowVKaPDLT75ryoCPmICIzPZlv4/nHRYEHS1grqoJMHd VXlrbGwJ4M6gRZTWthTfGsBIcvCDg1RPICGRYfdF2vdZ+iz40HnyW7TyEPFAfVlCy4QTda0rW LFdnEaNlB/kf8yQI5u9LIUwnsLhVu7D2/9h7Kv2mmWxbBXCMYspa6HcNYMr7qzLziyx+Wz6Sp AAOAZdrkK7Bz3ABmaEuizEM6yAG259Mri5yCggcwmiZ/K03iDrVqO/u70dqiEv5mRqV4ulvtx XjueykYO3dTnhBQaI7CDcYD8CGecxe53PkvScCvcskkW3P0NGtnxGZv8zgGAqCsz+tQgj8xJC uyQhd+mV4sm9+Smaam/D9yfJdjioOPRvNbrKfOZBPq1TgxEXQ4IGpbphVZ9ev17zAQVAUHNeH Itnt3BP/qQJsN4clEm3r05Hg+AHK1cEodSiRArRZj5zAP4oJ2SgKBDkfDNE7iP8zbYEcE3Evp qj2EAVf31mgaze3pYWH+PFUnnAPt5KSyh3Xw0TLB5JF0ozlescuqC2XAuSkotq9NvLwJYV3gG JQTgXcWNxdYRbzYbsau2uLCF021/Bt+glzsAWnl+N8dRgXWIOW47K9vxFDn+w9nNr0TBZJr0M YmjxeKU+aENffrBMavh+VhdTsAi1CxwWBH353lUtVRv49mdJyc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Mon, 29 Jan 2018 22:20:07 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/iio/orientation/hid-sensor-incl-3d.c | 4 +--- drivers/iio/orientation/hid-sensor-rotation.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/orientation/hid-sensor-incl-3d.c index 1e5451d1ff88..742c0e0eb4cf 100644 --- a/drivers/iio/orientation/hid-sensor-incl-3d.c +++ b/drivers/iio/orientation/hid-sensor-incl-3d.c @@ -336,10 +336,8 @@ static int hid_incl_3d_probe(struct platform_device *pdev) indio_dev->channels = kmemdup(incl_3d_channels, sizeof(incl_3d_channels), GFP_KERNEL); - if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + if (!indio_dev->channels) return -ENOMEM; - } ret = incl_3d_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels, diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c index a69db2002414..cbf5e406b1ee 100644 --- a/drivers/iio/orientation/hid-sensor-rotation.c +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -277,10 +277,8 @@ static int hid_dev_rot_probe(struct platform_device *pdev) indio_dev->channels = devm_kmemdup(&pdev->dev, dev_rot_channels, sizeof(dev_rot_channels), GFP_KERNEL); - if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + if (!indio_dev->channels) return -ENOMEM; - } ret = dev_rot_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels, -- 2.16.1