All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c
@ 2018-12-05 16:10 Nishad Kamdar
  2018-12-05 21:08 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Nishad Kamdar @ 2018-12-05 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Joe Perches, NeilBrown
  Cc: devel, Christian Lütke-Stetzkamp, linux-kernel,
	John Crispin, Dan Carpenter

The below patch
https://lore.kernel.org/patchwork/patch/995533/
does not completely remove an #if 0 block in sd.c.
This causes the function msdc_select_clksrc()
which was earler not compiled, to be compiled.
That causes an error - MSDC_CLKSRC_REG is not
defined.

This patch completely removes the #if 0 block

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
---
 drivers/staging/mt7621-mmc/sd.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 7b66f9b0a094..3d918e481bd8 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
 	spin_unlock(&host->lock);
 }
 
-static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
-{
-	u32 val;
-
-	BUG_ON(clksrc > 3);
-
-	val = readl(host->base + MSDC_CLKSRC_REG);
-	if (readl(host->base + MSDC_ECO_VER) >= 4) {
-		val &= ~(0x3  << clk_src_bit[host->id]);
-		val |= clksrc << clk_src_bit[host->id];
-	} else {
-		val &= ~0x3; val |= clksrc;
-	}
-	writel(val, host->base + MSDC_CLKSRC_REG);
-
-	host->hclk = hclks[clksrc];
-	host->hw->clk_src = clksrc;
-}
-#endif /* end of --- */
-
 static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
 {
 	//struct msdc_hw *hw = host->hw;
-- 
2.17.1


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

* Re: [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c
  2018-12-05 16:10 [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c Nishad Kamdar
@ 2018-12-05 21:08 ` NeilBrown
  2018-12-06 15:43   ` Nishad Kamdar
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2018-12-05 21:08 UTC (permalink / raw)
  To: Nishad Kamdar, Greg Kroah-Hartman, Joe Perches
  Cc: devel, Christian Lütke-Stetzkamp, linux-kernel,
	John Crispin, Dan Carpenter

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

On Wed, Dec 05 2018, Nishad Kamdar wrote:

> The below patch
> https://lore.kernel.org/patchwork/patch/995533/
> does not completely remove an #if 0 block in sd.c.

Standard practice is to identify patches by their commit id.
In this case you could
  git log --oneline  drivers/staging/mt7621-mmc/sd.c

choose the right patch, and copy/paste with a bit of editing, so:

  Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in
  sd.c") does not completely ....

I have

  [alias]
  	cm = !git --no-pager show -s --format=cm
	fx = !git --no-pager show -s --format=fixes
  [pretty]
	fixes = Fixes: %h (\"%s\")
	cm = Commit %h (\"%s\")

in my $HOME/.gitconfig so I can get the text with, e.g.,

  $ git cm 2a54e3259e2a
  Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")

Then as that commit introduced a problem, it is best-practice to also do

  $ git fx 2a54e3259e2a
  Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")

and add the "Fixes" near the Signed-off-by line.

Thanks,
NeilBrown


> This causes the function msdc_select_clksrc()
> which was earler not compiled, to be compiled.
> That causes an error - MSDC_CLKSRC_REG is not
> defined.
>
> This patch completely removes the #if 0 block
>
> Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
> ---
>  drivers/staging/mt7621-mmc/sd.c | 20 --------------------
>  1 file changed, 20 deletions(-)
>
> diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
> index 7b66f9b0a094..3d918e481bd8 100644
> --- a/drivers/staging/mt7621-mmc/sd.c
> +++ b/drivers/staging/mt7621-mmc/sd.c
> @@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
>  	spin_unlock(&host->lock);
>  }
>  
> -static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
> -{
> -	u32 val;
> -
> -	BUG_ON(clksrc > 3);
> -
> -	val = readl(host->base + MSDC_CLKSRC_REG);
> -	if (readl(host->base + MSDC_ECO_VER) >= 4) {
> -		val &= ~(0x3  << clk_src_bit[host->id]);
> -		val |= clksrc << clk_src_bit[host->id];
> -	} else {
> -		val &= ~0x3; val |= clksrc;
> -	}
> -	writel(val, host->base + MSDC_CLKSRC_REG);
> -
> -	host->hclk = hclks[clksrc];
> -	host->hw->clk_src = clksrc;
> -}
> -#endif /* end of --- */
> -
>  static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
>  {
>  	//struct msdc_hw *hw = host->hw;
> -- 
> 2.17.1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c
  2018-12-05 21:08 ` NeilBrown
@ 2018-12-06 15:43   ` Nishad Kamdar
  0 siblings, 0 replies; 3+ messages in thread
From: Nishad Kamdar @ 2018-12-06 15:43 UTC (permalink / raw)
  To: NeilBrown, Greg Kroah-Hartman, Joe Perches
  Cc: devel, Christian Lütke-Stetzkamp, linux-kernel, Dan Carpenter

On Thu, Dec 06, 2018 at 08:08:24AM +1100, NeilBrown wrote:
> On Wed, Dec 05 2018, Nishad Kamdar wrote:
> 
> > The below patch
> > https://lore.kernel.org/patchwork/patch/995533/
> > does not completely remove an #if 0 block in sd.c.
> 
> Standard practice is to identify patches by their commit id.
> In this case you could
>   git log --oneline  drivers/staging/mt7621-mmc/sd.c
> 
> choose the right patch, and copy/paste with a bit of editing, so:
> 
>   Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in
>   sd.c") does not completely ....
> 
> I have
> 
>   [alias]
>   	cm = !git --no-pager show -s --format=cm
> 	fx = !git --no-pager show -s --format=fixes
>   [pretty]
> 	fixes = Fixes: %h (\"%s\")
> 	cm = Commit %h (\"%s\")
> 
> in my $HOME/.gitconfig so I can get the text with, e.g.,
> 
>   $ git cm 2a54e3259e2a
>   Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
> 
> Then as that commit introduced a problem, it is best-practice to also do
> 
>   $ git fx 2a54e3259e2a
>   Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
> 
> and add the "Fixes" near the Signed-off-by line.
> 
> Thanks,
> NeilBrown
> 
> 
Ok. I'll do that and resubmit.

Thanks for the review and guidance.

Regards,
Nishad

> > This causes the function msdc_select_clksrc()
> > which was earler not compiled, to be compiled.
> > That causes an error - MSDC_CLKSRC_REG is not
> > defined.
> >
> > This patch completely removes the #if 0 block
> >
> > Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
> > ---
> >  drivers/staging/mt7621-mmc/sd.c | 20 --------------------
> >  1 file changed, 20 deletions(-)
> >
> > diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
> > index 7b66f9b0a094..3d918e481bd8 100644
> > --- a/drivers/staging/mt7621-mmc/sd.c
> > +++ b/drivers/staging/mt7621-mmc/sd.c
> > @@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
> >  	spin_unlock(&host->lock);
> >  }
> >  
> > -static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
> > -{
> > -	u32 val;
> > -
> > -	BUG_ON(clksrc > 3);
> > -
> > -	val = readl(host->base + MSDC_CLKSRC_REG);
> > -	if (readl(host->base + MSDC_ECO_VER) >= 4) {
> > -		val &= ~(0x3  << clk_src_bit[host->id]);
> > -		val |= clksrc << clk_src_bit[host->id];
> > -	} else {
> > -		val &= ~0x3; val |= clksrc;
> > -	}
> > -	writel(val, host->base + MSDC_CLKSRC_REG);
> > -
> > -	host->hclk = hclks[clksrc];
> > -	host->hw->clk_src = clksrc;
> > -}
> > -#endif /* end of --- */
> > -
> >  static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
> >  {
> >  	//struct msdc_hw *hw = host->hw;
> > -- 
> > 2.17.1



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

end of thread, other threads:[~2018-12-06 15:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 16:10 [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c Nishad Kamdar
2018-12-05 21:08 ` NeilBrown
2018-12-06 15:43   ` Nishad Kamdar

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.