moving to is_power_of_2
Subsystems (6)
PATCH 4/5 moving to is_power_of_2
Removing instances of (n&(n-1)) for power of 2
check with is_power_of_2 from linux/log.h.
Signed-off-by vignesh babu <[email protected]>
--- drivers/block/rd.c | 2 +- drivers/net/cxgb3/cxgb3_main.c | 2 +- drivers/rtc/rtc-s3c.c | 1 + fs/ext4/super.c | 2 +- fs/ntfs/logfile.c | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-)
drivers/block/rd.c +1 -1
@@ -423,7 +423,7 @@ static int __init rd_init(void)int err = -ENOMEM ;if (rd_blocksize >PAGE_SIZE || rd_blocksize <512 || - (!is_power_of_2 (rd_blocksize))) { + (!is_power_of_2 (rd_blocksize))) {printk ("RAMDISK: wrong blocksize %d, reverting to defaults\n" , rd_blocksize); rd_blocksize =BLOCK_SIZE ;
drivers/net/cxgb3/cxgb3_main.c +1 -1
@@ -1794,7 +1794,7 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)if (copy_from_user (&m, useraddr,sizeof (m)))return -EFAULT ;if (!is_power_of_2 (m.rx_pg_sz) || - !is_power_of_2 (m.tx_pg_sz)) + !is_power_of_2 (m.tx_pg_sz))return -EINVAL ;/* not power of 2 */ if (!(m.rx_pg_sz &0x14000 ))return -EINVAL ;/* not 16KB or 64KB */
drivers/rtc/rtc-s3c.c +1 -0
@@ -311,6 +311,7 @@ static int s3c_rtc_ioctl(struct device *dev,case RTC_IRQP_SET :/* check for power of 2 */ +if (!arg || !is_power_of_2 (arg)) { ret = -EINVAL ; goto exit;
fs/ext4/super.c +1 -1
@@ -1645,7 +1645,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)if (EXT4_HAS_INCOMPAT_FEATURE (sb,EXT4_FEATURE_INCOMPAT_64BIT )) {if (sbi->s_desc_size <EXT4_MIN_DESC_SIZE_64BIT || sbi->s_desc_size >EXT4_MAX_DESC_SIZE || - !is_power_of_2 (sbi->s_desc_size)) { + !is_power_of_2 (sbi->s_desc_size)) {printk (KERN_ERR "EXT4-fs: unsupported descriptor size %lu\n" , sbi->s_desc_size);
fs/ntfs/logfile.c +1 -1
@@ -66,7 +66,7 @@ static bool ntfs_check_restart_page_header(struct inode *vi, logfile_log_page_size < NTFS_BLOCK_SIZE || logfile_system_page_size & (logfile_system_page_size - 1) || - !is_power_of_2(logfile_log_page_size)) { + !is_power_of_2(logfile_log_page_size)) {ntfs_error (vi->i_sb,"$LogFile uses unsupported page size." );return false; }
Signature · 12 lines
1.4.4.2 -- Regards, Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?" _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.osdl.org/mailman/listinfo/kernel-janitors