linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Remove unused functions found with clang
@ 2020-06-16 12:48 Sean Young
  2020-06-16 12:48 ` [PATCH 1/4] media: drx-k: remove unused MulDiv32 function Sean Young
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sean Young @ 2020-06-16 12:48 UTC (permalink / raw)
  To: linux-media

Sean Young (4):
  media: drx-k: remove unused MulDiv32 function
  media: nuvoton-cir: remove setting tx carrier functions
  media: fintek-cir: remove unused function fintek_clear_reg_bit
  media: cx23888: remove unused functions

 drivers/media/dvb-frontends/drxk_hard.c | 11 ---------
 drivers/media/pci/cx23885/cx23888-ir.c  | 20 ----------------
 drivers/media/rc/fintek-cir.c           |  7 ------
 drivers/media/rc/nuvoton-cir.c          | 32 -------------------------
 4 files changed, 70 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] media: drx-k: remove unused MulDiv32 function
  2020-06-16 12:48 [PATCH 0/4] Remove unused functions found with clang Sean Young
@ 2020-06-16 12:48 ` Sean Young
  2020-06-16 12:48 ` [PATCH 2/4] media: nuvoton-cir: remove setting tx carrier functions Sean Young
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sean Young @ 2020-06-16 12:48 UTC (permalink / raw)
  To: linux-media

This function has never been used. Found with clang:

drivers/media/dvb-frontends/drxk_hard.c:159:19: warning: unused function 'MulDiv32' [-Wunused-function]
static inline u32 MulDiv32(u32 a, u32 b, u32 c)

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/dvb-frontends/drxk_hard.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c
index 7e8e5c308d1c6..0ae9d8c72d8dc 100644
--- a/drivers/media/dvb-frontends/drxk_hard.c
+++ b/drivers/media/dvb-frontends/drxk_hard.c
@@ -155,17 +155,6 @@ if (debug >= level)							\
 	printk(KERN_DEBUG KBUILD_MODNAME ": %s " fmt, __func__, ##arg);	\
 } while (0)
 
-
-static inline u32 MulDiv32(u32 a, u32 b, u32 c)
-{
-	u64 tmp64;
-
-	tmp64 = (u64) a * (u64) b;
-	do_div(tmp64, c);
-
-	return (u32) tmp64;
-}
-
 static inline u32 Frac28a(u32 a, u32 c)
 {
 	int i = 0;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] media: nuvoton-cir: remove setting tx carrier functions
  2020-06-16 12:48 [PATCH 0/4] Remove unused functions found with clang Sean Young
  2020-06-16 12:48 ` [PATCH 1/4] media: drx-k: remove unused MulDiv32 function Sean Young
@ 2020-06-16 12:48 ` Sean Young
  2020-06-16 12:48 ` [PATCH 3/4] media: fintek-cir: remove unused function fintek_clear_reg_bit Sean Young
  2020-06-16 12:48 ` [PATCH 4/4] media: cx23888: remove unused functions Sean Young
  3 siblings, 0 replies; 5+ messages in thread
From: Sean Young @ 2020-06-16 12:48 UTC (permalink / raw)
  To: linux-media

Since this driver could never transmit IR, setting the tx carrier makes
no sense.

Fixes: 87284271b73b8 ("media: rc: nuvoton: remove rudimentary transmit functionality")

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/nuvoton-cir.c | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 48a69bf23236e..52d246dc5b3da 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -74,13 +74,6 @@ static inline void nvt_set_reg_bit(struct nvt_dev *nvt, u8 val, u8 reg)
 	nvt_cr_write(nvt, tmp, reg);
 }
 
-/* clear config register bit without changing other bits */
-static inline void nvt_clear_reg_bit(struct nvt_dev *nvt, u8 val, u8 reg)
-{
-	u8 tmp = nvt_cr_read(nvt, reg) & ~val;
-	nvt_cr_write(nvt, tmp, reg);
-}
-
 /* enter extended function mode */
 static inline int nvt_efm_enable(struct nvt_dev *nvt)
 {
@@ -631,30 +624,6 @@ static u32 nvt_rx_carrier_detect(struct nvt_dev *nvt)
 	return carrier;
 }
 #endif
-/*
- * set carrier frequency
- *
- * set carrier on 2 registers: CP & CC
- * always set CP as 0x81
- * set CC by SPEC, CC = 3MHz/carrier - 1
- */
-static int nvt_set_tx_carrier(struct rc_dev *dev, u32 carrier)
-{
-	struct nvt_dev *nvt = dev->priv;
-	u16 val;
-
-	if (carrier == 0)
-		return -EINVAL;
-
-	nvt_cir_reg_write(nvt, 1, CIR_CP);
-	val = 3000000 / (carrier) - 1;
-	nvt_cir_reg_write(nvt, val & 0xff, CIR_CC);
-
-	nvt_dbg("cp: 0x%x cc: 0x%x\n",
-		nvt_cir_reg_read(nvt, CIR_CP), nvt_cir_reg_read(nvt, CIR_CC));
-
-	return 0;
-}
 
 static int nvt_ir_raw_set_wakeup_filter(struct rc_dev *dev,
 					struct rc_scancode_filter *sc_filter)
@@ -1022,7 +991,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
 	rdev->encode_wakeup = true;
 	rdev->open = nvt_open;
 	rdev->close = nvt_close;
-	rdev->s_tx_carrier = nvt_set_tx_carrier;
 	rdev->s_wakeup_filter = nvt_ir_raw_set_wakeup_filter;
 	rdev->device_name = "Nuvoton w836x7hg Infrared Remote Transceiver";
 	rdev->input_phys = "nuvoton/cir0";
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] media: fintek-cir: remove unused function fintek_clear_reg_bit
  2020-06-16 12:48 [PATCH 0/4] Remove unused functions found with clang Sean Young
  2020-06-16 12:48 ` [PATCH 1/4] media: drx-k: remove unused MulDiv32 function Sean Young
  2020-06-16 12:48 ` [PATCH 2/4] media: nuvoton-cir: remove setting tx carrier functions Sean Young
@ 2020-06-16 12:48 ` Sean Young
  2020-06-16 12:48 ` [PATCH 4/4] media: cx23888: remove unused functions Sean Young
  3 siblings, 0 replies; 5+ messages in thread
From: Sean Young @ 2020-06-16 12:48 UTC (permalink / raw)
  To: linux-media

Found with clang:

drivers/media/rc/fintek-cir.c:55:20: warning: unused function 'fintek_clear_reg_bit' [-Wunused-function]
static inline void fintek_clear_reg_bit(struct fintek_dev *fintek, u8 val, u8 reg)

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/fintek-cir.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
index b74bb13161fd4..8e3177c5b5865 100644
--- a/drivers/media/rc/fintek-cir.c
+++ b/drivers/media/rc/fintek-cir.c
@@ -51,13 +51,6 @@ static inline void fintek_set_reg_bit(struct fintek_dev *fintek, u8 val, u8 reg)
 	fintek_cr_write(fintek, tmp, reg);
 }
 
-/* clear config register bit without changing other bits */
-static inline void fintek_clear_reg_bit(struct fintek_dev *fintek, u8 val, u8 reg)
-{
-	u8 tmp = fintek_cr_read(fintek, reg) & ~val;
-	fintek_cr_write(fintek, tmp, reg);
-}
-
 /* enter config mode */
 static inline void fintek_config_mode_enable(struct fintek_dev *fintek)
 {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] media: cx23888: remove unused functions
  2020-06-16 12:48 [PATCH 0/4] Remove unused functions found with clang Sean Young
                   ` (2 preceding siblings ...)
  2020-06-16 12:48 ` [PATCH 3/4] media: fintek-cir: remove unused function fintek_clear_reg_bit Sean Young
@ 2020-06-16 12:48 ` Sean Young
  3 siblings, 0 replies; 5+ messages in thread
From: Sean Young @ 2020-06-16 12:48 UTC (permalink / raw)
  To: linux-media; +Cc: Andy Walls

Found with clang:
drivers/media/pci/cx23885/cx23888-ir.c:178:19: warning: unused function 'ns_to_clock_divider' [-Wunused-function]
static inline u16 ns_to_clock_divider(unsigned int ns)
                  ^
drivers/media/pci/cx23885/cx23888-ir.c:184:28: warning: unused function 'clock_divider_to_ns' [-Wunused-function]
static inline unsigned int clock_divider_to_ns(unsigned int divider)
                           ^
drivers/media/pci/cx23885/cx23888-ir.c:202:19: warning: unused function 'freq_to_clock_divider' [-Wunused-function]
static inline u16 freq_to_clock_divider(unsigned int freq,
                  ^

Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/pci/cx23885/cx23888-ir.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c
index d59ca3601785e..ad7f8ccad526c 100644
--- a/drivers/media/pci/cx23885/cx23888-ir.c
+++ b/drivers/media/pci/cx23885/cx23888-ir.c
@@ -175,19 +175,6 @@ static inline u16 count_to_clock_divider(unsigned int d)
 	return (u16) d;
 }
 
-static inline u16 ns_to_clock_divider(unsigned int ns)
-{
-	return count_to_clock_divider(
-		DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ / 1000000 * ns, 1000));
-}
-
-static inline unsigned int clock_divider_to_ns(unsigned int divider)
-{
-	/* Period of the Rx or Tx clock in ns */
-	return DIV_ROUND_CLOSEST((divider + 1) * 1000,
-				 CX23888_IR_REFCLK_FREQ / 1000000);
-}
-
 static inline u16 carrier_freq_to_clock_divider(unsigned int freq)
 {
 	return count_to_clock_divider(
@@ -199,13 +186,6 @@ static inline unsigned int clock_divider_to_carrier_freq(unsigned int divider)
 	return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, (divider + 1) * 16);
 }
 
-static inline u16 freq_to_clock_divider(unsigned int freq,
-					unsigned int rollovers)
-{
-	return count_to_clock_divider(
-		   DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, freq * rollovers));
-}
-
 static inline unsigned int clock_divider_to_freq(unsigned int divider,
 						 unsigned int rollovers)
 {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-16 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 12:48 [PATCH 0/4] Remove unused functions found with clang Sean Young
2020-06-16 12:48 ` [PATCH 1/4] media: drx-k: remove unused MulDiv32 function Sean Young
2020-06-16 12:48 ` [PATCH 2/4] media: nuvoton-cir: remove setting tx carrier functions Sean Young
2020-06-16 12:48 ` [PATCH 3/4] media: fintek-cir: remove unused function fintek_clear_reg_bit Sean Young
2020-06-16 12:48 ` [PATCH 4/4] media: cx23888: remove unused functions Sean Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).