From patchwork Fri Jun 22 15:38:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 139701 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1021171lji; Fri, 22 Jun 2018 08:39:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIZM4SAkBCoiOL4hx7b486Yq4GBbA4rO82NgTbjZTiLChm4VFxp4YRr4/3ZlI30+1m1Hc99 X-Received: by 2002:a65:4c4d:: with SMTP id l13-v6mr1910676pgr.211.1529681945455; Fri, 22 Jun 2018 08:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529681945; cv=none; d=google.com; s=arc-20160816; b=YL90BEGVUm2SzJ6r3OJgxPnWxOgdZs0G/faUmoXozEcJ4Yts8rpE04ttRc862mR9Dr G9cW/GB/C0uCN9bYtPj9QMrmto9p3f58IfoNQGOMW3mmV+SkDcbO+mwSFEgcFnme7SpK 09Y/2LVtE0K5SjGaZz/aogDo+st8CzkrbutA+DnqOSxl/JDL8UUhqBWQW5t6vYiIff2I S/vFJEbJJZWXdrMMwlz5EYsaWygw1YsFR2RG2bl1DSd08hQjOVaLSlmX4hp4PVViCZUu OY2gLd39u97fg6GqXvjRHuW1jcY9Lj8cuZcx8S8LO7OySIvvgOt4jGhgv1DgfHuw1zGC b4cw== 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=kEib3t5baWUUZixPkjf2tBXHkBfLOTrP+6okUOtp47g=; b=RDpBWrm2dY0ppAmEIbcwyIdDoOIs/ubMcXaFJERqTI3Gcw+QW45TSpvpeKYQgAZkPH Kks9y6U6x+DTzjWLJBJZRm86U5EwdkGzCT1ODoa9od77Mxihgu2Bjc8fsxlCfw6DhPib dcLpyEhdILdT8JEEjvvS7YqAC+uHYhrsFsgQTMoj03s/GqtOkXwlAIPgOUXbzRt+cwBm TOHmhXyuK1Qt9eiMT0HS7ctFVcsP5RCbzdOVc9nx/pRCSpAAI/mLBTLYRn8zIFYQAO/t nMU5/FAFWd6Za6Oz8p6WLFvjpzY6EC8MhNPeUVsfZalVgH0Ui4h485pfl46aZqmi2H1D v7gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=JK0cR6d3; 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=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 134-v6si6597702pgc.116.2018.06.22.08.39.04; Fri, 22 Jun 2018 08:39:05 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=JK0cR6d3; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934294AbeFVPjD (ORCPT + 31 others); Fri, 22 Jun 2018 11:39:03 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:52931 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933977AbeFVPjA (ORCPT ); Fri, 22 Jun 2018 11:39:00 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id c85d39f4; Fri, 22 Jun 2018 15:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id; s=mail; bh=rYikv6ptkzdE6TLr0Amjt+aPpRw =; b=JK0cR6d3IT4+2/pv2Yo7tkcdok28iWOqd8DZdVTzi9N6Q5CTih5ortiG4kS 1Y5qe92FO6OkxyTb0U1xTxFXxEj0bEs7aQohwzepg/ypPMcg/fFZM+7iHL4vRGY8 xTNuYU3j9WFzc7M3E0NjWCpJXGO8G1i3EHaae4/zHF3LkjTBFa23BmMaT87lPxtB zCI9zdFZK6GIfr6N0iR4z9iCBvjE4TRKUwvFDFHqk27DKQpsXz+2SUVVfkWe45EZ 4l3k67Zn1rTqYz2OyKw6EkqoEvCnl3D+5uQEJcn5jVirvOvILMPu1ICpmB8iYt7D zXvGkp56RTVg9KUlyvIVf7ZCLYg== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 21ec1527 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 22 Jun 2018 15:32:43 +0000 (UTC) From: "Jason A. Donenfeld" To: jeyu@kernel.org, linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" Subject: [PATCH] module: print sensible error code Date: Fri, 22 Jun 2018 17:38:50 +0200 Message-Id: <20180622153850.24240-1-Jason@zx2c4.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Printing "err 0" to the user in the warning message is not particularly useful, especially when this gets transformed into a -ENOENT for the remainder of the call chain. Signed-off-by: Jason A. Donenfeld --- kernel/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/kernel/module.c b/kernel/module.c index f475f30eed8c..c666ab4139f4 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2282,9 +2282,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK) break; - pr_warn("%s: Unknown symbol %s (err %li)\n", - mod->name, name, PTR_ERR(ksym)); ret = PTR_ERR(ksym) ?: -ENOENT; + pr_warn("%s: Unknown symbol %s (err %d)\n", + mod->name, name, ret); break; default: