Received: by 10.223.164.202 with SMTP id h10csp3579127wrb; Tue, 28 Nov 2017 13:42:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMacQ+PGZZZLTFRObcLmf2C6xmafLHokE2pag0UZU5mBOCDTr1GOd0rTjQRyla4SgrA8EjMD X-Received: by 10.84.171.195 with SMTP id l61mr569597plb.129.1511905346387; Tue, 28 Nov 2017 13:42:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511905346; cv=none; d=google.com; s=arc-20160816; b=DOJPD+S0KvqYqrMeMuHokzDiPie0WD4Ho454msWfGDrlakLz/GcaFes+L++hePeMiA 0w6OCwnEFqPGW2K/9aWjWzijrMG4CyS6ID6HNSPlhn4X6UjCczeSd29c83vL0hifso1A fDoEuqrqt38KIfL9vwaWc/rZrkrvfgR9Eleiry0FflIa3OsDa75hKYknQmCpqoec/Bma wttWdvP+9BS9Zri+tw95NdqjkSVcl1FWENyK01NsRePxctiTKS3mueYkGqzohCt7Ujze p+ZnweH+kxQORH73iK148mM0YrJSmqmgme0TZ7HBP+tEBQqLepVbmmUqpsPXvhohl1GG tcMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=yaUm+m8jnCq59DQO6P4/xz2noC/VnNM9Fs2YcCm3T1Y=; b=im2WTAp5dNnvTsj3J+wc+EDEY+1XSWT9en8j1fmPX4hjD+u3J24xHKFjlH28rY1VoV o+ToFanRHWMw+uNd30IybJygNjwch8zxiZZOEoJjBrMla7d2jEXjeNLkt3tbuhNkt5GE yd9a68viXFQHxjIUmQ1L5GWKu9f/7nZQM90mDZ4PWTL8ip4EwtnKAtX/DQAI43lnT7vW WndwGhjUxOJJgYUKldUIJkTLBF/ehv+PJ3YDpG8I8T8BdTNDcfK+cTmMo2ZrKkgumbQn 3rT0CP/PQ+NUhxppougPJcgkvUSdGoiVv7O3pQhwBwH/LwjrnG489nhALFZeOVnD2GHF PpVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WLtA1RZV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si107262plw.6.2017.11.28.13.42.13; Tue, 28 Nov 2017 13:42:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WLtA1RZV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753757AbdK1Vkk (ORCPT + 70 others); Tue, 28 Nov 2017 16:40:40 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:43725 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbdK1Vkh (ORCPT ); Tue, 28 Nov 2017 16:40:37 -0500 Received: by mail-lf0-f65.google.com with SMTP id 94so1490437lfy.10 for ; Tue, 28 Nov 2017 13:40:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yaUm+m8jnCq59DQO6P4/xz2noC/VnNM9Fs2YcCm3T1Y=; b=WLtA1RZV8wIJfHTuJkjstMa3eSeh/bt5VPgUKzOqQeENnSxWDQBgQh/ZKLM1zFbht7 iG6Y98vq38MuOKpTjT7JZXluo+aMTWzgYty9y3mb09rWJPUNBvj6TkZpN0wV3lAJW35z mCEye3y4HatEXJmRwwwI+kLnKE2q/w12kKpXmJgBJ4PqpAQOdbnFk3xwgPfporR8VSDr X8PuoWNbCH5gFipbYLY7/h3zxklcWYI45ius7JxD58y+uBQgpgkOWvsqoN7L0eUwAoO8 gAAzA4E3E52DW+3z2SyB8uvwtVVwQ2vho67g0/aVPPZI4IRyD0X9q2K38xUBuaw7yWzD 63hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yaUm+m8jnCq59DQO6P4/xz2noC/VnNM9Fs2YcCm3T1Y=; b=NU0HSWp9jjWpl8cHI4JYk6JuT88QZkKAPy8E4J5dPqMdUoVwjxjx+A/DmQcvOFJyOc 7K7OgxV6BDcPRsL8zVe4Dqa4wrwOAKHt2fzZrWnNuJ4z+GdonPvazVqxG078fL2eL/PE AUFZgUN/szKZZC8fS5VFEZRHwhAQJJmNAyCUH7bDbxCWV7zZAAX/KNr0GgQFGyv7qie9 Nnbx1rmcaJFSqCHxb5brQM1Y5+boXOYFezHGjIvQbZn3hoF+T9hQCh19wFZ0w8zvI+Mr oighl1VbkadNlAomicmsZUDdTshcQuupSCkkYS5yhQz22gF4yjOm4WXkaOH7JrpI/Hun rBjA== X-Gm-Message-State: AJaThX5iyF+x5hwbc7/ETFfYjFRMBywrGEr2cgcXDn+ddH8UKwsGeyFG g3wcesriZsctn7jiPVqiUmc= X-Received: by 10.46.48.6 with SMTP id w6mr253195ljw.10.1511905235763; Tue, 28 Nov 2017 13:40:35 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id p73sm26658lfp.9.2017.11.28.13.40.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Nov 2017 13:40:35 -0800 (PST) From: Vasyl Gomonovych To: somlo@cmu.edu, mst@redhat.com, qemu-devel@nongnu.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] firmware: Use PTR_ERR_OR_ZERO() Date: Tue, 28 Nov 2017 22:40:27 +0100 Message-Id: <1511905227-30292-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix ptr_ret.cocci warnings: drivers/firmware/efi/efi.c:610:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych --- drivers/firmware/qemu_fw_cfg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 5cfe39f7a45f..18489b6a696d 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -693,10 +693,8 @@ static int fw_cfg_cmdline_set(const char *arg, const struct kernel_param *kp) */ fw_cfg_cmdline_dev = platform_device_register_simple("fw_cfg", PLATFORM_DEVID_NONE, res, processed); - if (IS_ERR(fw_cfg_cmdline_dev)) - return PTR_ERR(fw_cfg_cmdline_dev); - return 0; + return PTR_ERR_OR_ZERO(fw_cfg_cmdline_dev); } static int fw_cfg_cmdline_get(char *buf, const struct kernel_param *kp) -- 1.9.1 From 1585562130807383903@xxx Fri Dec 01 06:31:21 +0000 2017 X-GM-THRID: 1585562130807383903 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread