public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
  • * Re: [PATCH] blk-iocost: fix seq_printf compile type mismatch error
           [not found] <20230717141852.153965-1-carlos.bilbao@amd.com>
           [not found] ` <20230717141852.153965-1-carlos.bilbao-5C7GfCeVMHo@public.gmane.org>
    @ 2023-07-21 22:32 ` Carlos Bilbao
           [not found]   ` <93557f79-c12c-3c3f-2c25-9ba50a618daa-5C7GfCeVMHo@public.gmane.org>
      1 sibling, 1 reply; 11+ messages in thread
    From: Carlos Bilbao @ 2023-07-21 22:32 UTC (permalink / raw)
      To: tj, josef, axboe; +Cc: cgroups, linux-block, linux-kernel, amd
    
    On 7/17/23 9:18 AM, Carlos Bilbao wrote:
    > From: amd <amd@localhost.localdomain>
    > 
    > Fix two type mismatch errors encountered while compiling blk-iocost.c with
    > GCC version 13.1.1 that involved constant operator WEIGHT_ONE. Cast the
    > result of the division operation to (unsigned int) to match the expected
    > format specifier %u in two seq_printf invocations.
    > 
    > Reviewed-by: Carlos Bilbao <carlos.bilbao@amd.com>
    This should have been:
    
    Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
    
    > ---
    >  block/blk-iocost.c | 4 ++--
    >  1 file changed, 2 insertions(+), 2 deletions(-)
    > 
    > diff --git a/block/blk-iocost.c b/block/blk-iocost.c
    > index 495396425bad..4721009a3f03 100644
    > --- a/block/blk-iocost.c
    > +++ b/block/blk-iocost.c
    > @@ -3032,7 +3032,7 @@ static u64 ioc_weight_prfill(struct seq_file *sf, struct blkg_policy_data *pd,
    >  	struct ioc_gq *iocg = pd_to_iocg(pd);
    >  
    >  	if (dname && iocg->cfg_weight)
    > -		seq_printf(sf, "%s %u\n", dname, iocg->cfg_weight / WEIGHT_ONE);
    > +		seq_printf(sf, "%s %u\n", dname, (unsigned int)(iocg->cfg_weight / (unsigned int)WEIGHT_ONE));
    >  	return 0;
    >  }
    >  
    > @@ -3042,7 +3042,7 @@ static int ioc_weight_show(struct seq_file *sf, void *v)
    >  	struct blkcg *blkcg = css_to_blkcg(seq_css(sf));
    >  	struct ioc_cgrp *iocc = blkcg_to_iocc(blkcg);
    >  
    > -	seq_printf(sf, "default %u\n", iocc->dfl_weight / WEIGHT_ONE);
    > +	seq_printf(sf, "default %u\n", (unsigned int) (iocc->dfl_weight / (unsigned int)WEIGHT_ONE));
    >  	blkcg_print_blkgs(sf, blkcg, ioc_weight_prfill,
    >  			  &blkcg_policy_iocost, seq_cft(sf)->private, false);
    >  	return 0;
    
    Thanks,
    Carlos
    
    ^ permalink raw reply	[flat|nested] 11+ messages in thread

  • end of thread, other threads:[~2023-07-31 15:04 UTC | newest]
    
    Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20230717141852.153965-1-carlos.bilbao@amd.com>
         [not found] ` <20230717141852.153965-1-carlos.bilbao-5C7GfCeVMHo@public.gmane.org>
    2023-07-17 14:23   ` [PATCH] blk-iocost: fix seq_printf compile type mismatch error Carlos Bilbao
    2023-07-17 18:49   ` Tejun Heo
         [not found]     ` <ZLWNHuTGk0fy8pjE-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
    2023-07-18 15:37       ` Carlos Bilbao
    2023-07-20 20:05         ` Tejun Heo
    2023-07-19  8:57     ` David Laight
         [not found]       ` <2b4540aadc3c4449a192aeed6211f232-1XygrNkDbNvwg4NCKwmqgw@public.gmane.org>
    2023-07-20 20:06         ` 'Tejun Heo'
    2023-07-21  8:05           ` David Laight
         [not found]             ` <fd89f72848da4569a19ec8a1ac9ec94e-1XygrNkDbNvwg4NCKwmqgw@public.gmane.org>
    2023-07-21 17:58               ` 'Tejun Heo'
    2023-07-21 22:32 ` Carlos Bilbao
         [not found]   ` <93557f79-c12c-3c3f-2c25-9ba50a618daa-5C7GfCeVMHo@public.gmane.org>
    2023-07-22  1:14     ` Tejun Heo
         [not found]       ` <ZLstYbAzqkqwIRzy-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
    2023-07-31 15:04         ` Carlos Bilbao
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox