* [PATCH] pata_pdc2027x: Remove unnecessary error check and coding style error.
@ 2017-11-25 4:15 Arvind Yadav
2017-11-25 4:37 ` Joe Perches
2017-11-25 10:00 ` Sergei Shtylyov
0 siblings, 2 replies; 4+ messages in thread
From: Arvind Yadav @ 2017-11-25 4:15 UTC (permalink / raw)
To: b.zolnierkie, tj; +Cc: linux-kernel, linux-ide
Here, The function pdc_hardware_init always return zero. So it is not
necessary to check its return value.
Fix these checkpatch.pl error:
ERROR: space prohibited after that '~' (ctx:WxW)
+ mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));
ERROR: spaces required around that '?' (ctx:VxW)
+ long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ;
ERROR: that open brace { should be on the previous line
+ const struct ata_port_info *ppi[] =
+ { &pdc2027x_port_info[board_idx], NULL };
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/ata/pata_pdc2027x.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index ffd8d33..9a953ef 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -277,7 +277,7 @@ static unsigned long pdc2027x_mode_filter(struct ata_device *adev, unsigned long
ATA_ID_PROD_LEN + 1);
/* If the master is a maxtor in UDMA6 then the slave should not use UDMA 6 */
if (strstr(model_num, "Maxtor") == NULL && pair->dma_mode == XFER_UDMA_6)
- mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));
+ mask &= ~(1 << (6 + ATA_SHIFT_UDMA));
return mask;
}
@@ -520,7 +520,7 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int b
void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR];
u16 pll_ctl;
long pll_clock_khz = pll_clock / 1000;
- long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ;
+ long pout_required = board_idx ? PDC_133_MHZ:PDC_100_MHZ;
long ratio = pout_required / pll_clock_khz;
int F, R;
@@ -707,8 +707,8 @@ static int pdc2027x_init_one(struct pci_dev *pdev,
static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 };
static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 };
unsigned int board_idx = (unsigned int) ent->driver_data;
- const struct ata_port_info *ppi[] =
- { &pdc2027x_port_info[board_idx], NULL };
+ const struct ata_port_info *ppi[] = {
+ &pdc2027x_port_info[board_idx], NULL };
struct ata_host *host;
void __iomem *mmio_base;
int i, rc;
@@ -753,8 +753,7 @@ static int pdc2027x_init_one(struct pci_dev *pdev,
//pci_enable_intx(pdev);
/* initialize adapter */
- if (pdc_hardware_init(host, board_idx) != 0)
- return -EIO;
+ pdc_hardware_init(host, board_idx);
pci_set_master(pdev);
return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
@@ -778,8 +777,7 @@ static int pdc2027x_reinit_one(struct pci_dev *pdev)
else
board_idx = PDC_UDMA_133;
- if (pdc_hardware_init(host, board_idx))
- return -EIO;
+ pdc_hardware_init(host, board_idx);
ata_host_resume(host);
return 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pata_pdc2027x: Remove unnecessary error check and coding style error.
2017-11-25 4:15 [PATCH] pata_pdc2027x: Remove unnecessary error check and coding style error Arvind Yadav
@ 2017-11-25 4:37 ` Joe Perches
2017-11-25 10:00 ` Sergei Shtylyov
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2017-11-25 4:37 UTC (permalink / raw)
To: Arvind Yadav, b.zolnierkie, tj; +Cc: linux-kernel, linux-ide
On Sat, 2017-11-25 at 09:45 +0530, Arvind Yadav wrote:
> Here, The function pdc_hardware_init always return zero. So it is not
> necessary to check its return value.
>
> Fix these checkpatch.pl error:
>
> ERROR: space prohibited after that '~' (ctx:WxW)
> + mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));
>
> ERROR: spaces required around that '?' (ctx:VxW)
> + long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ;
>
> ERROR: that open brace { should be on the previous line
> + const struct ata_port_info *ppi[] =
> + { &pdc2027x_port_info[board_idx], NULL };
[]
> diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
[]
> @@ -520,7 +520,7 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int b
> void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR];
> u16 pll_ctl;
> long pll_clock_khz = pll_clock / 1000;
> - long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ;
> + long pout_required = board_idx ? PDC_133_MHZ:PDC_100_MHZ;
If spaces are used around the ?, use spaces around the : too
> @@ -753,8 +753,7 @@ static int pdc2027x_init_one(struct pci_dev *pdev,
> //pci_enable_intx(pdev);
>
> /* initialize adapter */
> - if (pdc_hardware_init(host, board_idx) != 0)
> - return -EIO;
> + pdc_hardware_init(host, board_idx);
If this is so, then please make the function return void
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pata_pdc2027x: Remove unnecessary error check and coding style error.
2017-11-25 4:15 [PATCH] pata_pdc2027x: Remove unnecessary error check and coding style error Arvind Yadav
2017-11-25 4:37 ` Joe Perches
@ 2017-11-25 10:00 ` Sergei Shtylyov
2017-11-25 10:19 ` arvindY
1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2017-11-25 10:00 UTC (permalink / raw)
To: Arvind Yadav, b.zolnierkie, tj; +Cc: linux-kernel, linux-ide
On 11/25/2017 7:15 AM, Arvind Yadav wrote:
> Here, The function pdc_hardware_init always return zero. So it is not
> necessary to check its return value.
>
> Fix these checkpatch.pl error:
>
> ERROR: space prohibited after that '~' (ctx:WxW)
> + mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));
>
> ERROR: spaces required around that '?' (ctx:VxW)
> + long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ;
>
> ERROR: that open brace { should be on the previous line
> + const struct ata_port_info *ppi[] =
> + { &pdc2027x_port_info[board_idx], NULL };
>
Please fix the checkpatch.pl errors in a sperate patch.
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pata_pdc2027x: Remove unnecessary error check and coding style error.
2017-11-25 10:00 ` Sergei Shtylyov
@ 2017-11-25 10:19 ` arvindY
0 siblings, 0 replies; 4+ messages in thread
From: arvindY @ 2017-11-25 10:19 UTC (permalink / raw)
To: Sergei Shtylyov, b.zolnierkie, tj; +Cc: linux-kernel, linux-ide
Hi Sergei,
On Saturday 25 November 2017 03:30 PM, Sergei Shtylyov wrote:
> On 11/25/2017 7:15 AM, Arvind Yadav wrote:
>
>> Here, The function pdc_hardware_init always return zero. So it is not
>> necessary to check its return value.
>>
>> Fix these checkpatch.pl error:
>>
>> ERROR: space prohibited after that '~' (ctx:WxW)
>> + mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));
>>
>> ERROR: spaces required around that '?' (ctx:VxW)
>> + long pout_required = board_idx? PDC_133_MHZ:PDC_100_MHZ;
>>
>> ERROR: that open brace { should be on the previous line
>> + const struct ata_port_info *ppi[] =
>> + { &pdc2027x_port_info[board_idx], NULL };
>>
>
> Please fix the checkpatch.pl errors in a sperate patch.
Please find a patch v3, which does not include checkpatch.pl error fix.
>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> [...]
>
> MBR, Sergei
~arvind
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-25 10:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-25 4:15 [PATCH] pata_pdc2027x: Remove unnecessary error check and coding style error Arvind Yadav
2017-11-25 4:37 ` Joe Perches
2017-11-25 10:00 ` Sergei Shtylyov
2017-11-25 10:19 ` arvindY
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox