Re: [PATCH V3 04/25] smartpqi: add support for raid5 and raid6 writes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2021-01-08 at 22:56 +0000, Don.Brace@xxxxxxxxxxxxx wrote:
> 
> > +               }
> > +               if (rmd->blocks_per_row == 0)
> > +                       return PQI_RAID_BYPASS_INELIGIBLE; #if 
> > +BITS_PER_LONG == 32
> > +               tmpdiv = rmd->first_block;
> > +               do_div(tmpdiv, rmd->blocks_per_row);
> > +               rmd->row = tmpdiv;
> > +#else
> > +               rmd->row = rmd->first_block / rmd->blocks_per_row; 
> > +#endif
> 
> Why not always use do_div()?
> 
> Don: I had removed the BITS_PER_LONG check, was an attempt to clean
> up the code, but forgot we still need to support 32bit and I just re-
> added BITS_PER_LONG HUNKS. These HUNKS were there before I refactored
> the code so it predates me. Any chance I can leave this in? It's been
> through a lot of regression testing already...

My suggestion was to rather do the opposite, use the 32bit code (with
do_div()) for both 32bit and 64bit. AFAIK, this would work just fine 
(but not vice-versa). 

You can leave this in. It was just a suggestion how to improve
readability. Perhaps consider cleaning it up sometime later.

Regards,
Martin





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux