mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: aic7xxx: fix the following errors
       [not found] <20230720092958.3730-1-xujianghui@cdjrlc.com>
@ 2023-07-20  9:31 ` sunran001
  0 siblings, 0 replies; 2+ messages in thread
From: sunran001 @ 2023-07-20  9:31 UTC (permalink / raw)
  To: hare, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

ERROR: space required before the open parenthesis '('
ERROR: return is not a function, parentheses are not required
ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
---
  drivers/scsi/aic7xxx/aic7770.c | 23 +++++++++++------------
  1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7770.c 
b/drivers/scsi/aic7xxx/aic7770.c
index 176704b24e6a..21f3ef4ac230 100644
--- a/drivers/scsi/aic7xxx/aic7770.c
+++ b/drivers/scsi/aic7xxx/aic7770.c
@@ -59,8 +59,7 @@ static ahc_device_setup_t ahc_aic7770_VL_setup;
  static ahc_device_setup_t ahc_aic7770_EISA_setup;
  static ahc_device_setup_t ahc_aic7770_setup;

-struct aic7770_identity aic7770_ident_table[] =
-{
+struct aic7770_identity aic7770_ident_table[] = {
  	{
  		ID_AHA_274x,
  		0xFFFFFFFF,
@@ -237,11 +236,11 @@ aic7770_config(struct ahc_softc *ahc, struct 
aic7770_identity *entry, u_int io)
  	 */
  	error = ahc_init(ahc);
  	if (error != 0)
-		return (error);
+		return error;

  	error = aic7770_map_int(ahc, irq);
  	if (error != 0)
-		return (error);
+		return error;

  	ahc->init_level++;

@@ -249,7 +248,7 @@ aic7770_config(struct ahc_softc *ahc, struct 
aic7770_identity *entry, u_int io)
  	 * Enable the board's BUS drivers
  	 */
  	ahc_outb(ahc, BCTL, ENABLE);
-	return (0);
+	return 0;
  }

  static int
@@ -259,7 +258,7 @@ aic7770_chip_init(struct ahc_softc *ahc)
  	ahc_outb(ahc, BUSTIME, ahc->bus_softc.aic7770_softc.bustime);
  	ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~AUTOFLUSHDIS);
  	ahc_outb(ahc, BCTL, ENABLE);
-	return (ahc_chip_init(ahc));
+	return ahc_chip_init(ahc);
  }

  /*
@@ -294,7 +293,7 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
  	if (have_seeprom) {

  		if (ahc_verify_cksum(sc) == 0) {
-			if(bootverbose)
+			if (bootverbose)
  				printk ("checksum error\n");
  			have_seeprom = 0;
  		} else if (bootverbose) {
@@ -317,7 +316,7 @@ aha2840_load_seeprom(struct ahc_softc *ahc)

  		max_targ = (ahc->features & AHC_WIDE) != 0 ? 16 : 8;
  		discenable = 0;
-		for (i = 0; i < max_targ; i++){
+		for (i = 0; i < max_targ; i++) {
  			uint8_t target_settings;

  			target_settings = (sc->device_flags[i] & CFXFER) << 4;
@@ -348,7 +347,7 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
  		if (sc->adapter_control & CF284XSTERM)
  			ahc->flags |= AHC_TERM_ENB_A;
  	}
-	return (have_seeprom);
+	return have_seeprom;
  }

  static int
@@ -358,7 +357,7 @@ ahc_aic7770_VL_setup(struct ahc_softc *ahc)

  	error = ahc_aic7770_setup(ahc);
  	ahc->chip |= AHC_VL;
-	return (error);
+	return error;
  }

  static int
@@ -368,7 +367,7 @@ ahc_aic7770_EISA_setup(struct ahc_softc *ahc)

  	error = ahc_aic7770_setup(ahc);
  	ahc->chip |= AHC_EISA;
-	return (error);
+	return error;
  }

  static int
@@ -381,5 +380,5 @@ ahc_aic7770_setup(struct ahc_softc *ahc)
  	ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
  	ahc->flags |= AHC_PAGESCBS;
  	ahc->instruction_ram_size = 448;
-	return (0);
+	return 0;
  }

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

* [PATCH] scsi: aic7xxx: fix the following errors
       [not found] <20230720094503.3863-1-xujianghui@cdjrlc.com>
@ 2023-07-20  9:46 ` sunran001
  0 siblings, 0 replies; 2+ messages in thread
From: sunran001 @ 2023-07-20  9:46 UTC (permalink / raw)
  To: hare, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

ERROR: "foo * bar" should be "foo *bar"
ERROR: return is not a function, parentheses are not required
ERROR: open brace '{' following function definitions go on the next line

Signed-off-by: Ran Sun <sunran001@208suo.com>
---
  drivers/scsi/aic7xxx/aic7xxx_osm.h | 47 +++++++++++++++---------------
  1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h 
b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 51d9f4de0734..ad63b6cda3b7 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -140,19 +140,17 @@ typedef union {
  	volatile uint8_t __iomem *maddr;
  } bus_space_handle_t;

-typedef struct bus_dma_segment
-{
+typedef struct bus_dma_segment {
  	dma_addr_t	ds_addr;
  	bus_size_t	ds_len;
  } bus_dma_segment_t;

-struct ahc_linux_dma_tag
-{
+struct ahc_linux_dma_tag {
  	bus_size_t	alignment;
  	bus_size_t	boundary;
  	bus_size_t	maxsize;
  };
-typedef struct ahc_linux_dma_tag* bus_dma_tag_t;
+typedef struct ahc_linux_dma_tag *bus_dma_tag_t;

  typedef dma_addr_t bus_dmamap_t;

@@ -367,11 +365,11 @@ void ahc_delay(long);


  /***************************** Low Level I/O 
**********************************/
-uint8_t ahc_inb(struct ahc_softc * ahc, long port);
-void ahc_outb(struct ahc_softc * ahc, long port, uint8_t val);
-void ahc_outsb(struct ahc_softc * ahc, long port,
+uint8_t ahc_inb(struct ahc_softc *ahc, long port);
+void ahc_outb(struct ahc_softc *ahc, long port, uint8_t val);
+void ahc_outsb(struct ahc_softc *ahc, long port,
  	       uint8_t *, int count);
-void ahc_insb(struct ahc_softc * ahc, long port,
+void ahc_insb(struct ahc_softc *ahc, long port,
  	       uint8_t *, int count);

  /**************************** Initialization 
**********************************/
@@ -434,8 +432,7 @@ ahc_unlock(struct ahc_softc *ahc, unsigned long 
*flags)
  /* config registers for header type 0 devices */
  #define PCIR_MAPS	0x10

-typedef enum
-{
+typedef enum {
  	AHC_POWER_STATE_D0,
  	AHC_POWER_STATE_D1,
  	AHC_POWER_STATE_D2,
@@ -450,10 +447,12 @@ int			 aic7770_map_registers(struct ahc_softc 
*ahc,
  					       u_int port);
  int			 aic7770_map_int(struct ahc_softc *ahc, u_int irq);
  #else
-static inline int	ahc_linux_eisa_init(void) {
+static inline int	ahc_linux_eisa_init(void)
+{
  	return -ENODEV;
  }
-static inline void	ahc_linux_eisa_exit(void) {
+static inline void	ahc_linux_eisa_exit(void)
+{
  }
  #endif

@@ -475,21 +474,21 @@ static inline int 
ahc_get_pci_function(ahc_dev_softc_t);
  static inline int
  ahc_get_pci_function(ahc_dev_softc_t pci)
  {
-	return (PCI_FUNC(pci->devfn));
+	return PCI_FUNC(pci->devfn);
  }

  static inline int ahc_get_pci_slot(ahc_dev_softc_t);
  static inline int
  ahc_get_pci_slot(ahc_dev_softc_t pci)
  {
-	return (PCI_SLOT(pci->devfn));
+	return PCI_SLOT(pci->devfn);
  }

  static inline int ahc_get_pci_bus(ahc_dev_softc_t);
  static inline int
  ahc_get_pci_bus(ahc_dev_softc_t pci)
  {
-	return (pci->bus->number);
+	return pci->bus->number;
  }
  #else
  static inline int ahc_linux_pci_init(void) {
@@ -524,7 +523,7 @@ void ahc_cmd_set_transaction_status(struct scsi_cmnd 
*cmd, uint32_t status)
  static inline
  void ahc_set_transaction_status(struct scb *scb, uint32_t status)
  {
-	ahc_cmd_set_transaction_status(scb->io_ctx,status);
+	ahc_cmd_set_transaction_status(scb->io_ctx, status);
  }

  static inline
@@ -549,7 +548,7 @@ uint32_t ahc_cmd_get_transaction_status(struct 
scsi_cmnd *cmd)
  static inline
  uint32_t ahc_get_transaction_status(struct scb *scb)
  {
-	return (ahc_cmd_get_transaction_status(scb->io_ctx));
+	return ahc_cmd_get_transaction_status(scb->io_ctx);
  }

  static inline
@@ -561,7 +560,7 @@ uint32_t ahc_cmd_get_scsi_status(struct scsi_cmnd 
*cmd)
  static inline
  uint32_t ahc_get_scsi_status(struct scb *scb)
  {
-	return (ahc_cmd_get_scsi_status(scb->io_ctx));
+	return ahc_cmd_get_scsi_status(scb->io_ctx);
  }

  static inline
@@ -576,13 +575,13 @@ void ahc_set_transaction_tag(struct scb *scb, int 
enabled, u_int type)
  static inline
  u_long ahc_get_transfer_length(struct scb *scb)
  {
-	return (scb->platform_data->xfer_len);
+	return scb->platform_data->xfer_len;
  }

  static inline
  int ahc_get_transfer_dir(struct scb *scb)
  {
-	return (scb->io_ctx->sc_data_direction);
+	return scb->io_ctx->sc_data_direction;
  }

  static inline
@@ -606,7 +605,7 @@ u_long ahc_get_residual(struct scb *scb)
  static inline
  u_long ahc_get_sense_residual(struct scb *scb)
  {
-	return (scb->platform_data->sense_resid);
+	return scb->platform_data->sense_resid;
  }

  static inline
@@ -617,13 +616,13 @@ int ahc_perform_autosense(struct scb *scb)
  	 * On other platforms this is set on a
  	 * per-transaction basis.
  	 */
-	return (1);
+	return 1;
  }

  static inline uint32_t
  ahc_get_sense_bufsize(struct ahc_softc *ahc, struct scb *scb)
  {
-	return (sizeof(struct scsi_sense_data));
+	return sizeof(struct scsi_sense_data);
  }

  static inline void

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

end of thread, other threads:[~2023-07-20  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230720092958.3730-1-xujianghui@cdjrlc.com>
2023-07-20  9:31 ` [PATCH] scsi: aic7xxx: fix the following errors sunran001
     [not found] <20230720094503.3863-1-xujianghui@cdjrlc.com>
2023-07-20  9:46 ` sunran001

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome