Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1965785rdd; Thu, 11 Jan 2024 15:16:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn5wOLMGpHxX7MORw8wkju3Dm9mkivHCIitsrLZpHtNQ3TQueJrjrtDmAb/gY2F0F+BCy6 X-Received: by 2002:a81:4001:0:b0:5f5:63ee:6adf with SMTP id l1-20020a814001000000b005f563ee6adfmr486990ywn.93.1705014996231; Thu, 11 Jan 2024 15:16:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705014996; cv=none; d=google.com; s=arc-20160816; b=wifUZtmGCcp5WjpgymgEv6YRmSZFVXvFS3GORZo7Mfw3zYTg0Qa/i+5blyt5IIHCyH 1dLReNgw+y8Y6LSKvVZ084DTdGjepX6vv61fPKpbEa0tNk5jDGBFqZKawhHFPlAf9325 JvGnXpqyTeehtfr062gLLmbEzI+47xCQmENNcSK7HuvysIhYhDUZHSpN/+9nDoqHPG5B t6c4goc0olargh/eo0lKFxTi4IRsAGQNWzkR8XEg3BixJ8OsYEj6wrCGwk9S29mQSgWQ TFzuwthNseRCR2jNei7yT43uYwjgSr+ip2Ao6KBVNdvVN8v7gE9NbtL4ON1cco0zNYPU PXlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=zPyt/kWrN8wgWIophtBb5fPG+0UsJrYGi7vMRWRmk2w=; fh=ogiURflXMMN8OaDxisZsP6gubi4Q5hjBanVWGjhNggs=; b=Wv7FRH5S9nPgNUApWUOAn02RMLmWCwZxuSohO5wXO6uc209XPCq95cChvFJdRb+81g 0KgkwLs6MT/uigE9sLHwGYfwt4te0JP5sPNvXAuTH6WqhsEYPO3pU5Tbs1+3nxNmguzY uvuc7FOnuO8pRoco1j2gINwbResHZ1S+Z/KFF++ysNG1PfvMgapTuCy41TTEA0znfoIh SfGEdGyH213SfhS3FmrND33MYUlzbzpnByI9jez78JdYB+WQJql9nyAVUNk4Lrb/Kgu7 ouP2UCKp9gxzh840GgRroc2w8C6HzXWeg7lGBuDFuwO6vRKoJbNmiu/2qgehcwyaQKbb gYOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24126-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e14-20020a0cb44e000000b0068077cd22c7si1760337qvf.190.2024.01.11.15.16.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 15:16:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24126-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F318E1C23A55 for ; Thu, 11 Jan 2024 23:16:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C36CF59B4B; Thu, 11 Jan 2024 23:16:01 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F96A59B40; Thu, 11 Jan 2024 23:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=heusel.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=heusel.eu Received: from meterpeter.fritz.box ([84.170.86.196]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MRCFw-1rl4nb1Rzg-00NCGL; Fri, 12 Jan 2024 00:15:43 +0100 From: Christian Heusel To: Jens Axboe , Dave Chinner , Jan Kara , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Christian Brauner , Min Li , Christian Heusel , Greg Kroah-Hartman , Damien Le Moal , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org Subject: [PATCH] block: print symbolic error name instead of error code Date: Fri, 12 Jan 2024 00:15:18 +0100 Message-ID: <20240111231521.1596838-1-christian@heusel.eu> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:hRXS/pbCGGcWgW+YdsFtf7CISoZpfbLekLeh/9dCbsXEE+9Xmnt 6y1MThGhnBIcgxOwTuF41kb4eXoDRY9XGjiBiz6RGFPYa/rB2ZDq4gczVKkFlweNG3FRwpZ HlvHqv0w3OiCRtBc5IXiWh1OVDl6pV8olZr4v4y6TciQinC8GiKWlHuOwxOK1e1dIIuaKKZ 9h1IGa9JE7asMxdQYJBhw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YOEeGaZNxuM=;yLWzStPVr+/wfRyPQxeTyK3BP1T ooVIDDk8C/vXNQviLslzRLDVLCO4fdbjW/F0pLyeqoO+5btQsRb7ZwGDAEbukrPC0sQ5cUe5/ +Rh2Db1kc/lAELadQlfadrICs7dt8emJ/uV0/pKNb0Pl0g9RGtJO0FK80uar4BCPnfY5dnpia rlVcTvwvhhUsmS8pZZuXKPFjY0Nxpj7AkMkZSQz97F+h8rcUAwENSPGTIxk9qEbr/AkT3BieS 0/jCE0ZP8QxzmurTOPdn8JEOP7wDbeg7QiAhzMg2j0NtlDWX+Qaf8Hr5mIjaC6W/E9px/2VJV QKx6/tXxlrdP5YdNotHSKGB3YJbveYDxxncBdm2QJxZdeNofcjZi/q4WOrOwvC82m3egGwlwQ hXkdmTFfoIXa1g20/skVHJEsr9+DE1WfcP6ui/EsXvD/7rOjiMtP809A0gb4h4VoVyo60VIRl xr2PL2bkoc5vVrFpr7eIUsoOv6oayaX5pbt5S7HWpaxlDzIdfu1xNWcvpDZDNe4e9zFAFfdHB YIhOHJXUoo44t45htTz318dagKOaemAHzy3a7uRV8pnFzP7UqDTpoGGp/EmrzyMv5IwUCzqba jbQe/cxvd8pFNjjhcx00PspBnsQr6u47pKQXLY2VEBN1/B3/fHMmJnrV2HQrjHZhP4UM7W2Qr oVfXvXrF+f+D/utrzSvKlIdm0SCYJg/EOx14NigDJkJ+spiE0qw9Vd651iyuzPGBAkwWnI8sx Vzj675/uGMA+gVsN66zI0/zTB6vKA5zU8xEextRg4Y7pnncFkqr0fU3X++o5TmadVp8urE9MO KyRWR1QPgOBa8tP6gLLZ5BLBBs0pCHjfxqZW9exW7IB0g7OYSMzZ/EJZoMuPIQsF5ye4SdN3c T6QLJ3yLFqJmUJg== Utilize the %pe print specifier to get the symbolic error name as a string (i.e "-ENOMEM") in the log message instead of the error code to increase its readablility. This change was suggested in https://lore.kernel.org/all/92972476-0b1f-4d0a-9951-af3fc8bc6e65@suswa.mountain/ Signed-off-by: Christian Heusel --- block/partitions/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index f47ffcfdfcec..932df4db76f1 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -570,8 +570,8 @@ static bool blk_add_partition(struct gendisk *disk, part = add_partition(disk, p, from, size, state->parts[p].flags, &state->parts[p].info); if (IS_ERR(part) && PTR_ERR(part) != -ENXIO) { - printk(KERN_ERR " %s: p%d could not be added: %ld\n", - disk->disk_name, p, -PTR_ERR(part)); + printk(KERN_ERR " %s: p%d could not be added: %pe\n", + disk->disk_name, p, part); return true; } -- 2.43.0