From patchwork Fri Apr 12 20:48:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2437941 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5539FDF2A1 for ; Fri, 12 Apr 2013 20:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754078Ab3DLUsE (ORCPT ); Fri, 12 Apr 2013 16:48:04 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:58568 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753848Ab3DLUsD (ORCPT ); Fri, 12 Apr 2013 16:48:03 -0400 Received: by mail-ie0-f173.google.com with SMTP id k13so851417iea.18 for ; Fri, 12 Apr 2013 13:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=OibIZFU0WG4TC24hKZKk8Nn2VdybwndDbFvA/weKq8c=; b=blh378sK0+1Ogbtx9hkSxBbxTG398PSMtGBJo97KktgM7m1RHGd+HXktmkfuZ+wsB9 n5CoL0sAvZY6NQ614+QJg8TdINUjuz4UY0etUV8GHCIY36f+rWOirojRr+kcWSqXZSMa lxXKcRzr71yKYp4qlBzBLMyJ7sAznOxPvtHgpAHSAJ86PNTzhMwgXYM/eLil241uEklV FagaDp89oLLZ0e/o7F/iZidnsirypSNmPm/71CdvL09vYqfF/9SGUcyyw2Bkfy+Mn5V4 g7WBcv+JU2pRWnuJVZw6tcnUrzQmG/l8S57F95RTqDWZHIj4TGv4iwYQivSSIzTo+egO Dn1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=OibIZFU0WG4TC24hKZKk8Nn2VdybwndDbFvA/weKq8c=; b=WGhj5OWrvR33TSDHUDTmHJvsE6CAHs270vrh47Gwzev8bDlxrWMcjoWerkhuoKR0Gz HdwCpURbDRPHzQP7tT6T+DCjFz5QU4pETF1GJ3o/8cIGA6pn09VJziHhnNJRc0BV7RA8 RHj/4bFyyvvQmy8nWxjn5b5QbAB2oW6KhHDcSrihItF3FZszQJPcpPiNvnp33Kl8+El8 NtXqRC2SsHrOHcO6ggqlG6WbVisJekN2Ik/VypABS0xy7ObolSVLmA6qvkiYE/AoHqot 2wW5ODP+auoSjmCic3lFeCbD8/txs7agh9yghEoDs9xmK5L5samKweTVcxS107QoDWT3 pdQg== X-Received: by 10.50.115.42 with SMTP id jl10mr67656igb.71.1365799682530; Fri, 12 Apr 2013 13:48:02 -0700 (PDT) Received: from localhost ([172.16.49.242]) by mx.google.com with ESMTPS id hi4sm15612igc.6.2013.04.12.13.48.01 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Apr 2013 13:48:02 -0700 (PDT) Subject: [PATCH 3/6] PCI: Fix __must_check annotation on pci_create_sysfs_dev_files() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: "Rafael J. Wysocki" , Andy Shevchenko Date: Fri, 12 Apr 2013 14:48:00 -0600 Message-ID: <20130412204800.5237.60312.stgit@bhelgaas-glaptop> In-Reply-To: <20130412204510.5237.25443.stgit@bhelgaas-glaptop> References: <20130412204510.5237.25443.stgit@bhelgaas-glaptop> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnTyejf9dNqhOB6SIAjYd5TPVhEIk4dE7ly4oiGmoCuf8dHXqBjRdK8SjaW6MyRXYdqvMsrfeqwBJxEQ1uEruhW5ob4HmJwl/ISBehEm9o2aqN5j0QnK44hkddLFcgdfj4wl5A9BhiHS85kiLMQRZathJqlsv/p2yHdLwTtRafKnI+etnmgQv3krazqd9pvmJzY6Xx/WwDqCnJ+4A71x1bgdqG83l7hVUeJEH1b3NPkVR32ytY= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The __must_check (gcc "warn_unused_result") attribute only makes sense when compiling the *caller* of the function, so the annotation of the pci_create_sysfs_dev_files() definition did nothing. This moves the annotation to the declaration and fixes the resulting warning. Signed-off-by: Bjorn Helgaas --- drivers/pci/bus.c | 4 +++- drivers/pci/pci-sysfs.c | 2 +- drivers/pci/pci.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 8647dc6..e54ddb5 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -174,7 +174,9 @@ int pci_bus_add_device(struct pci_dev *dev) * Can not put in pci_device_add yet because resources * are not assigned yet for some devices. */ - pci_create_sysfs_dev_files(dev); + retval = pci_create_sysfs_dev_files(dev); + if (retval) + return retval; dev->match_driver = true; retval = device_attach(&dev->dev); diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 9c6e9bb..aa551e2 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -1299,7 +1299,7 @@ error: return retval; } -int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) +int pci_create_sysfs_dev_files (struct pci_dev *pdev) { int retval; int rom_size = 0; diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 7346ee6..91b9ce6 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -8,7 +8,7 @@ /* Functions internal to the PCI core code */ -extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); +extern int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev); extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); #if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI) static inline void pci_create_firmware_label_files(struct pci_dev *pdev)