Skip to contentSkip to conversation

staging: sm750fb: Remove unnecessary function

PATCH In review Nishka Dasgupta 3 participants 10 messages Mar 15, 2019 – Mar 18, 2019

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

PATCH 1/1 staging: sm750fb: Remove unnecessary function

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

---
 drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
 drivers/staging/sm750fb/ddk750_sii164.h |  1 -
 2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -13
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
 	return -1;
 }
 
-/* below sii164 function is not necessary */
-
 #ifdef SII164_FULL_FUNCTIONS
 
-/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
 /*
  * sii164GetChipString
  *      This function returns a char string name of the current DVI Controller chip.
drivers/staging/sm750fb/ddk750_sii164.h +0 -1
index 862e7bf27353..1f7b5f9c1885 100644
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
 unsigned short sii164GetDeviceID(void);
 
 #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
 char *sii164GetChipString(void);
 void sii164SetPower(unsigned char powerUp);
 void sii164EnableHotPlugDetection(unsigned char enableHotPlug);
Signature · 1 line
2.19.1
#1 lore raw
Quoted 2 lines · Nishka Dasgupta' via outreachy-kernel

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

I think that this is not the best justification for removing something. Is the function ever called in the kernel? If not, it should go.

julia

Quoted 55 lines
---
 drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
 drivers/staging/sm750fb/ddk750_sii164.h |  1 -
 2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -13
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
 	return -1;
 }
 
-/* below sii164 function is not necessary */
-
 #ifdef SII164_FULL_FUNCTIONS
 
-/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
 /*
  * sii164GetChipString
  *      This function returns a char string name of the current DVI Controller chip.
drivers/staging/sm750fb/ddk750_sii164.h +0 -2
index 862e7bf27353..1f7b5f9c1885 100644
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
 unsigned short sii164GetDeviceID(void);
 
 #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
 char *sii164GetChipString(void);
 void sii164SetPower(unsigned char powerUp);
 void sii164EnableHotPlugDetection(unsigned char enableHotPlug);
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190315102007.26612-1-nishka.dasgupta%40yahoo.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 9 lines · Julia Lawall
Quoted 2 lines · Nishka Dasgupta' via outreachy-kernel

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

I think that this is not the best justification for removing something. Is the function ever called in the kernel? If not, it should go.

I don't think it's ever called in the kernel. I compiled sm750fb by itself and then the entire kernel after removing the function.
- Nishka

Quoted 57 lines

julia

Quoted 55 lines
---
  drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
  drivers/staging/sm750fb/ddk750_sii164.h |  1 -
  2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -13
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
  	return -1;
  }
 
-/* below sii164 function is not necessary */
-
  #ifdef SII164_FULL_FUNCTIONS
 
-/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
  /*
   * sii164GetChipString
   *      This function returns a char string name of the current DVI Controller chip.
drivers/staging/sm750fb/ddk750_sii164.h +0 -2
index 862e7bf27353..1f7b5f9c1885 100644
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
  unsigned short sii164GetDeviceID(void);
 
  #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
  char *sii164GetChipString(void);
  void sii164SetPower(unsigned char powerUp);
  void sii164EnableHotPlugDetection(unsigned char enableHotPlug);
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190315102007.26612-1-nishka.dasgupta%40yahoo.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 7 lines · Nishka Dasgupta
Quoted 4 lines · Julia Lawall

On Fri, 15 Mar 2019, 'Nishka Dasgupta' via outreachy-kernel wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

I think that this is not the best justification for removing something. Is the function ever called in the kernel? If not, it should go.

I don't think it's ever called in the kernel. I compiled sm750fb by itself and then the entire kernel after removing the function.

OK, you can also check with grep. It's not always reliable due to the interaction with macros that can create names, but it does give some useful information. Compilation is not a perfect test either, because it is sensitive to the chosen configuration.

julia

Quoted 66 lines

- Nishka

Quoted 63 lines

julia

Quoted 61 lines
---
  drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
  drivers/staging/sm750fb/ddk750_sii164.h |  1 -
  2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -13
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
  	return -1;
  }
 
-/* below sii164 function is not necessary */
-
  #ifdef SII164_FULL_FUNCTIONS
 
-/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
  /*
   * sii164GetChipString
   *      This function returns a char string name of the current DVI

Controller chip.

drivers/staging/sm750fb/ddk750_sii164.h +0 -2
index 862e7bf27353..1f7b5f9c1885 100644
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
  unsigned short sii164GetDeviceID(void);
 
  #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
  char *sii164GetChipString(void);
  void sii164SetPower(unsigned char powerUp);
  void sii164EnableHotPlugDetection(unsigned char enableHotPlug);
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/20190315102007.26612-1-nishka.dasgupta%40yahoo.com.
For more options, visit https://groups.google.com/d/optout.

maintainer
#4 lore raw
In reply to Nishka Dasgupta
Quoted 40 lines · Nishka Dasgupta

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

---
 drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
 drivers/staging/sm750fb/ddk750_sii164.h |  1 -
 2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -13
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
 	return -1;
 }
 
-/* below sii164 function is not necessary */
-
 #ifdef SII164_FULL_FUNCTIONS
 
-/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
 /*
  * sii164GetChipString
  *      This function returns a char string name of the current DVI Controller chip.
drivers/staging/sm750fb/ddk750_sii164.h +0 -0
index 862e7bf27353..1f7b5f9c1885 100644

drivers/staging/sm750fb/ddk750_sii164.h unsigned short sii164GetVendorID(void); · line 33

Quoted 7 lines
drivers/staging/sm750fb/ddk750_sii164.h +0 -1
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
 unsigned short sii164GetDeviceID(void);
 
 #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
 char *sii164GetChipString(void);
 void sii164SetPower(unsigned char powerUp);
 void sii164EnableHotPlugDetection(unsigned char enableHotPlug);

Did you test build this? This function is still used if SII164_FULL_FUNCTIONS is defined.

thanks,

greg k-h

#5 lore raw
Quoted 43 lines · Greg KH
Quoted 42 lines · Nishka Dasgupta

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

---
  drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
  drivers/staging/sm750fb/ddk750_sii164.h |  1 -
  2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -13
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
  	return -1;
  }
 
-/* below sii164 function is not necessary */
-
  #ifdef SII164_FULL_FUNCTIONS
 
-/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
  /*
   * sii164GetChipString
   *      This function returns a char string name of the current DVI Controller chip.
drivers/staging/sm750fb/ddk750_sii164.h +0 -0
index 862e7bf27353..1f7b5f9c1885 100644
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
  unsigned short sii164GetDeviceID(void);
 
Quoted 8 lines

drivers/staging/sm750fb/ddk750_sii164.h unsigned short sii164GetVendorID(void); · line 33

Quoted 5 lines
drivers/staging/sm750fb/ddk750_sii164.h +0 -1
  #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
  char *sii164GetChipString(void);
  void sii164SetPower(unsigned char powerUp);
  void sii164EnableHotPlugDetection(unsigned char enableHotPlug);

Did you test build this? This function is still used if SII164_FULL_FUNCTIONS is defined.

Yes, I did test build this, and there were no problems. However, I have not been able to properly grep search for it since my laptop crashed a few days ago and I have only just been able to set everything back up. Where can I find SII164_FULL_FUNCTIONS?

Thanking you,
Nishka

Quoted 5 lines

thanks,

greg k-h

maintainer
#6 lore raw
Quoted 52 lines · NIshka Dasgupta
Quoted 40 lines · Greg KH
Quoted 39 lines · Nishka Dasgupta

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

---
  drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
  drivers/staging/sm750fb/ddk750_sii164.h |  1 -
  2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -13
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
  	return -1;
  }
-/* below sii164 function is not necessary */
-
  #ifdef SII164_FULL_FUNCTIONS
-/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
  /*
   * sii164GetChipString
   *      This function returns a char string name of the current DVI Controller chip.
drivers/staging/sm750fb/ddk750_sii164.h +0 -0
index 862e7bf27353..1f7b5f9c1885 100644
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
  unsigned short sii164GetDeviceID(void);
Quoted 8 lines

drivers/staging/sm750fb/ddk750_sii164.h unsigned short sii164GetVendorID(void); · line 33

Quoted 5 lines
drivers/staging/sm750fb/ddk750_sii164.h +0 -1
  #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
  char *sii164GetChipString(void);
  void sii164SetPower(unsigned char powerUp);
  void sii164EnableHotPlugDetection(unsigned char enableHotPlug);

Did you test build this? This function is still used if SII164_FULL_FUNCTIONS is defined.

Quoted 4 lines

Yes, I did test build this, and there were no problems. However, I have not been able to properly grep search for it since my laptop crashed a few days ago and I have only just been able to set everything back up. Where can I find SII164_FULL_FUNCTIONS?

'git grep SII164_FULL_FUNCTIONS' in the kernel source tree and you will find it.

thanks,

greg k-h

#7 lore raw
In reply to NIshka Dasgupta
Quoted 55 lines · NIshka Dasgupta' via outreachy-kernel
Quoted 43 lines · Greg KH
Quoted 42 lines · Nishka Dasgupta

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

---
  drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
  drivers/staging/sm750fb/ddk750_sii164.h |  1 -
  2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -11
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
  	return -1;
  }
  -/* below sii164 function is not necessary */
-
  #ifdef SII164_FULL_FUNCTIONS
  -/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
  /*
   * sii164GetChipString
   *      This function returns a char string name of the current DVI

Controller chip.

drivers/staging/sm750fb/ddk750_sii164.h +0 -0
index 862e7bf27353..1f7b5f9c1885 100644
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
  unsigned short sii164GetDeviceID(void);
Quoted 8 lines

drivers/staging/sm750fb/ddk750_sii164.h unsigned short sii164GetVendorID(void); · line 33

Quoted 5 lines
drivers/staging/sm750fb/ddk750_sii164.h +0 -1
    #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
  char *sii164GetChipString(void);
  void sii164SetPower(unsigned char powerUp);
  void sii164EnableHotPlugDetection(unsigned char enableHotPlug);

Did you test build this? This function is still used if SII164_FULL_FUNCTIONS is defined.

Quoted 4 lines

Yes, I did test build this, and there were no problems. However, I have not been able to properly grep search for it since my laptop crashed a few days ago and I have only just been able to set everything back up. Where can I find SII164_FULL_FUNCTIONS?

Just do git grep SII164_FULL_FUNCTIONS at the root of your kernel tree. It may be in a Kconfig file.

julia

#8 lore raw
Quoted 59 lines · Julia Lawall
Quoted 55 lines · NIshka Dasgupta' via outreachy-kernel
Quoted 51 lines · Greg KH
Quoted 41 lines · Nishka Dasgupta

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

---
   drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
   drivers/staging/sm750fb/ddk750_sii164.h |  1 -
   2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -11
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
   	return -1;
   }
   -/* below sii164 function is not necessary */
-
   #ifdef SII164_FULL_FUNCTIONS
   -/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
   /*
    * sii164GetChipString
    *      This function returns a char string name of the current DVI

Controller chip.

drivers/staging/sm750fb/ddk750_sii164.h +0 -0
index 862e7bf27353..1f7b5f9c1885 100644

drivers/staging/sm750fb/ddk750_sii164.h unsigned short sii164GetVendorID(void); · line 32

Quoted 6 lines
drivers/staging/sm750fb/ddk750_sii164.h +0 -1
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
   unsigned short sii164GetDeviceID(void);
     #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
   char *sii164GetChipString(void);
   void sii164SetPower(unsigned char powerUp);
   void sii164EnableHotPlugDetection(unsigned char enableHotPlug);

Did you test build this? This function is still used if SII164_FULL_FUNCTIONS is defined.

Quoted 8 lines
Quoted 4 lines

Yes, I did test build this, and there were no problems. However, I have not been able to properly grep search for it since my laptop crashed a few days ago and I have only just been able to set everything back up. Where can I find SII164_FULL_FUNCTIONS?

Just do git grep SII164_FULL_FUNCTIONS at the root of your kernel tree. It may be in a Kconfig file.

I did that, thank you. All the occurrences of SII164_FULL_FUNCTIONS follow ifdefs in C and header files in sm750fb (ddk750_dvi.c, ddk750_sii164.c, ddk750_sii164.c again, and ddk750_sii164.h). There don't appear to be any occurrences of SII164_FULL_FUNCTIONS anywhere else in the entire staging tree. Does this mean I can delete every ifdef referring to SII164_FULL_FUNCTIONS since SII164_FULL_FUNCTIONS does not appear to be actually defined anywhere? Or should all those (including the function deleted by this current patch) stay?

Thanking you,
Nishka

Quoted 2 lines

julia

maintainer
#9 lore raw
Quoted 71 lines · NIshka Dasgupta
Quoted 59 lines · Julia Lawall
Quoted 55 lines · NIshka Dasgupta' via outreachy-kernel
Quoted 51 lines · Greg KH
Quoted 41 lines · Nishka Dasgupta

Remove function sii164ResetChip() as comment above it said "below function is not necessary".

---
   drivers/staging/sm750fb/ddk750_sii164.c | 13 -------------
   drivers/staging/sm750fb/ddk750_sii164.h |  1 -
   2 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +0 -11
index c8e856c13912..8884ef927893 100644
@@ -237,21 +237,8 @@ long sii164InitChip(unsigned char edge_select,
   	return -1;
   }
   -/* below sii164 function is not necessary */
-
   #ifdef SII164_FULL_FUNCTIONS
   -/*
- *  sii164ResetChip
- *      This function resets the DVI Controller Chip.
- */
-void sii164ResetChip(void)
-{
-	/* Power down */
-	sii164SetPower(0);
-	sii164SetPower(1);
-}
-
   /*
    * sii164GetChipString
    *      This function returns a char string name of the current DVI

Controller chip.

drivers/staging/sm750fb/ddk750_sii164.h +0 -0
index 862e7bf27353..1f7b5f9c1885 100644

drivers/staging/sm750fb/ddk750_sii164.h unsigned short sii164GetVendorID(void); · line 32

Quoted 6 lines
drivers/staging/sm750fb/ddk750_sii164.h +0 -1
@@ -28,7 +28,6 @@ unsigned short sii164GetVendorID(void);
   unsigned short sii164GetDeviceID(void);
     #ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
   char *sii164GetChipString(void);
   void sii164SetPower(unsigned char powerUp);
   void sii164EnableHotPlugDetection(unsigned char enableHotPlug);

Did you test build this? This function is still used if SII164_FULL_FUNCTIONS is defined.

Quoted 8 lines
Quoted 4 lines

Yes, I did test build this, and there were no problems. However, I have not been able to properly grep search for it since my laptop crashed a few days ago and I have only just been able to set everything back up. Where can I find SII164_FULL_FUNCTIONS?

Just do git grep SII164_FULL_FUNCTIONS at the root of your kernel tree. It may be in a Kconfig file.

Quoted 9 lines

I did that, thank you. All the occurrences of SII164_FULL_FUNCTIONS follow ifdefs in C and header files in sm750fb (ddk750_dvi.c, ddk750_sii164.c, ddk750_sii164.c again, and ddk750_sii164.h). There don't appear to be any occurrences of SII164_FULL_FUNCTIONS anywhere else in the entire staging tree.
Does this mean I can delete every ifdef referring to SII164_FULL_FUNCTIONS since SII164_FULL_FUNCTIONS does not appear to be actually defined anywhere? Or should all those (including the function deleted by this current patch) stay?

For now I would just leave them alone, as they might mean something to someone who has the hardware.

thanks,

greg k-h