mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Staging: dgnc: Remove unused variables from structure definition
@ 2017-09-16 11:43 Srishti Sharma
  2017-09-16 11:50 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Srishti Sharma @ 2017-09-16 11:43 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel,
	outreachy-kernel, Srishti Sharma

Some variables in the structure were unused and hence them and
the comments associated with them can be removed.

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.h | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
index 764d6fe..2b625cc 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -103,8 +103,6 @@ struct board_ops {
 /**
  * struct dgnc_board - Per board information.
  * @boardnum: Board number (0 - 32).
- *
- * @type: Type of board.
  * @name: Product name.
  * @pdev: Pointer to the pci_dev structure.
  * @bd_flags: Board flags.
@@ -140,13 +138,9 @@ struct board_ops {
  * @dpastatus: Board status as defined by DPA.
  * @bd_dividend: Board/UART's specific dividend.
  * @bd_ops: Pointer to board operations structure.
- * @proc_entry_pointer: Proc/<board> entry
- * @dgnc_board_table: Proc/<board> entry
  */
 struct dgnc_board {
 	int		boardnum;
-
-	int		type;
 	char		*name;
 	struct pci_dev	*pdev;
 	unsigned long	bd_flags;
@@ -200,10 +194,6 @@ struct dgnc_board {
 	uint		bd_dividend;
 
 	struct board_ops *bd_ops;
-
-	struct proc_dir_entry *proc_entry_pointer;
-	struct dgnc_proc_entry *dgnc_board_table;
-
 };
 
 /* Unit flag definitions for un_flags. */
-- 
2.7.4

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

* Re: [Outreachy kernel] [PATCH] Staging: dgnc: Remove unused variables from structure definition
  2017-09-16 11:43 [PATCH] Staging: dgnc: Remove unused variables from structure definition Srishti Sharma
@ 2017-09-16 11:50 ` Julia Lawall
  2017-09-16 12:08   ` Srishti Sharma
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2017-09-16 11:50 UTC (permalink / raw)
  To: Srishti Sharma
  Cc: lidza.louina, markh, gregkh, driverdev-devel, devel,
	linux-kernel, outreachy-kernel



On Sat, 16 Sep 2017, Srishti Sharma wrote:

> Some variables in the structure were unused and hence them and
> the comments associated with them can be removed.

How did you find these?  The last two can easily be checked with grep, but
that is ont the case for type.

Actually there are two structures in the file with useless
proc_entry_pointer fields.  The other one has a useless
dgnc_channel_table.  It could be reasonable to make a series to do both
structures.

julia

>
> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_driver.h | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
> index 764d6fe..2b625cc 100644
> --- a/drivers/staging/dgnc/dgnc_driver.h
> +++ b/drivers/staging/dgnc/dgnc_driver.h
> @@ -103,8 +103,6 @@ struct board_ops {
>  /**
>   * struct dgnc_board - Per board information.
>   * @boardnum: Board number (0 - 32).
> - *
> - * @type: Type of board.
>   * @name: Product name.
>   * @pdev: Pointer to the pci_dev structure.
>   * @bd_flags: Board flags.
> @@ -140,13 +138,9 @@ struct board_ops {
>   * @dpastatus: Board status as defined by DPA.
>   * @bd_dividend: Board/UART's specific dividend.
>   * @bd_ops: Pointer to board operations structure.
> - * @proc_entry_pointer: Proc/<board> entry
> - * @dgnc_board_table: Proc/<board> entry
>   */
>  struct dgnc_board {
>  	int		boardnum;
> -
> -	int		type;
>  	char		*name;
>  	struct pci_dev	*pdev;
>  	unsigned long	bd_flags;
> @@ -200,10 +194,6 @@ struct dgnc_board {
>  	uint		bd_dividend;
>
>  	struct board_ops *bd_ops;
> -
> -	struct proc_dir_entry *proc_entry_pointer;
> -	struct dgnc_proc_entry *dgnc_board_table;
> -
>  };
>
>  /* Unit flag definitions for un_flags. */
> --
> 2.7.4
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505562186-11813-1-git-send-email-srishtishar%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

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

* Re: [Outreachy kernel] [PATCH] Staging: dgnc: Remove unused variables from structure definition
  2017-09-16 11:50 ` [Outreachy kernel] " Julia Lawall
@ 2017-09-16 12:08   ` Srishti Sharma
  2017-09-16 12:15     ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Srishti Sharma @ 2017-09-16 12:08 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Lidza Louina, markh, Greg KH, driverdev-devel, devel,
	Linux kernel mailing list, outreachy-kernel

On Sat, Sep 16, 2017 at 5:20 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Sat, 16 Sep 2017, Srishti Sharma wrote:
>
>> Some variables in the structure were unused and hence them and
>> the comments associated with them can be removed.
>
> How did you find these?  The last two can easily be checked with grep, but
> that is ont the case for type.

I removed them and then compiled the code to see if it still compiles.
I was using grep earlier to see if the fields in the structure are
ever accessed by the variables of that structure type, as the TODO of
the driver says that there is a lot of unneeded code.
>
> Actually there are two structures in the file with useless
> proc_entry_pointer fields.  The other one has a useless
> dgnc_channel_table.  It could be reasonable to make a series to do both
> structures.

Okay, I'll send them as a series. Thanks

Regards,
Srishti

> julia
>
>>
>> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
>> ---
>>  drivers/staging/dgnc/dgnc_driver.h | 10 ----------
>>  1 file changed, 10 deletions(-)
>>
>> diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
>> index 764d6fe..2b625cc 100644
>> --- a/drivers/staging/dgnc/dgnc_driver.h
>> +++ b/drivers/staging/dgnc/dgnc_driver.h
>> @@ -103,8 +103,6 @@ struct board_ops {
>>  /**
>>   * struct dgnc_board - Per board information.
>>   * @boardnum: Board number (0 - 32).
>> - *
>> - * @type: Type of board.
>>   * @name: Product name.
>>   * @pdev: Pointer to the pci_dev structure.
>>   * @bd_flags: Board flags.
>> @@ -140,13 +138,9 @@ struct board_ops {
>>   * @dpastatus: Board status as defined by DPA.
>>   * @bd_dividend: Board/UART's specific dividend.
>>   * @bd_ops: Pointer to board operations structure.
>> - * @proc_entry_pointer: Proc/<board> entry
>> - * @dgnc_board_table: Proc/<board> entry
>>   */
>>  struct dgnc_board {
>>       int             boardnum;
>> -
>> -     int             type;
>>       char            *name;
>>       struct pci_dev  *pdev;
>>       unsigned long   bd_flags;
>> @@ -200,10 +194,6 @@ struct dgnc_board {
>>       uint            bd_dividend;
>>
>>       struct board_ops *bd_ops;
>> -
>> -     struct proc_dir_entry *proc_entry_pointer;
>> -     struct dgnc_proc_entry *dgnc_board_table;
>> -
>>  };
>>
>>  /* Unit flag definitions for un_flags. */
>> --
>> 2.7.4
>>
>> --
>> 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 outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505562186-11813-1-git-send-email-srishtishar%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>

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

* Re: [Outreachy kernel] [PATCH] Staging: dgnc: Remove unused variables from structure definition
  2017-09-16 12:08   ` Srishti Sharma
@ 2017-09-16 12:15     ` Julia Lawall
  2017-09-16 12:26       ` Srishti Sharma
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2017-09-16 12:15 UTC (permalink / raw)
  To: Srishti Sharma
  Cc: Lidza Louina, markh, Greg KH, driverdev-devel, devel,
	Linux kernel mailing list, outreachy-kernel



On Sat, 16 Sep 2017, Srishti Sharma wrote:

> On Sat, Sep 16, 2017 at 5:20 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> > On Sat, 16 Sep 2017, Srishti Sharma wrote:
> >
> >> Some variables in the structure were unused and hence them and
> >> the comments associated with them can be removed.
> >
> > How did you find these?  The last two can easily be checked with grep, but
> > that is ont the case for type.
>
> I removed them and then compiled the code to see if it still compiles.

This is not 100% reliable because of the possibility of uses inside
ifdefs.  So you need to double check that you have found every occurrence
of the structure type for the type field.  The others seem not dangerous.

julia

> I was using grep earlier to see if the fields in the structure are
> ever accessed by the variables of that structure type, as the TODO of
> the driver says that there is a lot of unneeded code.
> >
> > Actually there are two structures in the file with useless
> > proc_entry_pointer fields.  The other one has a useless
> > dgnc_channel_table.  It could be reasonable to make a series to do both
> > structures.
>
> Okay, I'll send them as a series. Thanks
>
> Regards,
> Srishti
>
> > julia
> >
> >>
> >> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
> >> ---
> >>  drivers/staging/dgnc/dgnc_driver.h | 10 ----------
> >>  1 file changed, 10 deletions(-)
> >>
> >> diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
> >> index 764d6fe..2b625cc 100644
> >> --- a/drivers/staging/dgnc/dgnc_driver.h
> >> +++ b/drivers/staging/dgnc/dgnc_driver.h
> >> @@ -103,8 +103,6 @@ struct board_ops {
> >>  /**
> >>   * struct dgnc_board - Per board information.
> >>   * @boardnum: Board number (0 - 32).
> >> - *
> >> - * @type: Type of board.
> >>   * @name: Product name.
> >>   * @pdev: Pointer to the pci_dev structure.
> >>   * @bd_flags: Board flags.
> >> @@ -140,13 +138,9 @@ struct board_ops {
> >>   * @dpastatus: Board status as defined by DPA.
> >>   * @bd_dividend: Board/UART's specific dividend.
> >>   * @bd_ops: Pointer to board operations structure.
> >> - * @proc_entry_pointer: Proc/<board> entry
> >> - * @dgnc_board_table: Proc/<board> entry
> >>   */
> >>  struct dgnc_board {
> >>       int             boardnum;
> >> -
> >> -     int             type;
> >>       char            *name;
> >>       struct pci_dev  *pdev;
> >>       unsigned long   bd_flags;
> >> @@ -200,10 +194,6 @@ struct dgnc_board {
> >>       uint            bd_dividend;
> >>
> >>       struct board_ops *bd_ops;
> >> -
> >> -     struct proc_dir_entry *proc_entry_pointer;
> >> -     struct dgnc_proc_entry *dgnc_board_table;
> >> -
> >>  };
> >>
> >>  /* Unit flag definitions for un_flags. */
> >> --
> >> 2.7.4
> >>
> >> --
> >> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505562186-11813-1-git-send-email-srishtishar%40gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>

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

* Re: [Outreachy kernel] [PATCH] Staging: dgnc: Remove unused variables from structure definition
  2017-09-16 12:15     ` Julia Lawall
@ 2017-09-16 12:26       ` Srishti Sharma
  0 siblings, 0 replies; 5+ messages in thread
From: Srishti Sharma @ 2017-09-16 12:26 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Lidza Louina, markh, Greg KH, driverdev-devel, devel,
	Linux kernel mailing list, outreachy-kernel

On Sat, Sep 16, 2017 at 5:45 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Sat, 16 Sep 2017, Srishti Sharma wrote:
>
>> On Sat, Sep 16, 2017 at 5:20 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> >
>> >
>> > On Sat, 16 Sep 2017, Srishti Sharma wrote:
>> >
>> >> Some variables in the structure were unused and hence them and
>> >> the comments associated with them can be removed.
>> >
>> > How did you find these?  The last two can easily be checked with grep, but
>> > that is ont the case for type.
>>
>> I removed them and then compiled the code to see if it still compiles.
>
> This is not 100% reliable because of the possibility of uses inside
> ifdefs.  So you need to double check that you have found every occurrence
> of the structure type for the type field.  The others seem not dangerous.

Okay, I'll do that . Thanks

Srishti
>
> julia
>
>> I was using grep earlier to see if the fields in the structure are
>> ever accessed by the variables of that structure type, as the TODO of
>> the driver says that there is a lot of unneeded code.
>> >
>> > Actually there are two structures in the file with useless
>> > proc_entry_pointer fields.  The other one has a useless
>> > dgnc_channel_table.  It could be reasonable to make a series to do both
>> > structures.
>>
>> Okay, I'll send them as a series. Thanks
>>
>> Regards,
>> Srishti
>>
>> > julia
>> >
>> >>
>> >> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
>> >> ---
>> >>  drivers/staging/dgnc/dgnc_driver.h | 10 ----------
>> >>  1 file changed, 10 deletions(-)
>> >>
>> >> diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
>> >> index 764d6fe..2b625cc 100644
>> >> --- a/drivers/staging/dgnc/dgnc_driver.h
>> >> +++ b/drivers/staging/dgnc/dgnc_driver.h
>> >> @@ -103,8 +103,6 @@ struct board_ops {
>> >>  /**
>> >>   * struct dgnc_board - Per board information.
>> >>   * @boardnum: Board number (0 - 32).
>> >> - *
>> >> - * @type: Type of board.
>> >>   * @name: Product name.
>> >>   * @pdev: Pointer to the pci_dev structure.
>> >>   * @bd_flags: Board flags.
>> >> @@ -140,13 +138,9 @@ struct board_ops {
>> >>   * @dpastatus: Board status as defined by DPA.
>> >>   * @bd_dividend: Board/UART's specific dividend.
>> >>   * @bd_ops: Pointer to board operations structure.
>> >> - * @proc_entry_pointer: Proc/<board> entry
>> >> - * @dgnc_board_table: Proc/<board> entry
>> >>   */
>> >>  struct dgnc_board {
>> >>       int             boardnum;
>> >> -
>> >> -     int             type;
>> >>       char            *name;
>> >>       struct pci_dev  *pdev;
>> >>       unsigned long   bd_flags;
>> >> @@ -200,10 +194,6 @@ struct dgnc_board {
>> >>       uint            bd_dividend;
>> >>
>> >>       struct board_ops *bd_ops;
>> >> -
>> >> -     struct proc_dir_entry *proc_entry_pointer;
>> >> -     struct dgnc_proc_entry *dgnc_board_table;
>> >> -
>> >>  };
>> >>
>> >>  /* Unit flag definitions for un_flags. */
>> >> --
>> >> 2.7.4
>> >>
>> >> --
>> >> 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 outreachy-kernel+unsubscribe@googlegroups.com.
>> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505562186-11813-1-git-send-email-srishtishar%40gmail.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>>

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

end of thread, other threads:[~2017-09-16 12:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-16 11:43 [PATCH] Staging: dgnc: Remove unused variables from structure definition Srishti Sharma
2017-09-16 11:50 ` [Outreachy kernel] " Julia Lawall
2017-09-16 12:08   ` Srishti Sharma
2017-09-16 12:15     ` Julia Lawall
2017-09-16 12:26       ` Srishti Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®