From: Chhabilal Dangal <yogeshdangal66@gmail.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Teddy Wang <teddy.wang@siliconmotion.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Chhabilal Dangal <yogeshdangal66@gmail.com>
Subject: [PATCH v1 1/2] staging: sm750fb: remove unused #include directives
Date: Tue, 12 May 2026 10:32:31 +0545 [thread overview]
Message-ID: <20260512044732.56417-1-yogeshdangal66@gmail.com> (raw)
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
Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
---
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(-)
diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c
index 0f94d859e91c..0100fec6533b 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -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"
diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
index 7ede144905c9..552fd30e0d38 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -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_cursor.h"
@@ -130,46 +129,3 @@ void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop,
}
}
}
-
-void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop,
- const u8 *pcol, const u8 *pmsk)
-{
- int i, j, count, pitch, offset;
- u8 color, mask;
- u16 data;
- void __iomem *pbuffer, *pstart;
-
- /* in byte*/
- pitch = cursor->w >> 3;
-
- /* in byte */
- count = pitch * cursor->h;
-
- /* in byte */
- offset = cursor->max_w * 2 / 8;
-
- data = 0;
- pstart = cursor->vstart;
- pbuffer = pstart;
-
- for (i = 0; i < count; i++) {
- color = *pcol++;
- mask = *pmsk++;
- data = 0;
-
- for (j = 0; j < 8; j++) {
- if (mask & (1 << j))
- data |= ((color & (1 << j)) ? 1 : 2) << (j * 2);
- }
- iowrite16(data, pbuffer);
-
- /* assume pitch is 1,2,4,8,...*/
- if (!(i & (pitch - 1))) {
- /* need a return */
- pstart += offset;
- pbuffer = pstart;
- } else {
- pbuffer += sizeof(u16);
- }
- }
-}
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index a2798d428663..f491d3aca468 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -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"
--
2.54.0
next reply other threads:[~2026-05-12 4:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 4:47 Chhabilal Dangal [this message]
2026-05-12 5:37 ` [PATCH v1 1/2] staging: sm750fb: remove unused #include directives Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260512044732.56417-1-yogeshdangal66@gmail.com \
--to=yogeshdangal66@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=sudipm.mukherjee@gmail.com \
--cc=teddy.wang@siliconmotion.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox