Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1974119rdd; Thu, 11 Jan 2024 15:37:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEf2J52/HFiJ6V4RJLVZehteRPbTPpbK3FO2d751hIWeeNkREOoZ2+QrRJTH1pCG5AZeYCD X-Received: by 2002:ac2:5d23:0:b0:50e:6332:8083 with SMTP id i3-20020ac25d23000000b0050e63328083mr85482lfb.183.1705016258844; Thu, 11 Jan 2024 15:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705016258; cv=none; d=google.com; s=arc-20160816; b=SyhatvgVTzToemdNin2r9Hpeqn0gvsN18yNtEMb3WNvww0CLeO00D6CY9dN7fFzbO7 ekZJzcvcGx6/Ud4DHVGS6/+Phr9vfWvZom1+U+pKLXVcEqJWWgoAqYfgLBlxXP9Cqsvs CwETIBH5AdbRcaMNatrg5bYgvw89eO+kT2xqLfTKuHZhrciJNRh3fE4InQwxurTsRTHL Y/midPyEF3WURperHLBSogEztsbPzvYN2A/OIW/BMD7e8f6qQw/JE6E/uOcqV2NCeLNc TILWkWqrCQ2CyOYETm4D3lewOT2Ktv/TVileYUm9fwpud8LcFuCY8/1Rj84ZU6X2hfnk ta5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=ElLHorNenk0WVFiV0weyHP60eY4HfbC1OSrYCfecHQs=; fh=NFqWUL5aEwUaDcadL2XEWrAuqejU/bdQ/hdOTOtqRgE=; b=t7YJYsOjuW4kCYldNyxVbRMtSnoEsgSuxn/R9y0PBppw/3GowyV9gf56Za++5wl7gI 4Ua38/wFrX11ZPj8yIhVJF2UQe7qTxHP1NYV4Zm0N1WTSGc9M1yTGzUp67KA7oiENboR aryqheJFfej4FTnlV99hDtLvfuhg3fyZpZwQFt4VBbjh2COVi5srqY4t3MjDwMed9mCP ckWgQKKC6Da6HvXCFyr2qF/HYpjZi6Sg6t8iElDyQgiUCNmIRNPnqIBEdIMJC+Q9ycGj mz/CasxI6bsvFlqqxNC9045lz4IsT5KFBvZWBOpASYZc1bBxZJahKBvdrEJWBL3UH/Ue ZL1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="H0CI/qll"; spf=pass (google.com: domain of linux-kernel+bounces-24136-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u11-20020aa7d0cb000000b00554020a5d4fsi926979edo.392.2024.01.11.15.37.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 15:37:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24136-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="H0CI/qll"; spf=pass (google.com: domain of linux-kernel+bounces-24136-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 932441F262BA for ; Thu, 11 Jan 2024 23:37:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C20359B7A; Thu, 11 Jan 2024 23:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H0CI/qll" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B31A8537FC; Thu, 11 Jan 2024 23:37:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35B63C433F1; Thu, 11 Jan 2024 23:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705016246; bh=4bSQrMnZYifA1saWZcTH1YMYj7OMXSJTX6H9lMKiWn4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=H0CI/qllVkBSSzyvoPhaFzIc62SuHe+lNZ8s5H82zd3u4vSlwkHoKPmm1x+AHH5Rr 215lPHx75hz1RSVQ/O3edaPH5C2oqTbMX8jelljJUtPuOyhjk6/6uO1K176zzO1kYJ pSBLpvRS+DmGYJuk1v/0ligPKLUHnN3vN47bINxTJygajvGZ6+xcHj0h1lSlpfQS59 0bD/W85q0mhhR4Di+aa/NXuytWqfNK6y7FS+quWtVjtVqmLR4tyX/WOKsUd78zV9T9 7yudIT6kbUHXabDdNF1jbb2TJ68qpJZoffTSlmX78WIcqTLfwfD/R2uuyTojHQC568 vC/QVwXTHlZbg== Message-ID: Date: Fri, 12 Jan 2024 08:37:23 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] block: print symbolic error name instead of error code Content-Language: en-US To: Christian Heusel , Jens Axboe , Dave Chinner , Jan Kara , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Christian Brauner , Min Li , Greg Kroah-Hartman , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org References: <20240111231521.1596838-1-christian@heusel.eu> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20240111231521.1596838-1-christian@heusel.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/12/24 08:15, Christian Heusel wrote: > 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); pr_err() ? > return true; > } > -- Damien Le Moal Western Digital Research