From: "Simon Sandström" <simon@nikanor.nu>
To: gregkh@linuxfoundation.org
Cc: jeremy@azazel.net, dan.carpenter@oracle.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
"Simon Sandström" <simon@nikanor.nu>
Subject: [PATCH 2/6] staging: kpc2000: add space between ) and { in cell_probe.c
Date: Wed, 22 May 2019 22:58:45 +0200 [thread overview]
Message-ID: <20190522205849.17444-3-simon@nikanor.nu> (raw)
In-Reply-To: <20190522205849.17444-1-simon@nikanor.nu>
Fixes checkpatch.pl error "space required before the open brace '{'".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
drivers/staging/kpc2000/kpc2000/cell_probe.c | 36 ++++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc2000/cell_probe.c b/drivers/staging/kpc2000/kpc2000/cell_probe.c
index 6e034d115b47..51d32970f025 100644
--- a/drivers/staging/kpc2000/kpc2000/cell_probe.c
+++ b/drivers/staging/kpc2000/kpc2000/cell_probe.c
@@ -241,8 +241,8 @@ int kp2000_check_uio_irq(struct kp2000_device *pcard, u32 irq_num)
u64 interrupt_active = readq(pcard->sysinfo_regs_base + REG_INTERRUPT_ACTIVE);
u64 interrupt_mask_inv = ~readq(pcard->sysinfo_regs_base + REG_INTERRUPT_MASK);
u64 irq_check_mask = (1 << irq_num);
- if (interrupt_active & irq_check_mask){ // if it's active (interrupt pending)
- if (interrupt_mask_inv & irq_check_mask){ // and if it's not masked off
+ if (interrupt_active & irq_check_mask) { // if it's active (interrupt pending)
+ if (interrupt_mask_inv & irq_check_mask) { // and if it's not masked off
return 1;
}
}
@@ -256,7 +256,7 @@ irqreturn_t kuio_handler(int irq, struct uio_info *uioinfo)
if (irq != kudev->pcard->pdev->irq)
return IRQ_NONE;
- if (kp2000_check_uio_irq(kudev->pcard, kudev->cte.irq_base_num)){
+ if (kp2000_check_uio_irq(kudev->pcard, kudev->cte.irq_base_num)) {
writeq((1 << kudev->cte.irq_base_num), kudev->pcard->sysinfo_regs_base + REG_INTERRUPT_ACTIVE); // Clear the active flag
return IRQ_HANDLED;
}
@@ -272,7 +272,7 @@ int kuio_irqcontrol(struct uio_info *uioinfo, s32 irq_on)
mutex_lock(&pcard->sem);
mask = readq(pcard->sysinfo_regs_base + REG_INTERRUPT_MASK);
- if (irq_on){
+ if (irq_on) {
mask &= ~(1 << (kudev->cte.irq_base_num));
} else {
mask |= (1 << (kudev->cte.irq_base_num));
@@ -292,7 +292,7 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
dev_dbg(&pcard->pdev->dev, "Found UIO core: type = %02d dma = %02x / %02x offset = 0x%x length = 0x%x (%d regs)\n", cte.type, KPC_OLD_S2C_DMA_CH_NUM(cte), KPC_OLD_C2S_DMA_CH_NUM(cte), cte.offset, cte.length, cte.length / 8);
kudev = kzalloc(sizeof(struct kpc_uio_device), GFP_KERNEL);
- if (!kudev){
+ if (!kudev) {
dev_err(&pcard->pdev->dev, "probe_core_uio: failed to kzalloc kpc_uio_device\n");
return -ENOMEM;
}
@@ -305,7 +305,7 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
kudev->uioinfo.priv = kudev;
kudev->uioinfo.name = name;
kudev->uioinfo.version = "0.0";
- if (cte.irq_count > 0){
+ if (cte.irq_count > 0) {
kudev->uioinfo.irq_flags = IRQF_SHARED;
kudev->uioinfo.irq = pcard->pdev->irq;
kudev->uioinfo.handler = kuio_handler;
@@ -328,7 +328,7 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
dev_set_drvdata(kudev->dev, kudev);
rv = uio_register_device(kudev->dev, &kudev->uioinfo);
- if (rv){
+ if (rv) {
dev_err(&pcard->pdev->dev, "probe_core_uio failed uio_register_device: %d\n", rv);
put_device(kudev->dev);
kfree(kudev);
@@ -383,17 +383,17 @@ static int kp2000_setup_dma_controller(struct kp2000_device *pcard)
u64 capabilities_reg;
// S2C Engines
- for (i = 0 ; i < 32 ; i++){
+ for (i = 0 ; i < 32 ; i++) {
capabilities_reg = readq( pcard->dma_bar_base + KPC_DMA_S2C_BASE_OFFSET + (KPC_DMA_ENGINE_SIZE * i) );
- if (capabilities_reg & ENGINE_CAP_PRESENT_MASK){
+ if (capabilities_reg & ENGINE_CAP_PRESENT_MASK) {
err = create_dma_engine_core(pcard, (KPC_DMA_S2C_BASE_OFFSET + (KPC_DMA_ENGINE_SIZE * i)), i, pcard->pdev->irq);
if (err) goto err_out;
}
}
// C2S Engines
- for (i = 0 ; i < 32 ; i++){
+ for (i = 0 ; i < 32 ; i++) {
capabilities_reg = readq( pcard->dma_bar_base + KPC_DMA_C2S_BASE_OFFSET + (KPC_DMA_ENGINE_SIZE * i) );
- if (capabilities_reg & ENGINE_CAP_PRESENT_MASK){
+ if (capabilities_reg & ENGINE_CAP_PRESENT_MASK) {
err = create_dma_engine_core(pcard, (KPC_DMA_C2S_BASE_OFFSET + (KPC_DMA_ENGINE_SIZE * i)), 32+i, pcard->pdev->irq);
if (err) goto err_out;
}
@@ -423,23 +423,23 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
INIT_LIST_HEAD(&pcard->uio_devices_list);
// First, iterate the core table looking for the highest CORE_ID
- for (i = 0 ; i < pcard->core_table_length ; i++){
+ for (i = 0 ; i < pcard->core_table_length ; i++) {
read_val = readq(pcard->sysinfo_regs_base + ((pcard->core_table_offset + i) * 8));
parse_core_table_entry(&cte, read_val, pcard->core_table_rev);
dbg_cte(pcard, &cte);
- if (cte.type > highest_core_id){
+ if (cte.type > highest_core_id) {
highest_core_id = cte.type;
}
- if (cte.type == KP_CORE_ID_INVALID){
+ if (cte.type == KP_CORE_ID_INVALID) {
dev_info(&pcard->pdev->dev, "Found Invalid core: %016llx\n", read_val);
}
}
// Then, iterate over the possible core types.
- for (current_type_id = 1 ; current_type_id <= highest_core_id ; current_type_id++){
+ for (current_type_id = 1 ; current_type_id <= highest_core_id ; current_type_id++) {
unsigned int core_num = 0;
// Foreach core type, iterate the whole table and instantiate subdevices for each core.
// Yes, this is O(n*m) but the actual runtime is small enough that it's an acceptable tradeoff.
- for (i = 0 ; i < pcard->core_table_length ; i++){
+ for (i = 0 ; i < pcard->core_table_length ; i++) {
read_val = readq(pcard->sysinfo_regs_base + ((pcard->core_table_offset + i) * 8));
parse_core_table_entry(&cte, read_val, pcard->core_table_rev);
@@ -482,7 +482,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
cte.irq_count = 0;
cte.irq_base_num = 0;
err = probe_core_uio(0, pcard, "kpc_uio", cte);
- if (err){
+ if (err) {
dev_err(&pcard->pdev->dev, "kp2000_probe_cores: failed to add board_info core: %d\n", err);
goto error;
}
@@ -499,7 +499,7 @@ void kp2000_remove_cores(struct kp2000_device *pcard)
{
struct list_head *ptr;
struct list_head *next;
- list_for_each_safe(ptr, next, &pcard->uio_devices_list){
+ list_for_each_safe(ptr, next, &pcard->uio_devices_list) {
struct kpc_uio_device *kudev = list_entry(ptr, struct kpc_uio_device, list);
uio_unregister_device(&kudev->uioinfo);
device_unregister(kudev->dev);
--
2.20.1
next prev parent reply other threads:[~2019-05-22 20:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-22 20:58 [PATCH 0/6] Fix coding style issues in drivers/staging/kpc2000 Simon Sandström
2019-05-22 20:58 ` [PATCH 1/6] staging: kpc2000: fix indent in cell_probe.c Simon Sandström
2019-05-23 7:26 ` Greg KH
2019-05-23 7:27 ` Greg KH
2019-05-23 8:03 ` Simon Sandström
2019-05-22 20:58 ` Simon Sandström [this message]
2019-05-22 20:58 ` [PATCH 3/6] staging: kpc2000: fix invalid linebreaks " Simon Sandström
2019-05-22 20:58 ` [PATCH 4/6] staging: kpc2000: add spaces around operators " Simon Sandström
2019-05-22 20:58 ` [PATCH 5/6] staging: kpc2000: add space after comma " Simon Sandström
2019-05-22 20:58 ` [PATCH 6/6] staging: kpc2000: remove invalid spaces " Simon Sandström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190522205849.17444-3-simon@nikanor.nu \
--to=simon@nikanor.nu \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jeremy@azazel.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox