From patchwork Fri Apr 12 20:48:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2437961 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 63EE7DF2A1 for ; Fri, 12 Apr 2013 20:48:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754231Ab3DLUsR (ORCPT ); Fri, 12 Apr 2013 16:48:17 -0400 Received: from mail-ia0-f171.google.com ([209.85.210.171]:47987 "EHLO mail-ia0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753848Ab3DLUsR (ORCPT ); Fri, 12 Apr 2013 16:48:17 -0400 Received: by mail-ia0-f171.google.com with SMTP id f27so884160iae.16 for ; Fri, 12 Apr 2013 13:48:16 -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=2EcUjGxL0tl76HrBcte8SqaVyU99/jdggSJre8lkrcQ=; b=W07xqs/ZAwCro63ZKD/pMqxYaKyeXvtFpXTpT8vjJQgFrIdYu+Dw1CDONzPnmcYSa+ c/hV/RDi602JP7QV31nSTYrN2UTPfFqR8VYXYW1ZwPn9IrSqkJbvo7votyzqhF/Qlw36 3vVTo5v/lqD2goki/cOfT2BD5z8ckNLLjfCB7eKHyQVtewcN3+SHblAqDEtWJ6jehZhL DOM8ZDE60AUPlAK9Ln2GNTrrZXiTojA5w0ZW9TOXMrCuQ0ZCXzItOw/6MlJaTlh2EsdO SL47xZSCM/66Tl/srrKCQ0ETuTMSCiM+v5ovLRrO/RgUZrqbZ1vz/BfWevpYFq0dgi9Z nqBQ== 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=2EcUjGxL0tl76HrBcte8SqaVyU99/jdggSJre8lkrcQ=; b=PSIK1pO4fprIJ5VFpc3AShxuV8hvPoN3z7KE0K4+NieHl5CWgxyXnMB6v6UIpTFSQX z2KGbJ/K+B60sizCIxWyuzlZXW6cjKrSWZMO86cjHaN9RUM/lOfLdZQrzSiVmZZypYIu UjkReQwuYljYDLMD7BSWbd0eOEgM9GfQDvqcFbn0/Vhs7U8Wtp5PLTcknK91tYm283Zv WKSxSxJWuM/a66ClJOOvLV+KrhB4peVrbYDo9mXeGiff8w8wq98Y1nLAsy3Zqk5lNaPA AzckPQHakI0ZhFZQuz4zRRyCUcQaGJVNYW0Q8PgCM2ksATBQ1O1AjusAsBrHwovDGBB4 Pdmg== X-Received: by 10.42.133.74 with SMTP id g10mr7281921ict.32.1365799696725; Fri, 12 Apr 2013 13:48:16 -0700 (PDT) Received: from localhost ([172.16.49.242]) by mx.google.com with ESMTPS id p11sm27061igr.4.2013.04.12.13.48.15 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Apr 2013 13:48:16 -0700 (PDT) Subject: [PATCH 5/6] PCI: Warn about failures instead of "must_check" functions To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: "Rafael J. Wysocki" , Andy Shevchenko Date: Fri, 12 Apr 2013 14:48:14 -0600 Message-ID: <20130412204814.5237.92891.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: ALoCoQlMNITrjtXkfJqDwfo+TnXjpvxStgaPg+dysFrpVCNrVZY4X5VyDZgNmnrBsFXtC0YcR+woU7G2O8QXVxOxvioKuSBRWo191GNmliBleNcJKbWTYVtt70wXpyEImyEdJL6E/ZEHFW3cmM+1SOsDhtMr1kR7TnZXB+L9nTXBdl393cGbEVcGe/Bw5sX/xhABegu8lHhVS9QtlzzimD4eS6oKEkn9fHxMzoJscl7rj/R7QqeJw58= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org These places capture return values to avoid "must_check" warnings, but we didn't *do* anything with the return values, which causes "set but not used" warnings. We might as well do something instead of just trying to evade the "must_check" warnings. Signed-off-by: Bjorn Helgaas --- drivers/pci/bus.c | 3 +++ drivers/pci/setup-bus.c | 2 ++ drivers/pci/slot.c | 7 +++++-- 3 files changed, 10 insertions(+), 2 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 e54ddb5..91b3c55 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -204,6 +204,9 @@ void pci_bus_add_devices(const struct pci_bus *bus) if (dev->is_added) continue; retval = pci_bus_add_device(dev); + if (retval) + dev_err(&dev->dev, "Error adding device (%d)\n", + retval); } list_for_each_entry(dev, &bus->devices, bus_list) { diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 502a75e..16abaaa 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1545,6 +1545,8 @@ again: enable_all: retval = pci_reenable_device(bridge); + if (retval) + dev_err(&bridge->dev, "Error reenabling bridge (%d)\n", retval); pci_set_master(bridge); pci_enable_bridges(parent); } diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index ac6412f..c1e9284 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c @@ -377,14 +377,17 @@ void pci_hp_create_module_link(struct pci_slot *pci_slot) { struct hotplug_slot *slot = pci_slot->hotplug; struct kobject *kobj = NULL; - int no_warn; + int ret; if (!slot || !slot->ops) return; kobj = kset_find_obj(module_kset, slot->ops->mod_name); if (!kobj) return; - no_warn = sysfs_create_link(&pci_slot->kobj, kobj, "module"); + ret = sysfs_create_link(&pci_slot->kobj, kobj, "module"); + if (ret) + dev_err(&pci_slot->bus->dev, "Error creating sysfs link (%d)\n", + ret); kobject_put(kobj); } EXPORT_SYMBOL_GPL(pci_hp_create_module_link);