From patchwork Thu Sep 10 10:40:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 53378 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 9C9EA22B26 for ; Thu, 10 Sep 2015 10:45:05 +0000 (UTC) Received: by lagj9 with SMTP id j9sf13872279lag.0 for ; Thu, 10 Sep 2015 03:45:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:content-type:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=uF1U2FPFy+Dg3scYpLuXiEOTZCkk5zVIbdGaBp1FJAA=; b=YsCtorNYlJHOg+3YBGVkpjo7+HGVTNXwheORSQiAOk/g098TocwfHsMXho7BbAkNFP S2Pp61up6Tw50BfKhjq45O62qlvF08cYkSeO2/q4+DQnXLzX3gLJoCOeCb91m8WbmJh6 V2P7DTAM3AdKDDAt+uBMowCEAHtdWkW97/i4deBgVfMqlt9d/Xu38LVNoDha4bRhW4IP BvWWARmHiUd43D0OmYjMVXKhLPTOEHfdUJZyW8pCmF+DPl8knQevAWEyv+0ToyU8aRJH PZ5KuEqW/ynG1xsVGYwBn6uVyZY610TLHxsZcK3YrWvGHvCou++r7HyLCwsQJUWNY3QB eyLg== X-Gm-Message-State: ALoCoQm41wI71uVJHGIa460BkDuvZomhQ662L8wsV99VtTAShg1yXM3uNz7Ud5oG/m3gBB5eT2zA X-Received: by 10.112.199.5 with SMTP id jg5mr9417681lbc.14.1441881902762; Thu, 10 Sep 2015 03:45:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.169 with SMTP id f9ls184182lam.93.gmail; Thu, 10 Sep 2015 03:45:02 -0700 (PDT) X-Received: by 10.112.184.196 with SMTP id ew4mr13590394lbc.17.1441881902565; Thu, 10 Sep 2015 03:45:02 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id ap7si10041442lac.178.2015.09.10.03.45.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 03:45:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbmp1 with SMTP id mp1so20710717lbb.1 for ; Thu, 10 Sep 2015 03:45:02 -0700 (PDT) X-Received: by 10.112.146.135 with SMTP id tc7mr35697750lbb.35.1441881902470; Thu, 10 Sep 2015 03:45:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp882192lbq; Thu, 10 Sep 2015 03:45:01 -0700 (PDT) X-Received: by 10.50.61.209 with SMTP id s17mr4653327igr.51.1441881901538; Thu, 10 Sep 2015 03:45:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p197si9991283iop.16.2015.09.10.03.45.00; Thu, 10 Sep 2015 03:45:01 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753517AbbIJKo7 (ORCPT + 28 others); Thu, 10 Sep 2015 06:44:59 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:4514 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbbIJKoz (ORCPT ); Thu, 10 Sep 2015 06:44:55 -0400 Received: from 172.24.1.48 (EHLO szxeml434-hub.china.huawei.com) ([172.24.1.48]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BMR03227; Thu, 10 Sep 2015 18:41:54 +0800 (CST) Received: from localhost (10.177.23.164) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.235.1; Thu, 10 Sep 2015 18:41:44 +0800 From: Zhen Lei To: Bjorn Helgaas , linux-pci , linux-kernel CC: Zefan Li , Xinwei Hu , "Tianhong Ding" , Hanjun Guo , "Yijing Wang" , Zhen Lei Subject: [PATCH 1/1] PCI: remove an unnecessary if statement Date: Thu, 10 Sep 2015 18:40:31 +0800 Message-ID: <1441881631-5044-1-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.55F15F23.0049, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 74883ec054990e8e8c431161bc89b423 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: thunder.leizhen@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch have no functional change. Successful return count, otherwise return -ENODEV. Signed-off-by: Zhen Lei --- drivers/pci/pci-driver.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 52a880c..02919ec 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -172,7 +172,7 @@ static ssize_t store_remove_id(struct device_driver *driver, const char *buf, __u32 vendor, device, subvendor = PCI_ANY_ID, subdevice = PCI_ANY_ID, class = 0, class_mask = 0; int fields = 0; - int retval = -ENODEV; + size_t retval = -ENODEV; fields = sscanf(buf, "%x %x %x %x %x %x", &vendor, &device, &subvendor, &subdevice, @@ -190,15 +190,13 @@ static ssize_t store_remove_id(struct device_driver *driver, const char *buf, !((id->class ^ class) & class_mask)) { list_del(&dynid->node); kfree(dynid); - retval = 0; + retval = count; break; } } spin_unlock(&pdrv->dynids.lock); - if (retval) - return retval; - return count; + return retval; } static DRIVER_ATTR(remove_id, S_IWUSR, NULL, store_remove_id);