| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/blkfront: fix ring info addressing
 On 05.03.20 11:49, Roger Pau Monné wrote: On Thu, Mar 05, 2020 at 11:03:31AM +0100, Juergen Gross wrote: Yes, can change that. I however think this macro is kind of weird, since it's just doing an addition. I would rather have that calculation in get_rinfo and code for_each_rinfo on top of that. I wanted to avoid the multiplication in the rather common for_each_rinfo() usage. I agree this might be a question of taste, so I'm not going to insist but that would reduce the number of helpers from 3 to 2.+ +#define for_each_rinfo(info, rinfo, idx) \ + for (rinfo = info->rinfo, idx = 0; \ + idx < info->nr_rings; \ + idx++, rinfo = rinfo_ptr(rinfo, info->rinfo_size))I think the above is missing proper parentheses around macro parameters. rinfo and idx are simple variables, so I don't think they need parentheses. info maybe. But just seeing it now: naming the parameter "rinfo" and trying to access info->rinfo isn't a good idea. It is working only as I always use "rinfo" as the pointer. + +static struct blkfront_ring_info *get_rinfo(struct blkfront_info *info, + unsigned int i)inline attribute might be appropriate here. See "the inline disease" in the kernel's coding style. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel 
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |