From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5A9AFA3740 for ; Mon, 31 Oct 2022 12:24:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbiJaMYg (ORCPT ); Mon, 31 Oct 2022 08:24:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbiJaMYa (ORCPT ); Mon, 31 Oct 2022 08:24:30 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE6D01E3; Mon, 31 Oct 2022 05:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+WDg5qNBe76FnzbLrO8nDJQ46OMFpJ0zF+2XMGbgyVw=; b=G2KuZBTUsRRYlM25mWS2OzlfUW vRYmMylWTdj4cHrNo7JgTSQnawMwdiX2LlU1I4+ApxI+kAoZisrbAr8zzcpg/S005SSbFiLHHGUqG 143M/86X3wEWKmpvLtPVqr1zYq5diK4PaOJAijthuaIugtmkywdHIz4FognofoOqYu2rhQ3DxCoGg gJY5lWQ8XPUvodlopUo4ayTh4utr4yFpoOaWGXsSjvzd/+CGTzGZZeH2nFk0GBA3O0x66is3Gp3AY JJvY2LLviOSEGgZex8koGgxEfC3gHovSwgpHYmzWnSl24pvHiWjugg9SIzCM8PdhCbDHnJ5NvKZSq X048//cQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1opTq8-00BeDl-3K; Mon, 31 Oct 2022 12:24:28 +0000 Date: Mon, 31 Oct 2022 05:24:28 -0700 From: Christoph Hellwig To: "Jiri Slaby (SUSE)" Cc: tj@kernel.org, linux-kernel@vger.kernel.org, Martin Liska , Josef Bacik , Jens Axboe , cgroups@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH] block/blk-iocost (gcc13): cast enum members to int in prints Message-ID: References: <20221031114520.10518-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221031114520.10518-1-jirislaby@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 31, 2022 at 12:45:20PM +0100, Jiri Slaby (SUSE) wrote: > Cast the enum members to int when printing them. > > Alternatively, we can cast them to ulong (to silence gcc < 12) and use %lu. > Alternatively, we can move VTIME_PER_SEC away from the enum. Yes, either split the enum or just use a define. But casts are a big code smell and should be avoided if there is a reasonable alternative.