Skip to contentSkip to conversation

staging: sm750fb: remove unused #include directives

PATCH In review Chhabilal Dangal 2 participants 2 messages May 12

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: sm750fb: remove unused #include directives

sm750_hw.c includes <asm/mtrr.h> under #ifdef CONFIG_MTRR, but no mtrr_add/mtrr_del calls exist in the file; the driver uses arch_phys_wc_add/arch_phys_wc_del in sm750.c instead.

sm750_hw.c, sm750_accel.c, and sm750_cursor.c all include <linux/platform_device.h>, but none use any platform device APIs. This is a PCI driver.

Remove these dead includes per the TODO item to refine the code and remove unused code.

Tested by building the full kernel and module with CONFIG_FB_SM750=m on x86_64:
make -j$(nproc)
make M=drivers/staging/sm750fb modules

---
 drivers/staging/sm750fb/sm750_accel.c  |  1 -
 drivers/staging/sm750fb/sm750_cursor.c | 44 --------------------------
 drivers/staging/sm750fb/sm750_hw.c     |  4 ---
 3 files changed, 49 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +0 -1
index 0f94d859e91c..0100fec6533b 100644
@@ -13,7 +13,6 @@
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/console.h>
-#include <linux/platform_device.h>
 
 #include "sm750.h"
 #include "sm750_accel.h"
drivers/staging/sm750fb/sm750_cursor.c +0 -44

53 lines not on this page · raw message

drivers/staging/sm750fb/sm750_hw.c +0 -4
index a2798d428663..f491d3aca468 100644
@@ -13,10 +13,6 @@
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/console.h>
-#ifdef CONFIG_MTRR
-#include <asm/mtrr.h>
-#endif
-#include <linux/platform_device.h>
 #include <linux/sizes.h>
 
 #include "sm750.h"
Signature · 1 line
2.54.0
#1 lore raw
Quoted 7 lines · Chhabilal Dangal

sm750_hw.c includes <asm/mtrr.h> under #ifdef CONFIG_MTRR, but no mtrr_add/mtrr_del calls exist in the file; the driver uses arch_phys_wc_add/arch_phys_wc_del in sm750.c instead.

sm750_hw.c, sm750_accel.c, and sm750_cursor.c all include <linux/platform_device.h>, but none use any platform device APIs. This is a PCI driver.

These are statements that don't really describe anything :(

Quoted 7 lines

Remove these dead includes per the TODO item to refine the code and remove unused code.

Tested by building the full kernel and module with CONFIG_FB_SM750=m on x86_64:
make -j$(nproc)
make M=drivers/staging/sm750fb modules

You don't need to have these lines, it is assumed you test-built this.

Quoted 1 line

You need a blank line before this line.

Also, your patches were not properly connected, please use a tool like git send-email to send them out.

Also, you are doing multiple things in this patch, please, only one logical thing per commit.

thanks,

greg k-h