*** Cleanup patches for mt7621-mmc staging driver ***
Subsystems (2)
cover *** Cleanup patches for mt7621-mmc staging driver ***
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(-)
Signature · 1 line
2.17.1
PATCH 1/3 staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Remove unnecessary braces from one line 'if' statements. Issues found with checkpatch.pl
--- drivers/staging/mt7621-mmc/sd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/mt7621-mmc/sd.c +3 -6
@@ -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
Signature · 1 line
2.17.1
PATCH 2/3 staging: mt7621-mmc: Fix comparison to NULL
In reply to Dafna HirschfeldReplace comparisons of a variable 'x' to NULL with either 'x' or '!x'.
Issues found with checkpatch.pl
--- drivers/staging/mt7621-mmc/sd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/mt7621-mmc/sd.c +5 -5
@@ -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 ];
Signature · 1 line
2.17.1
PATCH 3/3 staging: mt7621-mmc: replace `printk` with preferred API
In reply to Dafna HirschfeldReplace calls to printk with dev_info and pr_err Issues found with checkpatch.pl
--- drivers/staging/mt7621-mmc/sd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/mt7621-mmc/sd.c +3 -3
@@ -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; }
Signature · 1 line
2.17.1
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
In reply to Dafna HirschfeldQuoted 24 lines · Dafna Hirschfeld
Remove unnecessary braces from one line 'if' statements. Issues found with checkpatch.pl
Signed-off-by Dafna Hirschfeld <[email protected]>--- drivers/staging/mt7621-mmc/sd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)drivers/staging/mt7621-mmc/sd.c +1
-2@@ -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 ) {
drivers/staging/mt7621-mmc/sd.c static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 969
Quoted 5 lines
drivers/staging/mt7621-mmc/sd.c +1
-1@@ -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
Quoted 23 lines
drivers/staging/mt7621-mmc/sd.c +1
-4msdc_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 [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/bf3ba7a38f000d4359c4c56fac98f17ae3ef6a2b.1538333858.git.dafna3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 35 lines · Julia Lawall
Review
Quoted 9 lines · Dafna Hirschfeld
Remove unnecessary braces from one line 'if' statements. Issues found with checkpatch.pl
Signed-off-by Dafna Hirschfeld <[email protected]>--- drivers/staging/mt7621-mmc/sd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/staging/mt7621-mmc/sd.cQuoted 4 lines
index
e3c1546373ba..8c32cec5950a100644drivers/staging/mt7621-mmc/sd.c static void msdc_pm(pm_message_t state, void *data) · line 527
Quoted 10 lines
drivers/staging/mt7621-mmc/sd.c +1
-2@@ -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) {drivers/staging/mt7621-mmc/sd.c static int msdc_do_request(struct mmc_host *mmc,
Quoted 1 line
drivers/staging/mt7621-mmc/sd.c +0
-0@@ -967,16 +966,14 @@ static int msdc_do_request(struct mmc_host *mmc,struct
mmc_request*mrq)drivers/staging/mt7621-mmc/sd.c static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
Quoted 4 lines
drivers/staging/mt7621-mmc/sd.c +0
-1//if(host->id==1) { if (send_type ==SND_CMD ) {if (cmd->opcode ==MMC_SEND_STATUS ) { - if ((cmd->resp[0] & CARD_READY_FOR_DATA) ||
Quoted 9 lines
(
CARD_CURRENT_STATE(cmd->resp[0])!= 7)) {drivers/staging/mt7621-mmc/sd.c static int msdc_do_request(struct mmc_host *mmc, · line 969
Quoted 1 line
drivers/staging/mt7621-mmc/sd.c +1
-0+ 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
Quoted 28 lines
Quoted 16 lines
drivers/staging/mt7621-mmc/sd.c +1
-4msdc_gate_clock(host->id); - } }else {msdc_gate_clock (host->id); } }else { -if (read) { +if (read)msdc_gate_clock (host->id); - } }//} #else --2.17.1
Quoted 2 lines
--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 52 lines · Dafna Hirschfeld
On Mon, Oct 1, 2018 at 12:55 AM Julia Lawall <[email protected]> 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 <[email protected]> > --- >ᅵ 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
Quoted 1 line
So add it as a 4th patch in the patchset ?
That would be fine.
julia
Quoted 42 lines
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 [email protected]. > To post to this group, send email to [email protected]. > 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 [email protected].
To post to this group, send email to [email protected].
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.
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
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_wordThen 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
Quoted 107 lines · Julia Lawall
Quoted 3 lines · Dafna Hirschfeld
On Mon, Oct 1, 2018 at 12:55 AM Julia Lawall <[email protected]>
Quoted 49 lines · 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 <[email protected]> > --- > 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. juliaQuoted 1 line
So add it as a 4th patch in the patchset ?
That would be fine.
julia
Quoted 19 lines
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 > > --Quoted 8 lines
> 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 visithttps://groups.google.com/d/msgid/outreachy-kernel/bf3ba7a38f000d4359c4c56f
Quoted 11 lines
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 [email protected].
To post to this group, send email to [email protected]. To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/CAJ1myNR7951qEF6hpN8DRJ-
Quoted 4 lines
hmckXMOzZWnzBJWrYqdaRoPLb2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Hi Dafna,
Quoted 21 lines · Dafna Hirschfeld
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=mipsThen I used an initial .config file
fromarch/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 indrivers/staging/mt7621-pci/pci-mt7621.c, with the first error:
Quoted 6 lines
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.oand 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...
Quoted 6 lines
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
Signature · 4 lines
Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 11 lines
Quoted 6 lines
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 allyesconfigshould be used(not sure though..)
Dafna,
It is important that the driver continues to compile.
Make allyesconfig is often a good option.
julia
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
In reply to Himanshu JhaQuoted 78 lines · Himanshu Jha
Hi Dafna,
Quoted 10 lines · Dafna Hirschfeld
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=mipsQuoted 8 lines
Then I used an initial .config file
fromarch/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/compiledok,
Quoted 5 lines
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 youmean
Quoted 4 lines
‘pci_write_config_word’?
.read =pci_generic_config_read,^~~~~~~~~~~~~~~~~~~~~~~ pci_write_config_wordNote that
pci_generic_config_readis an exported symbol atdrivers/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/Makefileobj-$(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.oand grepping for
CONFIG_PCIin your chosen .confighimanshu@himanshu-Vostro-3559:~/linux-next$ git grep -w "CONFIG_PCI" arch/mips/configs/generic_defconfig himanshu@himanshu-Vostro-3559:~/linux-next$
Quoted 6 lines
So, you need to select
CONFIG_PCIin order to export that symbol to be used bypci-mt7621.cand then there will be no warnings.Check it once yourself...
Hi, I choose the
CONFIG_PCIoption, 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.
Quoted 5 lines
Quoted 5 lines
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.
Quoted 9 lines
Quoted 1 line
The files I prepared the patchset for did compile ok , is it important
that
Quoted 1 line
all files will compile?
I think for these changes just use that .config supplied by the distro at
/boot/config-*But IIRC
make allyesconfigshould 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" :)
Quoted 1 line
Won't happen again :)
Dafna
Quoted 2 lines
Hope that helps,
Quoted 8 lines
Thanks
--
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 9 lines
Quoted 1 line
Hi, I choose the
CONFIG_PCIoption, 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.
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
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
Quoted 1 line
all files will compile?
I think for these changes just use that .config supplied by the distro at
/boot/config-*
Quoted 6 lines
Quoted 2 lines
But IIRC
make allyesconfigshould 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.
Signature · 4 lines
Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 32 lines · Himanshu Jha
Quoted 10 lines
Quoted 2 lines
Hi, I choose the
CONFIG_PCIoption, 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.
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
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
Quoted 1 line
all files will compile?
I think for these changes just use that .config supplied by the distro at
/boot/config-*Quoted 6 lines
Quoted 2 lines
But IIRC
make allyesconfigshould 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)
Quoted 7 lines
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_maintainerto 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].
Quoted 13 lines
--
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 [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/20181002200507.GA26645%40himanshu-Vostro-3559.
For more options, visit https://groups.google.com/d/optout.
Signature · 2 lines
Vaishali http://vaishalithakkar.in/
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
In reply to Himanshu JhaQuoted 7 lines · Himanshu Jha
Quoted 7 lines
Quoted 1 line
Hi, I choose the
CONFIG_PCIoption, 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){
Quoted 5 lines
Quoted 2 lines
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
Quoted 41 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines
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
Quoted 1 line
all files will compile?
I think for these changes just use that .config supplied by the distro at
/boot/config-*Quoted 6 lines
Quoted 2 lines
But IIRC
make allyesconfigshould 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_maintainerto 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 [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/20181002200507.GA26645%40himanshu-Vostro-3559.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
In reply to Vaishali ThakkarQuoted 42 lines · Vaishali Thakkar
Quoted 32 lines · Himanshu Jha
Quoted 10 lines
Quoted 2 lines
Hi, I choose the
CONFIG_PCIoption, 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.
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
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
Quoted 1 line
all files will compile?
I think for these changes just use that .config supplied by the distro at
/boot/config-*Quoted 6 lines
Quoted 2 lines
But IIRC
make allyesconfigshould 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)Quoted 7 lines
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_maintainerto list all those people.
Quoted 5 lines
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 [email protected]"
Quoted 19 lines
Quoted 7 lines
--
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of TechnologyQuoted 6 lines
--
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/20181002200507.GA26645%40himanshu-Vostro-3559.
For more options, visit https://groups.google.com/d/optout.--
Vaishali
http://vaishalithakkar.in/
Signature · 2 lines
Vaishali http://vaishalithakkar.in/
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
In reply to Julia LawallQuoted 12 lines · Julia Lawall
Quoted 1 line
Quoted 1 line
Then in run "make menuconfig" again and under "Device Drivers ->
staging
Quoted 4 lines
Quoted 4 lines
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
Quoted 5 lines
Quoted 1 line
all files will compile?
I think for these changes just use that .config supplied by the distro at
/boot/config-*
Quoted 7 lines
Quoted 1 line
But IIRC
make allyesconfigshould 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.
Quoted 3 lines
julia
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 18 lines · Dafna Hirschfeld
On Wed, Oct 3, 2018 at 7:06 AM Julia Lawall <[email protected]> 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 IIRCmake allyesconfigshould be used(not sure though..)
Quoted 8 lines
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 typeportandtmpshould 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
Quoted 18 lines
DafnaMake 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 [email protected].
To post to this group, send email to [email protected].
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.
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 33 lines · Julia Lawall
Quoted 3 lines · Dafna Hirschfeld
On Wed, Oct 3, 2018 at 7:06 AM Julia Lawall <[email protected]>
Quoted 15 lines · 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 IIRCmake allyesconfigshould be used(not sure though..)Quoted 6 lines
Dafna,
It is important that the driver continues to compile.
Hi,
Fixing the compilation error indrivers/staging/mt7621-pci/pci-mt7621.cis
Quoted 2 lines
not triveal,
It is not clear what typeportandtmpshould be.
Quoted 6 lines
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
Quoted 19 lines
Quoted 7 lines
Dafna
Make allyesconfig is often a good option.
julia
Quoted 7 lines
--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/CAJ1myNRF%2B1S%3DepCMJxU
Quoted 4 lines
a1YrdPK4p80CiPn2FDdqw5mnwTq%2BmQA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements
Quoted 55 lines · Dafna Hirschfeld
On Wed, Oct 3, 2018 at 10:05 PM Julia Lawall <[email protected]> wrote:
On Wed, 3 Oct 2018, Dafna Hirschfeld wrote:
>
>
> On Wed, Oct 3, 2018 at 7:06 AM Julia Lawall <[email protected]> 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 IIRCmake allyesconfigshould 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 typeportandtmpshould 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);
}
Quoted 4 lines
where
pcieis of typestruct mt7621_pcie*andpcie->portsisstruct list_head
I guessportshould bestruct mt7621_pcie_portbut this struct does not have aslotmember.
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
Quoted 36 lines
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 [email protected].
> To post to this group, send email to
[email protected].
> 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 [email protected].
To post to this group, send email to [email protected].
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.