All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] *** Cleanup patches for mt7621-mmc staging driver ***
@ 2018-09-30 19:04 Dafna Hirschfeld
  2018-09-30 19:04 ` [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements Dafna Hirschfeld
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-09-30 19:04 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel, dafna3

3 Cleanup patches, all issues found with checkpatch.pl

Dafna Hirschfeld (3):
  staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  staging: mt7621-mmc: Fix comparison to NULL
  staging: mt7621-mmc: replace `printk` with preferred API

 drivers/staging/mt7621-mmc/sd.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

-- 
2.17.1



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

* [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-09-30 19:04 [PATCH 0/3] *** Cleanup patches for mt7621-mmc staging driver *** Dafna Hirschfeld
@ 2018-09-30 19:04 ` Dafna Hirschfeld
  2018-09-30 20:18   ` [Outreachy kernel] " Julia Lawall
  2018-09-30 19:04 ` [PATCH 2/3] staging: mt7621-mmc: Fix comparison to NULL Dafna Hirschfeld
  2018-09-30 19:04 ` [PATCH 3/3] staging: mt7621-mmc: replace `printk` with preferred API Dafna Hirschfeld
  2 siblings, 1 reply; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-09-30 19:04 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel, dafna3

Remove unnecessary braces from one line 'if' statements.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
 drivers/staging/mt7621-mmc/sd.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index e3c1546373ba..8c32cec5950a 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -520,9 +520,8 @@ static void msdc_pm(pm_message_t state, void *data)
 		host->pm_state = state;  /* default PMSG_RESUME */
 
 	} else if (evt == PM_EVENT_RESUME || evt == PM_EVENT_USER_RESUME) {
-		if (!host->suspend) {
+		if (!host->suspend)
 			return;
-		}
 
 		/* No PM resume when USR suspend */
 		if (evt == PM_EVENT_RESUME && host->pm_state.event == PM_EVENT_USER_SUSPEND) {
@@ -967,16 +966,14 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	//if(host->id==1) {
 	if (send_type == SND_CMD) {
 		if (cmd->opcode == MMC_SEND_STATUS) {
-			if ((cmd->resp[0] & CARD_READY_FOR_DATA) || (CARD_CURRENT_STATE(cmd->resp[0]) != 7)) {
+			if ((cmd->resp[0] & CARD_READY_FOR_DATA) || (CARD_CURRENT_STATE(cmd->resp[0]) != 7))
 				msdc_gate_clock(host->id);
-			}
 		} else {
 			msdc_gate_clock(host->id);
 		}
 	} else {
-		if (read) {
+		if (read)
 			msdc_gate_clock(host->id);
-		}
 	}
 	//}
 #else
-- 
2.17.1



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

* [PATCH 2/3] staging: mt7621-mmc: Fix comparison to NULL
  2018-09-30 19:04 [PATCH 0/3] *** Cleanup patches for mt7621-mmc staging driver *** Dafna Hirschfeld
  2018-09-30 19:04 ` [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements Dafna Hirschfeld
@ 2018-09-30 19:04 ` Dafna Hirschfeld
  2018-09-30 19:04 ` [PATCH 3/3] staging: mt7621-mmc: replace `printk` with preferred API Dafna Hirschfeld
  2 siblings, 0 replies; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-09-30 19:04 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel, dafna3

Replace comparisons of a variable 'x' to NULL with
either 'x' or '!x'.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
 drivers/staging/mt7621-mmc/sd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 8c32cec5950a..f2955fae7b28 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -851,8 +851,8 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
 #define SND_DAT 0
 #define SND_CMD 1
 
-	BUG_ON(mmc == NULL);
-	BUG_ON(mrq == NULL);
+	BUG_ON(!mmc);
+	BUG_ON(!mrq);
 
 	host->error = 0;
 
@@ -946,7 +946,7 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	}
 
 done:
-	if (data != NULL) {
+	if (data) {
 		host->data = NULL;
 		dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len,
 			     mmc_get_dma_dir(data));
@@ -1638,7 +1638,7 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 	}
 
 	/* transfer complete interrupt */
-	if (data != NULL) {
+	if (data) {
 		if (inten & MSDC_INT_XFER_COMPL) {
 			data->bytes_xfered = host->xfer_size;
 			complete(&host->xfer_done);
@@ -1661,7 +1661,7 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 	}
 
 	/* command interrupts */
-	if ((cmd != NULL) && (intsts & cmdsts)) {
+	if (cmd && (intsts & cmdsts)) {
 		if ((intsts & MSDC_INT_CMDRDY) || (intsts & MSDC_INT_ACMDRDY) ||
 			(intsts & MSDC_INT_ACMD19_DONE)) {
 			u32 *rsp = &cmd->resp[0];
-- 
2.17.1



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

* [PATCH 3/3] staging: mt7621-mmc: replace `printk` with preferred API
  2018-09-30 19:04 [PATCH 0/3] *** Cleanup patches for mt7621-mmc staging driver *** Dafna Hirschfeld
  2018-09-30 19:04 ` [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements Dafna Hirschfeld
  2018-09-30 19:04 ` [PATCH 2/3] staging: mt7621-mmc: Fix comparison to NULL Dafna Hirschfeld
@ 2018-09-30 19:04 ` Dafna Hirschfeld
  2 siblings, 0 replies; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-09-30 19:04 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel, dafna3

Replace calls to `printk` with `dev_info` and `pr_err`
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
 drivers/staging/mt7621-mmc/sd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index f2955fae7b28..c21103aed2dc 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -1695,8 +1695,8 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 
 	/* mmc irq interrupts */
 	if (intsts & MSDC_INT_MMCIRQ)
-		printk(KERN_INFO "msdc[%d] MMCIRQ: SDC_CSTS=0x%.8x\r\n",
-		       host->id, readl(host->base + SDC_CSTS));
+		dev_info(mmc_dev(host->mmc), "msdc[%d] MMCIRQ: SDC_CSTS=0x%.8x\r\n",
+			host->id, readl(host->base + SDC_CSTS));
 
 	return IRQ_HANDLED;
 }
@@ -2131,7 +2131,7 @@ static int __init mt_msdc_init(void)
 
 	ret = platform_driver_register(&mt_msdc_driver);
 	if (ret) {
-		printk(KERN_ERR DRV_NAME ": Can't register driver");
+		pr_err("%s: Can't register driver", DRV_NAME);
 		return ret;
 	}
 
-- 
2.17.1



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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-09-30 19:04 ` [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements Dafna Hirschfeld
@ 2018-09-30 20:18   ` Julia Lawall
  2018-10-01  7:57     ` Dafna Hirschfeld
  0 siblings, 1 reply; 19+ messages in thread
From: Julia Lawall @ 2018-09-30 20:18 UTC (permalink / raw)
  To: Dafna Hirschfeld; +Cc: gregkh, outreachy-kernel



On Sun, 30 Sep 2018, Dafna Hirschfeld wrote:

> Remove unnecessary braces from one line 'if' statements.
> Issues found with checkpatch.pl
>
> Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
> ---
>  drivers/staging/mt7621-mmc/sd.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
> index e3c1546373ba..8c32cec5950a 100644
> --- a/drivers/staging/mt7621-mmc/sd.c
> +++ b/drivers/staging/mt7621-mmc/sd.c
> @@ -520,9 +520,8 @@ static void msdc_pm(pm_message_t state, void *data)
>  		host->pm_state = state;  /* default PMSG_RESUME */
>
>  	} else if (evt == PM_EVENT_RESUME || evt == PM_EVENT_USER_RESUME) {
> -		if (!host->suspend) {
> +		if (!host->suspend)
>  			return;
> -		}
>
>  		/* No PM resume when USR suspend */
>  		if (evt == PM_EVENT_RESUME && host->pm_state.event == PM_EVENT_USER_SUSPEND) {
> @@ -967,16 +966,14 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  	//if(host->id==1) {
>  	if (send_type == SND_CMD) {
>  		if (cmd->opcode == MMC_SEND_STATUS) {
> -			if ((cmd->resp[0] & CARD_READY_FOR_DATA) || (CARD_CURRENT_STATE(cmd->resp[0]) != 7)) {
> +			if ((cmd->resp[0] & CARD_READY_FOR_DATA) || (CARD_CURRENT_STATE(cmd->resp[0]) != 7))

This line is really long.  Since you have sent a series on this code,
maybe you can add in another patch to clean this up.

julia

>  				msdc_gate_clock(host->id);
> -			}
>  		} else {
>  			msdc_gate_clock(host->id);
>  		}
>  	} else {
> -		if (read) {
> +		if (read)
>  			msdc_gate_clock(host->id);
> -		}
>  	}
>  	//}
>  #else
> --
> 2.17.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 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/bf3ba7a38f000d4359c4c56fac98f17ae3ef6a2b.1538333858.git.dafna3%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-09-30 20:18   ` [Outreachy kernel] " Julia Lawall
@ 2018-10-01  7:57     ` Dafna Hirschfeld
  2018-10-01  8:47       ` Julia Lawall
  0 siblings, 1 reply; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-10-01  7:57 UTC (permalink / raw)
  To: Julia Lawall; +Cc: gregkh, outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 2747 bytes --]

On Mon, Oct 1, 2018 at 12:55 AM Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Sun, 30 Sep 2018, Dafna Hirschfeld wrote:
>
> > Remove unnecessary braces from one line 'if' statements.
> > Issues found with checkpatch.pl
> >
> > Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
> > ---
> >  drivers/staging/mt7621-mmc/sd.c | 9 +++------
> >  1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/staging/mt7621-mmc/sd.c
> b/drivers/staging/mt7621-mmc/sd.c
> > index e3c1546373ba..8c32cec5950a 100644
> > --- a/drivers/staging/mt7621-mmc/sd.c
> > +++ b/drivers/staging/mt7621-mmc/sd.c
> > @@ -520,9 +520,8 @@ static void msdc_pm(pm_message_t state, void *data)
> >               host->pm_state = state;  /* default PMSG_RESUME */
> >
> >       } else if (evt == PM_EVENT_RESUME || evt == PM_EVENT_USER_RESUME) {
> > -             if (!host->suspend) {
> > +             if (!host->suspend)
> >                       return;
> > -             }
> >
> >               /* No PM resume when USR suspend */
> >               if (evt == PM_EVENT_RESUME && host->pm_state.event ==
> PM_EVENT_USER_SUSPEND) {
> > @@ -967,16 +966,14 @@ static int msdc_do_request(struct mmc_host *mmc,
> struct mmc_request *mrq)
> >       //if(host->id==1) {
> >       if (send_type == SND_CMD) {
> >               if (cmd->opcode == MMC_SEND_STATUS) {
> > -                     if ((cmd->resp[0] & CARD_READY_FOR_DATA) ||
> (CARD_CURRENT_STATE(cmd->resp[0]) != 7)) {
> > +                     if ((cmd->resp[0] & CARD_READY_FOR_DATA) ||
> (CARD_CURRENT_STATE(cmd->resp[0]) != 7))
>
> This line is really long.  Since you have sent a series on this code,
> maybe you can add in another patch to clean this up.
>
> julia
>

So add it as a 4th patch in the patchset ?
Dafna


> >                               msdc_gate_clock(host->id);
> > -                     }
> >               } else {
> >                       msdc_gate_clock(host->id);
> >               }
> >       } else {
> > -             if (read) {
> > +             if (read)
> >                       msdc_gate_clock(host->id);
> > -             }
> >       }
> >       //}
> >  #else
> > --
> > 2.17.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 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/bf3ba7a38f000d4359c4c56fac98f17ae3ef6a2b.1538333858.git.dafna3%40gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>

[-- Attachment #2: Type: text/html, Size: 4292 bytes --]

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-01  7:57     ` Dafna Hirschfeld
@ 2018-10-01  8:47       ` Julia Lawall
  2018-10-02  8:24         ` Dafna Hirschfeld
  0 siblings, 1 reply; 19+ messages in thread
From: Julia Lawall @ 2018-10-01  8:47 UTC (permalink / raw)
  To: Dafna Hirschfeld; +Cc: gregkh, outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 4222 bytes --]



On Mon, 1 Oct 2018, Dafna Hirschfeld wrote:

>
>
> On Mon, Oct 1, 2018 at 12:55 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>       On Sun, 30 Sep 2018, Dafna Hirschfeld wrote:
>
>       > Remove unnecessary braces from one line 'if' statements.
>       > Issues found with checkpatch.pl
>       >
>       > Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
>       > ---
>       >ᅵ drivers/staging/mt7621-mmc/sd.c | 9 +++------
>       >ᅵ 1 file changed, 3 insertions(+), 6 deletions(-)
>       >
>       > diff --git a/drivers/staging/mt7621-mmc/sd.c
>       b/drivers/staging/mt7621-mmc/sd.c
>       > index e3c1546373ba..8c32cec5950a 100644
>       > --- a/drivers/staging/mt7621-mmc/sd.c
>       > +++ b/drivers/staging/mt7621-mmc/sd.c
>       > @@ -520,9 +520,8 @@ static void msdc_pm(pm_message_t state,
>       void *data)
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵhost->pm_state = state;ᅵ /* default PMSG_RESUME
>       */
>       >
>       >ᅵ ᅵ ᅵ ᅵ} else if (evt == PM_EVENT_RESUME || evt ==
>       PM_EVENT_USER_RESUME) {
>       > -ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif (!host->suspend) {
>       > +ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif (!host->suspend)
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵreturn;
>       > -ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ}
>       >
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ/* No PM resume when USR suspend */
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif (evt == PM_EVENT_RESUME &&
>       host->pm_state.event == PM_EVENT_USER_SUSPEND) {
>       > @@ -967,16 +966,14 @@ static int msdc_do_request(struct
>       mmc_host *mmc, struct mmc_request *mrq)
>       >ᅵ ᅵ ᅵ ᅵ//if(host->id==1) {
>       >ᅵ ᅵ ᅵ ᅵif (send_type == SND_CMD) {
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif (cmd->opcode == MMC_SEND_STATUS) {
>       > -ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif ((cmd->resp[0] & CARD_READY_FOR_DATA)
>       || (CARD_CURRENT_STATE(cmd->resp[0]) != 7)) {
>       > +ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif ((cmd->resp[0] & CARD_READY_FOR_DATA)
>       || (CARD_CURRENT_STATE(cmd->resp[0]) != 7))
>
>       This line is really long.ᅵ Since you have sent a series on this
>       code,
>       maybe you can add in another patch to clean this up.
>
>       julia
>
>
> So add it as a 4th patch in the patchset ?

That would be fine.

julia

> Dafna
> ᅵ
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵmsdc_gate_clock(host->id);
>       > -ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ}
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ} else {
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵmsdc_gate_clock(host->id);
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ}
>       >ᅵ ᅵ ᅵ ᅵ} else {
>       > -ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif (read) {
>       > +ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵif (read)
>       >ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵmsdc_gate_clock(host->id);
>       > -ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ}
>       >ᅵ ᅵ ᅵ ᅵ}
>       >ᅵ ᅵ ᅵ ᅵ//}
>       >ᅵ #else
>       > --
>       > 2.17.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
>       outreachy-kernel+unsubscribe@googlegroups.com.
>       > To post to this group, send email to
>       outreachy-kernel@googlegroups.com.
>       > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/bf3ba7a38f000d4359c4c56f
>       ac98f17ae3ef6a2b.1538333858.git.dafna3%40gmail.com.
>       > For more options, visit https://groups.google.com/d/optout.
>       >
>
> --
> 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 visithttps://groups.google.com/d/msgid/outreachy-kernel/CAJ1myNR7951qEF6hpN8DRJ-
> hmckXMOzZWnzBJWrYqdaRoPLb2g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-01  8:47       ` Julia Lawall
@ 2018-10-02  8:24         ` Dafna Hirschfeld
  2018-10-02  9:28           ` Himanshu Jha
  0 siblings, 1 reply; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-10-02  8:24 UTC (permalink / raw)
  To: Julia Lawall; +Cc: gregkh, outreachy-kernel, hdegoede

[-- Attachment #1: Type: text/plain, Size: 5490 bytes --]

Hi,
Apparently, the mt7621-mmc driver is for a specific SOC based on mips,
In order to compile it I installed mips compiler:

sudo apt install gcc-mips-linux-gnu

and set:
export CROSS_COMPILE=mips-linux-gnu-
export ARCH=mips

Then I used an initial .config file
from arch/mips/configs/generic_defconfig.
In the menuconfig ,
under "Machine Selection" I choose "Ralink SoC selection (MT7621)"
under  "Device Drivers" I chose "MMC/SD/SDIO card support" as a module.
under "Device Drivers -> staging drivers" I chose "MTK SD/MMC"

Then when compiling, the files in  drivers/staging/mt7621-mmc/ compiled ok,
but I had compilation error in drivers/staging/mt7621-pci/pci-mt7621.c,
with the first error:

drivers/staging/mt7621-pci/pci-mt7621.c:195:11: error:
‘pci_generic_config_read’ undeclared here (not in a function); did you mean
‘pci_write_config_word’?
  .read  = pci_generic_config_read,
           ^~~~~~~~~~~~~~~~~~~~~~~
           pci_write_config_word


Then in run "make menuconfig" again and under "Device Drivers -> staging
drivers" I chose "MediaTek MT7621 PCI Controller"
Hoping it will solve it , but it didn't.

The files I prepared the patchset for did compile ok , is it important that
all files will compile?

Dafna



On Mon, Oct 1, 2018 at 11:47 AM Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Mon, 1 Oct 2018, Dafna Hirschfeld wrote:
>
> >
> >
> > On Mon, Oct 1, 2018 at 12:55 AM Julia Lawall <julia.lawall@lip6.fr>
> wrote:
> >
> >
> >       On Sun, 30 Sep 2018, Dafna Hirschfeld wrote:
> >
> >       > Remove unnecessary braces from one line 'if' statements.
> >       > Issues found with checkpatch.pl
> >       >
> >       > Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
> >       > ---
> >       >  drivers/staging/mt7621-mmc/sd.c | 9 +++------
> >       >  1 file changed, 3 insertions(+), 6 deletions(-)
> >       >
> >       > diff --git a/drivers/staging/mt7621-mmc/sd.c
> >       b/drivers/staging/mt7621-mmc/sd.c
> >       > index e3c1546373ba..8c32cec5950a 100644
> >       > --- a/drivers/staging/mt7621-mmc/sd.c
> >       > +++ b/drivers/staging/mt7621-mmc/sd.c
> >       > @@ -520,9 +520,8 @@ static void msdc_pm(pm_message_t state,
> >       void *data)
> >       >               host->pm_state = state;  /* default PMSG_RESUME
> >       */
> >       >
> >       >       } else if (evt == PM_EVENT_RESUME || evt ==
> >       PM_EVENT_USER_RESUME) {
> >       > -             if (!host->suspend) {
> >       > +             if (!host->suspend)
> >       >                       return;
> >       > -             }
> >       >
> >       >               /* No PM resume when USR suspend */
> >       >               if (evt == PM_EVENT_RESUME &&
> >       host->pm_state.event == PM_EVENT_USER_SUSPEND) {
> >       > @@ -967,16 +966,14 @@ static int msdc_do_request(struct
> >       mmc_host *mmc, struct mmc_request *mrq)
> >       >       //if(host->id==1) {
> >       >       if (send_type == SND_CMD) {
> >       >               if (cmd->opcode == MMC_SEND_STATUS) {
> >       > -                     if ((cmd->resp[0] & CARD_READY_FOR_DATA)
> >       || (CARD_CURRENT_STATE(cmd->resp[0]) != 7)) {
> >       > +                     if ((cmd->resp[0] & CARD_READY_FOR_DATA)
> >       || (CARD_CURRENT_STATE(cmd->resp[0]) != 7))
> >
> >       This line is really long.  Since you have sent a series on this
> >       code,
> >       maybe you can add in another patch to clean this up.
> >
> >       julia
> >
> >
> > So add it as a 4th patch in the patchset ?
>
> That would be fine.
>
> julia
>
> > Dafna
> >
> >       >                               msdc_gate_clock(host->id);
> >       > -                     }
> >       >               } else {
> >       >                       msdc_gate_clock(host->id);
> >       >               }
> >       >       } else {
> >       > -             if (read) {
> >       > +             if (read)
> >       >                       msdc_gate_clock(host->id);
> >       > -             }
> >       >       }
> >       >       //}
> >       >  #else
> >       > --
> >       > 2.17.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
> >       outreachy-kernel+unsubscribe@googlegroups.com.
> >       > To post to this group, send email to
> >       outreachy-kernel@googlegroups.com.
> >       > To view this discussion on the web visithttps://
> groups.google.com/d/msgid/outreachy-kernel/bf3ba7a38f000d4359c4c56f
> >       ac98f17ae3ef6a2b.1538333858.git.dafna3%40gmail.com.
> >       > For more options, visit https://groups.google.com/d/optout.
> >       >
> >
> > --
> > 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 visithttps://
> groups.google.com/d/msgid/outreachy-kernel/CAJ1myNR7951qEF6hpN8DRJ-
> > hmckXMOzZWnzBJWrYqdaRoPLb2g%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >

[-- Attachment #2: Type: text/html, Size: 8650 bytes --]

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02  8:24         ` Dafna Hirschfeld
@ 2018-10-02  9:28           ` Himanshu Jha
  2018-10-02  9:39             ` Julia Lawall
  2018-10-02 15:31             ` Dafna Hirschfeld
  0 siblings, 2 replies; 19+ messages in thread
From: Himanshu Jha @ 2018-10-02  9:28 UTC (permalink / raw)
  To: Dafna Hirschfeld; +Cc: Julia Lawall, gregkh, outreachy-kernel, hdegoede

Hi Dafna,

On Tue, Oct 02, 2018 at 11:24:25AM +0300, Dafna Hirschfeld wrote:
> Hi,
> Apparently, the mt7621-mmc driver is for a specific SOC based on mips,
> In order to compile it I installed mips compiler:
> 
> sudo apt install gcc-mips-linux-gnu
> 
> and set:
> export CROSS_COMPILE=mips-linux-gnu-
> export ARCH=mips
> 
> Then I used an initial .config file
> from arch/mips/configs/generic_defconfig.
> In the menuconfig ,
> under "Machine Selection" I choose "Ralink SoC selection (MT7621)"
> under  "Device Drivers" I chose "MMC/SD/SDIO card support" as a module.
> under "Device Drivers -> staging drivers" I chose "MTK SD/MMC"
> 
> Then when compiling, the files in  drivers/staging/mt7621-mmc/ compiled ok,
> but I had compilation error in drivers/staging/mt7621-pci/pci-mt7621.c,
> with the first error:
> 
> drivers/staging/mt7621-pci/pci-mt7621.c:195:11: error:
> ‘pci_generic_config_read’ undeclared here (not in a function); did you mean
> ‘pci_write_config_word’?
>   .read  = pci_generic_config_read,
>            ^~~~~~~~~~~~~~~~~~~~~~~
>            pci_write_config_word

Note that pci_generic_config_read is an exported symbol at drivers/pci/access.c

<snip>

  int pci_generic_config_read(struct pci_bus *bus, unsigned int devfn,
                              int where, int size, u32 *val)
  {
          void __iomem *addr;
 
          addr = bus->ops->map_bus(bus, devfn, where);
          if (!addr) {
                  *val = ~0;
                  return PCIBIOS_DEVICE_NOT_FOUND;
          }
 
          if (size == 1)
                  *val = readb(addr);
          else if (size == 2)
                  *val = readw(addr);
          else
                  *val = readl(addr);
 
          return PCIBIOS_SUCCESSFUL;
  }
  EXPORT_SYMBOL_GPL(pci_generic_config_read);

</snip>

And then looking at drivers/pci/Makefile

   obj-$(CONFIG_PCI)               += access.o bus.o probe.o host-bridge.o \
                                      remove.o pci.o pci-driver.o search.o \
                                      pci-sysfs.o rom.o setup-res.o irq.o vpd.o \
                                      setup-bus.o vc.o mmap.o setup-irq.o

and grepping for CONFIG_PCI in your chosen .config

himanshu@himanshu-Vostro-3559:~/linux-next$ git grep -w "CONFIG_PCI" arch/mips/configs/generic_defconfig
himanshu@himanshu-Vostro-3559:~/linux-next$

So, you need to select CONFIG_PCI in order to export that symbol to be
used by pci-mt7621.c and then there will be no warnings.

Check it once yourself...

 
> Then in run "make menuconfig" again and under "Device Drivers -> staging
> drivers" I chose "MediaTek MT7621 PCI Controller"
> Hoping it will solve it , but it didn't.
> 
> The files I prepared the patchset for did compile ok , is it important that
> all files will compile?

I think for these changes just use that .config supplied by the distro
at /boot/config-*

But IIRC `make allyesconfig` should be used(not sure though..)

Lastly, please avoid "top posting" :)


Hope that helps,

Thanks
-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology


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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02  9:28           ` Himanshu Jha
@ 2018-10-02  9:39             ` Julia Lawall
  2018-10-03 18:10               ` Dafna Hirschfeld
  2018-10-02 15:31             ` Dafna Hirschfeld
  1 sibling, 1 reply; 19+ messages in thread
From: Julia Lawall @ 2018-10-02  9:39 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: Dafna Hirschfeld, gregkh, outreachy-kernel, hdegoede

> > Then in run "make menuconfig" again and under "Device Drivers -> staging
> > drivers" I chose "MediaTek MT7621 PCI Controller"
> > Hoping it will solve it , but it didn't.
> >
> > The files I prepared the patchset for did compile ok , is it important that
> > all files will compile?
>
> I think for these changes just use that .config supplied by the distro
> at /boot/config-*
>
> But IIRC `make allyesconfig` should be used(not sure though..)

Dafna,

It is important that the driver continues to compile.

Make allyesconfig is often a good option.

julia


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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02  9:28           ` Himanshu Jha
  2018-10-02  9:39             ` Julia Lawall
@ 2018-10-02 15:31             ` Dafna Hirschfeld
  2018-10-02 20:05               ` Himanshu Jha
  1 sibling, 1 reply; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-10-02 15:31 UTC (permalink / raw)
  To: himanshujha199640; +Cc: Julia Lawall, gregkh, outreachy-kernel, hdegoede

[-- Attachment #1: Type: text/plain, Size: 4190 bytes --]

On Tue, Oct 2, 2018 at 12:28 PM Himanshu Jha <himanshujha199640@gmail.com>
wrote:

> Hi Dafna,
>
> On Tue, Oct 02, 2018 at 11:24:25AM +0300, Dafna Hirschfeld wrote:
> > Hi,
> > Apparently, the mt7621-mmc driver is for a specific SOC based on mips,
> > In order to compile it I installed mips compiler:
> >
> > sudo apt install gcc-mips-linux-gnu
> >
> > and set:
> > export CROSS_COMPILE=mips-linux-gnu-
> > export ARCH=mips
> >
> > Then I used an initial .config file
> > from arch/mips/configs/generic_defconfig.
> > In the menuconfig ,
> > under "Machine Selection" I choose "Ralink SoC selection (MT7621)"
> > under  "Device Drivers" I chose "MMC/SD/SDIO card support" as a module.
> > under "Device Drivers -> staging drivers" I chose "MTK SD/MMC"
> >
> > Then when compiling, the files in  drivers/staging/mt7621-mmc/ compiled
> ok,
> > but I had compilation error in drivers/staging/mt7621-pci/pci-mt7621.c,
> > with the first error:
> >
> > drivers/staging/mt7621-pci/pci-mt7621.c:195:11: error:
> > ‘pci_generic_config_read’ undeclared here (not in a function); did you
> mean
> > ‘pci_write_config_word’?
> >   .read  = pci_generic_config_read,
> >            ^~~~~~~~~~~~~~~~~~~~~~~
> >            pci_write_config_word
>
> Note that pci_generic_config_read is an exported symbol at
> drivers/pci/access.c
>
> <snip>
>
>   int pci_generic_config_read(struct pci_bus *bus, unsigned int devfn,
>                               int where, int size, u32 *val)
>   {
>           void __iomem *addr;
>
>           addr = bus->ops->map_bus(bus, devfn, where);
>           if (!addr) {
>                   *val = ~0;
>                   return PCIBIOS_DEVICE_NOT_FOUND;
>           }
>
>           if (size == 1)
>                   *val = readb(addr);
>           else if (size == 2)
>                   *val = readw(addr);
>           else
>                   *val = readl(addr);
>
>           return PCIBIOS_SUCCESSFUL;
>   }
>   EXPORT_SYMBOL_GPL(pci_generic_config_read);
>
> </snip>
>
> And then looking at drivers/pci/Makefile
>
>    obj-$(CONFIG_PCI)               += access.o bus.o probe.o host-bridge.o
> \
>                                       remove.o pci.o pci-driver.o search.o
> \
>                                       pci-sysfs.o rom.o setup-res.o irq.o
> vpd.o \
>                                       setup-bus.o vc.o mmap.o setup-irq.o
>
> and grepping for CONFIG_PCI in your chosen .config
>
> himanshu@himanshu-Vostro-3559:~/linux-next$ git grep -w "CONFIG_PCI"
> arch/mips/configs/generic_defconfig
> himanshu@himanshu-Vostro-3559:~/linux-next$
>
> So, you need to select CONFIG_PCI in order to export that symbol to be
> used by pci-mt7621.c and then there will be no warnings.
>
> Check it once yourself...
>
> Hi, I choose the CONFIG_PCI option, it did solve the undefined symbols,
but the file still does not compile starting with the error:

drivers/staging/mt7621-pci/pci-mt7621.c:496:27: error: ‘port’ undeclared
(first use in this function); did you mean ‘ror8’?
  list_for_each_entry_safe(port, tmp, &pcie->ports, list) {

I saw that in other usages of list_for_each_entry_safe, the first parameter
is a local variable.


>
> > Then in run "make menuconfig" again and under "Device Drivers -> staging
> > drivers" I chose "MediaTek MT7621 PCI Controller"
> > Hoping it will solve it , but it didn't.
> >
> > The files I prepared the patchset for did compile ok , is it important
> that
> > all files will compile?
>
> I think for these changes just use that .config supplied by the distro
> at /boot/config-*
>
> But IIRC `make allyesconfig` should be used(not sure though..)
>

But I compile on ubuntu on x86 and I want to compile to a specific mips SoC.
I tried it anyway and it did not compile the file  I prepared the patch for
(drivers/staging/mt7621-mmc/sd.c)

Lastly, please avoid "top posting" :)
>

Won't happen again :)
Dafna

>
>
Hope that helps,
>
> Thanks
> --
> Himanshu Jha
> Undergraduate Student
> Department of Electronics & Communication
> Guru Tegh Bahadur Institute of Technology
>

[-- Attachment #2: Type: text/html, Size: 5825 bytes --]

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02 15:31             ` Dafna Hirschfeld
@ 2018-10-02 20:05               ` Himanshu Jha
  2018-10-02 20:17                 ` Vaishali Thakkar
  2018-10-02 20:24                 ` Julia Lawall
  0 siblings, 2 replies; 19+ messages in thread
From: Himanshu Jha @ 2018-10-02 20:05 UTC (permalink / raw)
  To: Dafna Hirschfeld; +Cc: Julia Lawall, gregkh, outreachy-kernel, hdegoede

> > Hi, I choose the CONFIG_PCI option, it did solve the undefined symbols,
> but the file still does not compile starting with the error:
> 
> drivers/staging/mt7621-pci/pci-mt7621.c:496:27: error: ‘port’ undeclared
> (first use in this function); did you mean ‘ror8’?
>   list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
> 
> I saw that in other usages of list_for_each_entry_safe, the first parameter
> is a local variable.

Correct! Both port & tmp should be a local variable of the same object
type.

> > > Then in run "make menuconfig" again and under "Device Drivers -> staging
> > > drivers" I chose "MediaTek MT7621 PCI Controller"
> > > Hoping it will solve it , but it didn't.
> > >
> > > The files I prepared the patchset for did compile ok , is it important
> > that
> > > all files will compile?
> >
> > I think for these changes just use that .config supplied by the distro
> > at /boot/config-*
> >
> > But IIRC `make allyesconfig` should be used(not sure though..)
> >
> 
> But I compile on ubuntu on x86 and I want to compile to a specific mips SoC.
> I tried it anyway and it did not compile the file  I prepared the patch for
> (drivers/staging/mt7621-mmc/sd.c)

Cool! 
You found a bug while cross-compiling for MIPS which would not
show up on x86.

Btw, the Cc list should contain developers who might give you
a better feedback. Therefore, use `get_maintainer` to list all
those people.


-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology


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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02 20:05               ` Himanshu Jha
@ 2018-10-02 20:17                 ` Vaishali Thakkar
  2018-10-02 20:56                   ` Vaishali Thakkar
  2018-10-02 20:24                 ` Julia Lawall
  1 sibling, 1 reply; 19+ messages in thread
From: Vaishali Thakkar @ 2018-10-02 20:17 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: dafna3, Julia Lawall, Greg KH, outreachy-kernel, hdegoede

On Wed, Oct 3, 2018 at 1:35 AM Himanshu Jha <himanshujha199640@gmail.com> wrote:
>
> > > Hi, I choose the CONFIG_PCI option, it did solve the undefined symbols,
> > but the file still does not compile starting with the error:
> >
> > drivers/staging/mt7621-pci/pci-mt7621.c:496:27: error: ‘port’ undeclared
> > (first use in this function); did you mean ‘ror8’?
> >   list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
> >
> > I saw that in other usages of list_for_each_entry_safe, the first parameter
> > is a local variable.
>
> Correct! Both port & tmp should be a local variable of the same object
> type.
>
> > > > Then in run "make menuconfig" again and under "Device Drivers -> staging
> > > > drivers" I chose "MediaTek MT7621 PCI Controller"
> > > > Hoping it will solve it , but it didn't.
> > > >
> > > > The files I prepared the patchset for did compile ok , is it important
> > > that
> > > > all files will compile?
> > >
> > > I think for these changes just use that .config supplied by the distro
> > > at /boot/config-*
> > >
> > > But IIRC `make allyesconfig` should be used(not sure though..)
> > >
> >
> > But I compile on ubuntu on x86 and I want to compile to a specific mips SoC.
> > I tried it anyway and it did not compile the file  I prepared the patch for
> > (drivers/staging/mt7621-mmc/sd.c)
>
> Cool!
> You found a bug while cross-compiling for MIPS which would not
> show up on x86.
>
> Btw, the Cc list should contain developers who might give you
> a better feedback. Therefore, use `get_maintainer` to list all
> those people.

Hi Himanshu,

For Outreachy applicants, we usually do not advice to use 'get_maintainer.pl'
when it comes to sending cleanup patches and contributions to staging drivers
[unless driver specific maintainers have asked for that].

>
> --
> Himanshu Jha
> Undergraduate Student
> Department of Electronics & Communication
> Guru Tegh Bahadur Institute of Technology
>
> --
> 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/20181002200507.GA26645%40himanshu-Vostro-3559.
> For more options, visit https://groups.google.com/d/optout.



-- 
Vaishali
http://vaishalithakkar.in/


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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02 20:05               ` Himanshu Jha
  2018-10-02 20:17                 ` Vaishali Thakkar
@ 2018-10-02 20:24                 ` Julia Lawall
  1 sibling, 0 replies; 19+ messages in thread
From: Julia Lawall @ 2018-10-02 20:24 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: Dafna Hirschfeld, gregkh, outreachy-kernel, hdegoede

[-- Attachment #1: Type: text/plain, Size: 3518 bytes --]



On Wed, 3 Oct 2018, Himanshu Jha wrote:

> > > Hi, I choose the CONFIG_PCI option, it did solve the undefined symbols,
> > but the file still does not compile starting with the error:
> >
> > drivers/staging/mt7621-pci/pci-mt7621.c:496:27: error: ‘port’ undeclared
> > (first use in this function); did you mean ‘ror8’?
> >   list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
> >
> > I saw that in other usages of list_for_each_entry_safe, the first parameter
> > is a local variable.
>
> Correct! Both port & tmp should be a local variable of the same object
> type.

I don't think it is necessary for either of them to be local variables.
It might be a bit strange for them to be global variables, but there isn't
any intrinsic problem.  Of course, it is necessary for the variable to be
declared somewhere, which does not seem to be the case here.

Actually, one could take a moment to think about why these variables have
to already be declared.  Indeed, if the loop exits in a normal way, then
the first argument ends up pointing to the head of the list, which is a
dummy value and not useful for much of anything.  Referring to it is
typically a bug.  But sometimes it is useful to break out of such a loop,
so then the variable has to be visible in the enclosing scope.

I'm not sure if there is any practical use of having the temporary
variable in the second argument of list_for_each_entry_safe have a
lifetime outside of the loop.  It is just a pointer to get from one
element to the next one, in case the element that the first argument is
pointing to is removed from the list.  But it is necessary to be able to
specify the name for this variable, to be sure that it doesn't conflict
with anything else, and then it might be considered strange for a macro to
be declaring new variables; it is safer to have the scope of the variable
be apparent in the visible source code.

julia

>
> > > > Then in run "make menuconfig" again and under "Device Drivers -> staging
> > > > drivers" I chose "MediaTek MT7621 PCI Controller"
> > > > Hoping it will solve it , but it didn't.
> > > >
> > > > The files I prepared the patchset for did compile ok , is it important
> > > that
> > > > all files will compile?
> > >
> > > I think for these changes just use that .config supplied by the distro
> > > at /boot/config-*
> > >
> > > But IIRC `make allyesconfig` should be used(not sure though..)
> > >
> >
> > But I compile on ubuntu on x86 and I want to compile to a specific mips SoC.
> > I tried it anyway and it did not compile the file  I prepared the patch for
> > (drivers/staging/mt7621-mmc/sd.c)
>
> Cool!
> You found a bug while cross-compiling for MIPS which would not
> show up on x86.
>
> Btw, the Cc list should contain developers who might give you
> a better feedback. Therefore, use `get_maintainer` to list all
> those people.
>
>
> --
> Himanshu Jha
> Undergraduate Student
> Department of Electronics & Communication
> Guru Tegh Bahadur Institute of Technology
>
> --
> 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/20181002200507.GA26645%40himanshu-Vostro-3559.
> For more options, visit https://groups.google.com/d/optout.
>

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02 20:17                 ` Vaishali Thakkar
@ 2018-10-02 20:56                   ` Vaishali Thakkar
  0 siblings, 0 replies; 19+ messages in thread
From: Vaishali Thakkar @ 2018-10-02 20:56 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: dafna3, Julia Lawall, Greg KH, outreachy-kernel, hdegoede

On Wed, Oct 3, 2018 at 1:47 AM Vaishali Thakkar <vthakkar1994@gmail.com> wrote:
>
> On Wed, Oct 3, 2018 at 1:35 AM Himanshu Jha <himanshujha199640@gmail.com> wrote:
> >
> > > > Hi, I choose the CONFIG_PCI option, it did solve the undefined symbols,
> > > but the file still does not compile starting with the error:
> > >
> > > drivers/staging/mt7621-pci/pci-mt7621.c:496:27: error: ‘port’ undeclared
> > > (first use in this function); did you mean ‘ror8’?
> > >   list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
> > >
> > > I saw that in other usages of list_for_each_entry_safe, the first parameter
> > > is a local variable.
> >
> > Correct! Both port & tmp should be a local variable of the same object
> > type.
> >
> > > > > Then in run "make menuconfig" again and under "Device Drivers -> staging
> > > > > drivers" I chose "MediaTek MT7621 PCI Controller"
> > > > > Hoping it will solve it , but it didn't.
> > > > >
> > > > > The files I prepared the patchset for did compile ok , is it important
> > > > that
> > > > > all files will compile?
> > > >
> > > > I think for these changes just use that .config supplied by the distro
> > > > at /boot/config-*
> > > >
> > > > But IIRC `make allyesconfig` should be used(not sure though..)
> > > >
> > >
> > > But I compile on ubuntu on x86 and I want to compile to a specific mips SoC.
> > > I tried it anyway and it did not compile the file  I prepared the patch for
> > > (drivers/staging/mt7621-mmc/sd.c)
> >
> > Cool!
> > You found a bug while cross-compiling for MIPS which would not
> > show up on x86.
> >
> > Btw, the Cc list should contain developers who might give you
> > a better feedback. Therefore, use `get_maintainer` to list all
> > those people.
>
> Hi Himanshu,
>
> For Outreachy applicants, we usually do not advice to use 'get_maintainer.pl'
> when it comes to sending cleanup patches and contributions to staging drivers
> [unless driver specific maintainers have asked for that].

Sorry Himanshu, I missed that it's been changed in the process for applicants.
So, now driver maintainers need to be cc'ed and need to opt out if they don't
want patches coming from Outreachy mailing list. Sorry about the earlier
correction.

Dafna,

Himanshu is right. We have this text in the tutorial:

"News This year, we ask that you send all patches to the appropriate
staging driver maintainers, as well as to the outreachy mailing list. See
Submit a patch for more information. For IIO patches, be sure to send them
to linux-iio@vger.kernel.org"

> >
> > --
> > Himanshu Jha
> > Undergraduate Student
> > Department of Electronics & Communication
> > Guru Tegh Bahadur Institute of Technology
> >
> > --
> > 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/20181002200507.GA26645%40himanshu-Vostro-3559.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Vaishali
> http://vaishalithakkar.in/



-- 
Vaishali
http://vaishalithakkar.in/


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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-02  9:39             ` Julia Lawall
@ 2018-10-03 18:10               ` Dafna Hirschfeld
  2018-10-03 19:00                 ` Julia Lawall
  0 siblings, 1 reply; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-10-03 18:10 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Himanshu Jha, gregkh, outreachy-kernel, hdegoede, john

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

On Wed, Oct 3, 2018 at 7:06 AM Julia Lawall <julia.lawall@lip6.fr> wrote:

> > > Then in run "make menuconfig" again and under "Device Drivers ->
> staging
> > > drivers" I chose "MediaTek MT7621 PCI Controller"
> > > Hoping it will solve it , but it didn't.
> > >
> > > The files I prepared the patchset for did compile ok , is it important
> that
> > > all files will compile?
> >
> > I think for these changes just use that .config supplied by the distro
> > at /boot/config-*
> >
> > But IIRC `make allyesconfig` should be used(not sure though..)
>
> Dafna,
>
> It is important that the driver continues to compile.
>
> Hi,
Fixing the compilation error in drivers/staging/mt7621-pci/pci-mt7621.c is
not triveal,
It is not clear what type `port` and `tmp` should be.

Dafna

Make allyesconfig is often a good option.
>
> julia
>

[-- Attachment #2: Type: text/html, Size: 1464 bytes --]

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-03 18:10               ` Dafna Hirschfeld
@ 2018-10-03 19:00                 ` Julia Lawall
  2018-10-03 19:36                   ` Dafna Hirschfeld
  0 siblings, 1 reply; 19+ messages in thread
From: Julia Lawall @ 2018-10-03 19:00 UTC (permalink / raw)
  To: Dafna Hirschfeld; +Cc: Himanshu Jha, gregkh, outreachy-kernel, hdegoede, john

[-- Attachment #1: Type: text/plain, Size: 1697 bytes --]



On Wed, 3 Oct 2018, Dafna Hirschfeld wrote:

>
>
> On Wed, Oct 3, 2018 at 7:06 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
>       > > Then in run "make menuconfig" again and under "Device
>       Drivers -> staging
>       > > drivers" I chose "MediaTek MT7621 PCI Controller"
>       > > Hoping it will solve it , but it didn't.
>       > >
>       > > The files I prepared the patchset for did compile ok , is it
>       important that
>       > > all files will compile?
>       >
>       > I think for these changes just use that .config supplied by
>       the distro
>       > at /boot/config-*
>       >
>       > But IIRC `make allyesconfig` should be used(not sure though..)
>
>       Dafna,
>
>       It is important that the driver continues to compile.
>
> Hi,
> Fixing the compilation error in drivers/staging/mt7621-pci/pci-mt7621.c is
> not triveal,
> It is not clear what type `port` and `tmp` should be.

pcie has a type.  I think it is possible to figure it out from there.  YOu
can also see how port is used, for confirmation.

julia

>  
> Dafna
>
>       Make allyesconfig is often a good option.
>
>       julia
>
> --
> 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 visithttps://groups.google.com/d/msgid/outreachy-kernel/CAJ1myNRF%2B1S%3DepCMJxU
> a1YrdPK4p80CiPn2FDdqw5mnwTq%2BmQA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-03 19:00                 ` Julia Lawall
@ 2018-10-03 19:36                   ` Dafna Hirschfeld
  2018-10-03 19:40                     ` Julia Lawall
  0 siblings, 1 reply; 19+ messages in thread
From: Dafna Hirschfeld @ 2018-10-03 19:36 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Himanshu Jha, gregkh, outreachy-kernel, hdegoede, john

[-- Attachment #1: Type: text/plain, Size: 2329 bytes --]

On Wed, Oct 3, 2018 at 10:05 PM Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Wed, 3 Oct 2018, Dafna Hirschfeld wrote:
>
> >
> >
> > On Wed, Oct 3, 2018 at 7:06 AM Julia Lawall <julia.lawall@lip6.fr>
> wrote:
> >       > > Then in run "make menuconfig" again and under "Device
> >       Drivers -> staging
> >       > > drivers" I chose "MediaTek MT7621 PCI Controller"
> >       > > Hoping it will solve it , but it didn't.
> >       > >
> >       > > The files I prepared the patchset for did compile ok , is it
> >       important that
> >       > > all files will compile?
> >       >
> >       > I think for these changes just use that .config supplied by
> >       the distro
> >       > at /boot/config-*
> >       >
> >       > But IIRC `make allyesconfig` should be used(not sure though..)
> >
> >       Dafna,
> >
> >       It is important that the driver continues to compile.
> >
> > Hi,
> > Fixing the compilation error in drivers/staging/mt7621-pci/pci-mt7621.c
> is
> > not triveal,
> > It is not clear what type `port` and `tmp` should be.
>
> pcie has a type.  I think it is possible to figure it out from there.  YOu
> can also see how port is used, for confirmation.
>
> julia
>
> The code is:

list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
                u32 slot = port->slot;
                val = read_config(pcie, slot, 0x70c);
                dev_info(dev, "Port %d N_FTS = %x\n", (unsigned int)val,
slot);
        }

where `pcie` is of type `struct mt7621_pcie*` and `pcie->ports` is `struct
list_head`
I guess `port` should be `struct mt7621_pcie_port` but this struct does not
have a `slot` member.

Dafna

> >
> > Dafna
> >
> >       Make allyesconfig is often a good option.
> >
> >       julia
> >
> > --
> > 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 visithttps://
> groups.google.com/d/msgid/outreachy-kernel/CAJ1myNRF%2B1S%3DepCMJxU
> > a1YrdPK4p80CiPn2FDdqw5mnwTq%2BmQA%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >

[-- Attachment #2: Type: text/html, Size: 3952 bytes --]

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

* Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
  2018-10-03 19:36                   ` Dafna Hirschfeld
@ 2018-10-03 19:40                     ` Julia Lawall
  0 siblings, 0 replies; 19+ messages in thread
From: Julia Lawall @ 2018-10-03 19:40 UTC (permalink / raw)
  To: Dafna Hirschfeld; +Cc: Himanshu Jha, gregkh, outreachy-kernel, hdegoede, john

[-- Attachment #1: Type: text/plain, Size: 3702 bytes --]



On Wed, 3 Oct 2018, Dafna Hirschfeld wrote:

>
>
> On Wed, Oct 3, 2018 at 10:05 PM Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>       On Wed, 3 Oct 2018, Dafna Hirschfeld wrote:
>
>       >
>       >
>       > On Wed, Oct 3, 2018 at 7:06 AM Julia Lawall
>       <julia.lawall@lip6.fr> wrote:
>       >       > > Then in run "make menuconfig" again and under
>       "Device
>       >       Drivers -> staging
>       >       > > drivers" I chose "MediaTek MT7621 PCI Controller"
>       >       > > Hoping it will solve it , but it didn't.
>       >       > >
>       >       > > The files I prepared the patchset for did compile ok
>       , is it
>       >       important that
>       >       > > all files will compile?
>       >       >
>       >       > I think for these changes just use that .config
>       supplied by
>       >       the distro
>       >       > at /boot/config-*
>       >       >
>       >       > But IIRC `make allyesconfig` should be used(not sure
>       though..)
>       >
>       >       Dafna,
>       >
>       >       It is important that the driver continues to compile.
>       >
>       > Hi,
>       > Fixing the compilation error
>       in drivers/staging/mt7621-pci/pci-mt7621.c is
>       > not triveal,
>       > It is not clear what type `port` and `tmp` should be.
>
>       pcie has a type.  I think it is possible to figure it out from
>       there.  YOu
>       can also see how port is used, for confirmation.
>
>       julia
>
> The code is:
>
> list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
>                 u32 slot = port->slot;
>                 val = read_config(pcie, slot, 0x70c);
>                 dev_info(dev, "Port %d N_FTS = %x\n", (unsigned int)val,
> slot);
>         }
>
> where `pcie` is of type `struct mt7621_pcie*` and `pcie->ports` is `struct
> list_head`
> I guess `port` should be `struct mt7621_pcie_port` but this struct does not
> have a `slot` member.

Maybe there is code somewhere adding elements to the list?

As a last resort, you could write to the person who produced the patch,
and ask him what he had in mind.  It's possible that the code is just
copied from somewhere else, and doesn't make sense at all.

julia

>
> Dafna
>       >  
>       > Dafna
>       >
>       >       Make allyesconfig is often a good option.
>       >
>       >       julia
>       >
>       > --
>       > 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 webvisithttps://groups.google.com/d/msgid/outreachy-kernel/CAJ1myNRF%2B1S%3Dep
>       CMJxU
>       > a1YrdPK4p80CiPn2FDdqw5mnwTq%2BmQA%40mail.gmail.com.
>       > For more options, visit https://groups.google.com/d/optout.
>       >
>       >
>
> --
> 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 visithttps://groups.google.com/d/msgid/outreachy-kernel/CAJ1myNRTErSd_p5KdY6VvG9
> qu%2Be9R5QcAeJsfmO_aXkqL_SOxw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

end of thread, other threads:[~2018-10-03 19:40 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-30 19:04 [PATCH 0/3] *** Cleanup patches for mt7621-mmc staging driver *** Dafna Hirschfeld
2018-09-30 19:04 ` [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements Dafna Hirschfeld
2018-09-30 20:18   ` [Outreachy kernel] " Julia Lawall
2018-10-01  7:57     ` Dafna Hirschfeld
2018-10-01  8:47       ` Julia Lawall
2018-10-02  8:24         ` Dafna Hirschfeld
2018-10-02  9:28           ` Himanshu Jha
2018-10-02  9:39             ` Julia Lawall
2018-10-03 18:10               ` Dafna Hirschfeld
2018-10-03 19:00                 ` Julia Lawall
2018-10-03 19:36                   ` Dafna Hirschfeld
2018-10-03 19:40                     ` Julia Lawall
2018-10-02 15:31             ` Dafna Hirschfeld
2018-10-02 20:05               ` Himanshu Jha
2018-10-02 20:17                 ` Vaishali Thakkar
2018-10-02 20:56                   ` Vaishali Thakkar
2018-10-02 20:24                 ` Julia Lawall
2018-09-30 19:04 ` [PATCH 2/3] staging: mt7621-mmc: Fix comparison to NULL Dafna Hirschfeld
2018-09-30 19:04 ` [PATCH 3/3] staging: mt7621-mmc: replace `printk` with preferred API Dafna Hirschfeld

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.