Skip to contentSkip to conversation

pci: hotplug: ibmphp: Fix 'line over 80 characters' Warning

PATCH In review Emanuel Bennici 3 participants 3 messages Jun 2, 2019 – Jun 5, 2019 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: hotplug: ibmphp: Fix 'line over 80 characters' Warning

Fix checkpatch.pl 'line over 80 characters' Warning in ibmphp_ebda.c and ibmphp_hpc.c

---
 drivers/pci/hotplug/ibmphp_ebda.c |   7 +-
 drivers/pci/hotplug/ibmphp_hpc.c  | 107 +++++++++++++++++++-----------
 2 files changed, 75 insertions(+), 39 deletions(-)
drivers/pci/hotplug/ibmphp_ebda.c +5 -2
index 7bea904a5203..fda0d1210a3b 100644
@@ -1116,10 +1116,13 @@ static int ibmphp_probe(struct pci_dev *dev, const struct pci_device_id *ids)
 
 	list_for_each_entry(ctrl, &ebda_hpc_head, ebda_hpc_list) {
 		if (ctrl->ctlr_type == 1) {
-			if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
+			if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) &&
+			    (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
 				ctrl->ctrl_dev = dev;
 				debug("found device!!!\n");
-				debug("dev->device = %x, dev->subsystem_device = %x\n", dev->device, dev->subsystem_device);
+				debug("dev->device = %x, "
+				      "dev->subsystem_device = %x\n",
+				      dev->device, dev->subsystem_device);
 				return 0;
 			}
 		}
drivers/pci/hotplug/ibmphp_hpc.c +70 -37

265 lines not on this page · raw message

--
2.19.1

#1 lore raw
Quoted 3 lines · Emanuel Bennici

Fix checkpatch.pl 'line over 80 characters' Warning in ibmphp_ebda.c and ibmphp_hpc.c

I'm not sure it's needed.
And actually some of the changes are the regressions in order of readability ratio.

drivers/pci/hotplug/ibmphp_ebda.c static int ibmphp_probe(struct pci_dev *dev, const struct pci_device_id *ids) · line 1124

Quoted 2 lines
drivers/pci/hotplug/ibmphp_ebda.c +2 -0
+                               debug("dev->device = %x, "
+                                     "dev->subsystem_device = %x\n",

Don't split string literals like this.

drivers/pci/hotplug/ibmphp_hpc.c int ibmphp_hpc_readslot(struct slot *pslot, u8 cmd, u8 *pstatus) · line 525

Quoted 4 lines
drivers/pci/hotplug/ibmphp_hpc.c +2 -2
-       if ((pslot == NULL)
-           || ((pstatus == NULL) && (cmd != READ_ALLSTAT) && (cmd != READ_BUSSTATUS))) {
+       if ((pslot == NULL) || ((pstatus == NULL) && (cmd != READ_ALLSTAT) &&
+                               (cmd != READ_BUSSTATUS))) {

No, no, this breaks readability a lot.
In the former it's clearly shown the logic between conditionals, while in the latter it's a mess.

drivers/pci/hotplug/ibmphp_hpc.c int ibmphp_hpc_readslot(struct slot *pslot, u8 cmd, u8 *pstatus) · line 629

Quoted 2 lines
drivers/pci/hotplug/ibmphp_hpc.c +2 -0
+                                       err("%s - Error ctrl_read failed\n",
+                                               __func__);

Really, no advantage on this line even for 80 characters.

Review

Quoted 2 lines
(quoted diff) +2 -0
+                       err("%s - Exit Error:invalid bus, rc[%d]\n",
+                               __func__, rc);

Same here.

drivers/pci/hotplug/ibmphp_hpc.c int ibmphp_hpc_writeslot(struct slot *pslot, u8 cmd) · line 712

Quoted 7 lines
drivers/pci/hotplug/ibmphp_hpc.c +4 -3
-               debug("%s - ctlr id[%x] physical[%lx] logical[%lx] i2c[%x]\n", __func__,
-               ctlr_ptr->ctlr_id, (ulong) (ctlr_ptr->u.wpeg_ctlr.wpegbbar), (ulong) wpg_bbar,
-               ctlr_ptr->u.wpeg_ctlr.i2c_addr);
+               debug("%s - ctlr id[%x] physical[%lx] logical[%lx] i2c[%x]\n",
+                       __func__, ctlr_ptr->ctlr_id,
+                       (ulong) (ctlr_ptr->u.wpeg_ctlr.wpegbbar),
+                       (ulong) wpg_bbar, ctlr_ptr->u.wpeg_ctlr.i2c_addr);

Here better to fix explicit casts (perhaps it means wrong specifiers being used).

drivers/pci/hotplug/ibmphp_hpc.c static int process_changeinstatus(struct slot *pslot, struct slot *poldslot) · line 955

Quoted 3 lines
drivers/pci/hotplug/ibmphp_hpc.c +3 -0
+               if ((poldslot->status & 0x20) &&
+                   (SLOT_CONNECT(poldslot->status) == HPC_SLOT_CONNECTED)
+                   && (SLOT_PRESENT(poldslot->status)))

Here you are not consistent in a way where to put logical operation.

drivers/pci/hotplug/ibmphp_hpc.c static int process_changeinlatch(u8 old, u8 new, struct controller *ctrl) · line 1031

Quoted 2 lines
drivers/pci/hotplug/ibmphp_hpc.c +2 -0
+                               memcpy((void *) &myslot, (void *) pslot,
+                                      sizeof(struct slot));

Why spaces after ) here?

drivers/pci/hotplug/ibmphp_hpc.c static int process_changeinlatch(u8 old, u8 new, struct controller *ctrl) · line 1035

Quoted 2 lines
drivers/pci/hotplug/ibmphp_hpc.c +2 -0
+                               debug("%s - call process_changeinstatus for"
+                                     "slot[%d]\n", __func__, i);

Do not split string literals like this.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 2 lines · Andy Shevchenko

On Sun, Jun 2, 2019 at 7:25 PM Emanuel Bennici
<[email protected]> wrote:

[]

Quoted 4 lines

drivers/pci/hotplug/ibmphp_hpc.c static int process_changeinlatch(u8 old, u8 new, struct controller *ctrl) · line 1035

Quoted 2 lines
drivers/pci/hotplug/ibmphp_hpc.c +2 -0
+                               debug("%s - call process_changeinstatus for"
+                                     "slot[%d]\n", __func__, i);

Do not split string literals like this.

Especially because it's common to miss the
space required between words when the
compiler coalesces the string fragments.

Like here.