fix qla2xxx regression on sparc64
Subsystems (4)
PATCH 1/1 fix qla2xxx regression on sparc64
Commit 98aee70d19a7e3203649fa2078464e4f402a0ad8 in 2014 broke qla2xxx on sparc64, e.g. as in the Sun Blade 1000 / 2000. Unbreak by partial revert to fix endianess in nvram firmware default initialization.
drivers/scsi/qla2xxx/qla_init.c +3 -3
@@ -4603,18 +4603,18 @@ qla2x00_nvram_config(scsi_qla_host_t *vha) nv->firmware_options[1 ] =BIT_7 |BIT_5 ; nv->add_firmware_options[0 ] =BIT_5 ; nv->add_firmware_options[1 ] =BIT_5 |BIT_4 ; - nv->frame_payload_size =2048 ; + nv->frame_payload_size =__constant_cpu_to_le16 (2048 ); nv->special_options[1 ] =BIT_7 ; }else if (IS_QLA2200 (ha)) { nv->firmware_options[0 ] =BIT_2 |BIT_1 ; nv->firmware_options[1 ] =BIT_7 |BIT_5 ; nv->add_firmware_options[0 ] =BIT_5 ; nv->add_firmware_options[1 ] =BIT_5 |BIT_4 ; - nv->frame_payload_size =1024 ; + nv->frame_payload_size =__constant_cpu_to_le16 (1024 ); }else if (IS_QLA2100 (ha)) { nv->firmware_options[0 ] =BIT_3 |BIT_1 ; nv->firmware_options[1 ] =BIT_5 ; - nv->frame_payload_size =1024 ; + nv->frame_payload_size =__constant_cpu_to_le16 (1024 ); } nv->max_iocb_allocation =cpu_to_le16 (256 );
Signature · 2 lines
René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin https://exactcode.com | https://t2sde.org | https://rene.rebe.de
Quoted 23 lines · Rene Rebe
Commit
98aee70d19a7e3203649fa2078464e4f402a0ad8in 2014 broke qla2xxx on sparc64, e.g. as in the Sun Blade 1000 / 2000. Unbreak by partial revert to fix endianess in nvram firmware default initialization.Fixes 98aee70d19a7e ("qla2xxx: Add endianizer to max_payload_size modifier.")Signed-off-by René Rebe <[email protected]>drivers/scsi/qla2xxx/qla_init.c +1
-1@@ -4603,18 +4603,18 @@ qla2x00_nvram_config(scsi_qla_host_t *vha) nv->firmware_options[1 ] =BIT_7 |BIT_5 ; nv->add_firmware_options[0 ] =BIT_5 ; nv->add_firmware_options[1 ] =BIT_5 |BIT_4 ; - nv->frame_payload_size =2048 ; + nv->frame_payload_size =__constant_cpu_to_le16 (2048 ); nv->special_options[1 ] =BIT_7 ; }else if (IS_QLA2200 (ha)) { nv->firmware_options[0 ] =BIT_2 |BIT_1 ; nv->firmware_options[1 ] =BIT_7 |BIT_5 ; nv->add_firmware_options[0 ] =BIT_5 ; nv->add_firmware_options[1 ] =BIT_5 |BIT_4 ;
drivers/scsi/qla2xxx/qla_init.c qla2x00_nvram_config(scsi_qla_host_t *vha) · line 4620
Quoted 10 lines
drivers/scsi/qla2xxx/qla_init.c +2
-2- nv->frame_payload_size =1024 ; + nv->frame_payload_size =__constant_cpu_to_le16 (1024 ); }else if (IS_QLA2100 (ha)) { nv->firmware_options[0 ] =BIT_3 |BIT_1 ; nv->firmware_options[1 ] =BIT_5 ; - nv->frame_payload_size =1024 ; + nv->frame_payload_size =__constant_cpu_to_le16 (1024 ); } nv->max_iocb_allocation =cpu_to_le16 (256 );
Drivers should use cpu_to_le16() instead of __constant_cpu_to_le16().
Additionally, this patch introduces the following new sparse warnings:
$ make C=2 M=drivers/scsi/qla2xxx CC [M] drivers/scsi/qla2xxx/qla_os.o CHECK drivers/scsi/qla2xxx/qla_os.c CC [M] drivers/scsi/qla2xxx/qla_init.o CHECK drivers/scsi/qla2xxx/qla_init.c drivers/scsi/qla2xxx/qla_init.c:4606:48: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_init.c:4606:48: expected unsigned short [usertype] frame_payload_size drivers/scsi/qla2xxx/qla_init.c:4606:48: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_init.c:4613:48: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_init.c:4613:48: expected unsigned short [usertype] frame_payload_size drivers/scsi/qla2xxx/qla_init.c:4613:48: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_init.c:4617:48: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_init.c:4617:48: expected unsigned short [usertype] frame_payload_size drivers/scsi/qla2xxx/qla_init.c:4617:48: got restricted __le16 [usertype]
Please fix these.
Bart.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 use cpu_to_le{16,32} instead of __constant_cpu_to_
Quoted 6 lines · Bart Van Assche
Hi René,
Whether
__constant_cpu_to_le16()is used orcpu_to_le16(), the compiler generates exactly the same code. The name of thecpu_to_le16()function however is shorter. I recommendcpu_to_le16()because of its shorter name and because that's what other kernel drivers use.
So following your recommendation here is a RFC removing all the other few remaining __constant_cpu_to_le{16,32} instances.
drivers/scsi/qla2xxx/qla_target.c +1 -1
@@ -3583,7 +3583,7 @@ static int __qlt_send_term_imm_notif(struct scsi_qla_host *vha,/* terminate */ nack->u.isp24.flags |= -__constant_cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE ); +cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE ); nack->u.isp24.srr_rx_id = ntfy->u.isp24.srr_rx_id; nack->u.isp24.status = ntfy->u.isp24.status;
drivers/scsi/qla2xxx/qla_tmpl.c +1 -1
@@ -912,7 +912,7 @@ qla27xx_driver_info(struct qla27xx_fwdt_template *tmp) tmp->driver_info[0 ] =cpu_to_le32 ( v[3 ] <<24 | v[2 ] <<16 | v[1 ] <<8 | v[0 ]); tmp->driver_info[1 ] =cpu_to_le32 (v[5 ] <<8 | v[4 ]); - tmp->driver_info[2 ] =__constant_cpu_to_le32 (0x12345678 ); + tmp->driver_info[2 ] =cpu_to_le32 (0x12345678 ); } static void
drivers/scsi/qla4xxx/ql4_init.c +2 -2
@@ -120,8 +120,8 @@ int qla4xxx_init_rings(struct scsi_qla_host *ha)* the interrupt_handler to think there are responses to be * processed when there aren't. */ - ha->shadow_regs->req_q_out =__constant_cpu_to_le32 (0 ); - ha->shadow_regs->rsp_q_in =__constant_cpu_to_le32 (0 ); + ha->shadow_regs->req_q_out =cpu_to_le32 (0 ); + ha->shadow_regs->rsp_q_in =cpu_to_le32 (0 );wmb ();writel (0 , &ha->reg->req_q_in);
drivers/scsi/qla4xxx/ql4_iocb.c +1 -1
@@ -161,7 +161,7 @@ static void qla4xxx_build_scsi_iocbs(struct srb *srb,if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) {/* No data being transferred */ - cmd_entry->ttlByteCnt =__constant_cpu_to_le32 (0 ); + cmd_entry->ttlByteCnt =cpu_to_le32 (0 );return ; }
drivers/scsi/qla4xxx/ql4_mbx.c +14 -14
@@ -646,8 +646,8 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)/* Fill in the request and response queue information. */ init_fw_cb->rqq_consumer_idx =cpu_to_le16 (ha->request_out); init_fw_cb->compq_producer_idx =cpu_to_le16 (ha->response_in); - init_fw_cb->rqq_len =__constant_cpu_to_le16 (REQUEST_QUEUE_DEPTH ); - init_fw_cb->compq_len =__constant_cpu_to_le16 (RESPONSE_QUEUE_DEPTH ); + init_fw_cb->rqq_len =cpu_to_le16 (REQUEST_QUEUE_DEPTH ); + init_fw_cb->compq_len =cpu_to_le16 (RESPONSE_QUEUE_DEPTH ); init_fw_cb->rqq_addr_lo =cpu_to_le32 (LSDW (ha->request_dma)); init_fw_cb->rqq_addr_hi =cpu_to_le32 (MSDW (ha->request_dma)); init_fw_cb->compq_addr_lo =cpu_to_le32 (LSDW (ha->response_dma));
@@ -657,20 +657,20 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)/* Set up required options. */ init_fw_cb->fw_options |= -__constant_cpu_to_le16 (FWOPT_SESSION_MODE | +cpu_to_le16 (FWOPT_SESSION_MODE |FWOPT_INITIATOR_MODE );if (is_qla80XX (ha)) init_fw_cb->fw_options |= -__constant_cpu_to_le16 (FWOPT_ENABLE_CRBDB ); +cpu_to_le16 (FWOPT_ENABLE_CRBDB ); - init_fw_cb->fw_options &=__constant_cpu_to_le16 (~FWOPT_TARGET_MODE ); + init_fw_cb->fw_options &=cpu_to_le16 (~FWOPT_TARGET_MODE ); init_fw_cb->add_fw_options =0 ; init_fw_cb->add_fw_options |= -__constant_cpu_to_le16 (ADFWOPT_SERIALIZE_TASK_MGMT ); +cpu_to_le16 (ADFWOPT_SERIALIZE_TASK_MGMT ); init_fw_cb->add_fw_options |= -__constant_cpu_to_le16 (ADFWOPT_AUTOCONN_DISABLE ); +cpu_to_le16 (ADFWOPT_AUTOCONN_DISABLE );if (qla4xxx_set_ifcb (ha, &mbox_cmd[0 ], &mbox_sts[0 ], init_fw_cb_dma) !=QLA_SUCCESS ) {
@@ -1614,7 +1614,7 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password,strlcpy (password, chap_table->secret,QL4_CHAP_MAX_SECRET_LEN );strlcpy (username, chap_table->name,QL4_CHAP_MAX_NAME_LEN ); - chap_table->cookie =__constant_cpu_to_le16 (CHAP_VALID_COOKIE ); + chap_table->cookie =cpu_to_le16 (CHAP_VALID_COOKIE ); exit_get_chap:dma_pool_free (ha->chap_dma_pool, chap_table, chap_dma);
@@ -1656,7 +1656,7 @@ int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password, chap_table->secret_len =strlen (password);strncpy (chap_table->secret, password,MAX_CHAP_SECRET_LEN -1 );strncpy (chap_table->name, username,MAX_CHAP_NAME_LEN -1 ); - chap_table->cookie =__constant_cpu_to_le16 (CHAP_VALID_COOKIE ); + chap_table->cookie =cpu_to_le16 (CHAP_VALID_COOKIE );if (is_qla40XX (ha)) { chap_size =MAX_CHAP_ENTRIES_40XX *sizeof (*chap_table);
@@ -1722,7 +1722,7 @@ int qla4xxx_get_uni_chap_at_index(struct scsi_qla_host *ha, char *username,mutex_lock (&ha->chap_sem); chap_table = (struct ql4_chap_table *)ha->chap_list + chap_index; -if (chap_table->cookie !=__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +if (chap_table->cookie !=cpu_to_le16 (CHAP_VALID_COOKIE )) { rval =QLA_ERROR ; goto exit_unlock_uni_chap; }
@@ -1785,7 +1785,7 @@ int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username,for (i =0 ; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) {if (i >MAX_RESRV_CHAP_IDX && free_index ==-1 ) free_index = i;continue ;
@@ -2106,18 +2106,18 @@ int qla4xxx_set_param_ddbentry(struct scsi_qla_host *ha,if (conn->max_recv_dlength) fw_ddb_entry->iscsi_max_rcv_data_seg_len = -__constant_cpu_to_le16 ((conn->max_recv_dlength /BYTE_UNITS )); +cpu_to_le16 ((conn->max_recv_dlength /BYTE_UNITS ));if (sess->max_r2t) fw_ddb_entry->iscsi_max_outsnd_r2t =cpu_to_le16 (sess->max_r2t);if (sess->first_burst) fw_ddb_entry->iscsi_first_burst_len = -__constant_cpu_to_le16 ((sess->first_burst /BYTE_UNITS )); +cpu_to_le16 ((sess->first_burst /BYTE_UNITS ));if (sess->max_burst) fw_ddb_entry->iscsi_max_burst_len = -__constant_cpu_to_le16 ((sess->max_burst /BYTE_UNITS )); +cpu_to_le16 ((sess->max_burst /BYTE_UNITS ));if (sess->time2wait) fw_ddb_entry->iscsi_def_time2wait =
drivers/scsi/qla4xxx/ql4_nx.c +5 -5
@@ -3678,7 +3678,7 @@ qla4_82xx_read_flash_data(struct scsi_qla_host *ha, uint32_t *dwptr, "Do ROM fast read failed\n"); goto done_read; } - dwptr[i] =__constant_cpu_to_le32 (val); + dwptr[i] =cpu_to_le32 (val); } done_read:
@@ -3741,9 +3741,9 @@ qla4_8xxx_get_flt_info(struct scsi_qla_host *ha, uint32_t flt_addr) goto no_flash_data; } -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; -if (flt->version !=__constant_cpu_to_le16 (1 )) { +if (flt->version !=cpu_to_le16 (1 )) { DEBUG2(ql4_printk(KERN_INFO, ha, "Unsupported FLT detected: " "version=0x%x length=0x%x checksum=0x%x.\n", le16_to_cpu(flt->version), le16_to_cpu(flt->length),
@@ -3846,7 +3846,7 @@ qla4_82xx_get_fdt_info(struct scsi_qla_host *ha)qla4_82xx_read_optrom_data (ha, (uint8_t *)ha->request_ring, hw->flt_region_fdt <<2 ,OPTROM_BURST_SIZE ); -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; if (fdt->sig[0] != 'Q' || fdt->sig[1] != 'L' || fdt->sig[2] != 'I' ||
@@ -3903,7 +3903,7 @@ qla4_82xx_get_idc_param(struct scsi_qla_host *ha)qla4_82xx_read_optrom_data (ha, (uint8_t *)ha->request_ring,QLA82XX_IDC_PARAM_ADDR ,8 ); -if (*wptr ==__constant_cpu_to_le32 (0xffffffff )) { +if (*wptr ==cpu_to_le32 (0xffffffff )) { ha->nx_dev_init_timeout =ROM_DEV_INIT_TIMEOUT ; ha->nx_reset_timeout =ROM_DRV_RESET_ACK_TIMEOUT ; }else {
drivers/scsi/qla4xxx/ql4_os.c +5 -5
@@ -704,7 +704,7 @@ static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha, *chap_entry = (struct ql4_chap_table *)ha->chap_list + chap_index;if ((*chap_entry)->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) { rval =QLA_ERROR ; *chap_entry =NULL ; }else {
@@ -748,7 +748,7 @@ static int qla4xxx_find_free_chap_index(struct scsi_qla_host *ha, chap_table = (struct ql4_chap_table *)ha->chap_list + i;if ((chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) && +cpu_to_le16 (CHAP_VALID_COOKIE )) && (i >MAX_RESRV_CHAP_IDX )) { free_index = i;break ;
@@ -797,7 +797,7 @@ static int qla4xxx_get_chap_list(struct Scsi_Host *shost, uint16_t chap_tbl_idx,for (i = chap_tbl_idx; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) +cpu_to_le16 (CHAP_VALID_COOKIE ))continue ; chap_rec->chap_tbl_idx = i;
@@ -928,7 +928,7 @@ static int qla4xxx_delete_chap(struct Scsi_Host *shost, uint16_t chap_tbl_idx) goto exit_delete_chap; } - chap_table->cookie =__constant_cpu_to_le16 (0xFFFF ); + chap_table->cookie =cpu_to_le16 (0xFFFF ); offset =FLASH_CHAP_OFFSET | (chap_tbl_idx *sizeof (struct ql4_chap_table ));
@@ -6050,7 +6050,7 @@ static int qla4xxx_get_bidi_chap(struct scsi_qla_host *ha, char *username,for (i =0 ; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) {continue ; }
fs/cifs/smb2status.h +1 -1
@@ -29,7 +29,7 @@* C is set if "customer defined" error, N bit is reserved and MBZ */ -#define STATUS_SEVERITY_SUCCESS __constant_cpu_to_le32(0x0000) +#define STATUS_SEVERITY_SUCCESS cpu_to_le32(0x0000)#define STATUS_SEVERITY_INFORMATIONAL cpu_to_le32(0x0001)#define STATUS_SEVERITY_WARNING cpu_to_le32(0x0002)#define STATUS_SEVERITY_ERROR cpu_to_le32(0x0003)
fs/jffs2/nodelist.h +2 -2
@@ -59,8 +59,8 @@#define cpu_to_je32 (x) ((jint32_t){cpu_to_le32(x)})#define cpu_to_jemode (x) ((jmode_t){cpu_to_le32(os_to_jffs2_mode(x))}) -#define constant_cpu_to_je16 (x) ((jint16_t){__constant_cpu_to_le16(x)}) -#define constant_cpu_to_je32 (x) ((jint32_t){__constant_cpu_to_le32(x)}) +#define constant_cpu_to_je16 (x) ((jint16_t){cpu_to_le16(x)}) +#define constant_cpu_to_je32 (x) ((jint32_t){cpu_to_le32(x)})#define je16_to_cpu (x) (le16_to_cpu(x.v16))#define je32_to_cpu (x) (le32_to_cpu(x.v32))
Signature · 2 lines
René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin https://exactcode.com | https://t2sde.org | https://rene.rebe.de
Re: [PATCH] use cpu_to_le{16,32} instead of __constant_cpu_to_
Bart,
Quoted 4 lines · Rene Rebe
So following your recommendation here is a RFC removing all the other few remaining __constant_cpu_to_le{16,32} instances.
RFC looks fine. Please add RB to official patch when you send it out.
--
Himanshu Madhani Oracle Linux Engineering
Re: [PATCH] use cpu_to_le{16,32} instead of __constant_cpu_to_
In reply to Rene Rebedrivers/scsi/qla2xxx/qla_target.c
Quoted 5 lines · Rene Rebe
drivers/scsi/qla2xxx/qla_target.c +0
-0
The qla2xxx and qla4xxx changes all look good.
fs/cifs/smb2status.h line 35
Quoted 13 lines
fs/cifs/smb2status.h +1
-1@@ -29,7 +29,7 @@* C is set if "customer defined" error, N bit is reserved and MBZ */ -#define STATUS_SEVERITY_SUCCESS __constant_cpu_to_le32(0x0000) +#define STATUS_SEVERITY_SUCCESS cpu_to_le32(0x0000)#define STATUS_SEVERITY_INFORMATIONAL cpu_to_le32(0x0001)#define STATUS_SEVERITY_WARNING cpu_to_le32(0x0002)#define STATUS_SEVERITY_ERROR cpu_to_le32(0x0003)
This was apparently left over in f5307104e757 ("cifs: don't use __constant_cpu_to_le32()").
fs/jffs2/nodelist.h line 63
Quoted 12 lines
fs/jffs2/nodelist.h +2
-2@@ -59,8 +59,8 @@#define cpu_to_je32 (x) ((jint32_t){cpu_to_le32(x)})#define cpu_to_jemode (x) ((jmode_t){cpu_to_le32(os_to_jffs2_mode(x))}) -#define constant_cpu_to_je16 (x) ((jint16_t){__constant_cpu_to_le16(x)}) -#define constant_cpu_to_je32 (x) ((jint32_t){__constant_cpu_to_le32(x)}) +#define constant_cpu_to_je16 (x) ((jint16_t){cpu_to_le16(x)}) +#define constant_cpu_to_je32 (x) ((jint32_t){cpu_to_le32(x)})
This one would break the build, as these have to be constant expressions, whereas cpu_to_le32() is a compiler builtin or an inline function on some architectures.
Arnd
PATCH v2 1/1 use cpu_to_le{16,32} instead of __constant_cpu_to_*
In reply to a message not in the archiveQuoted 6 lines · Bart Van Assche
Hi René,
Whether
__constant_cpu_to_le16()is used orcpu_to_le16(), the compiler generates exactly the same code. The name of thecpu_to_le16()function however is shorter. I recommendcpu_to_le16()because of its shorter name and because that's what other kernel drivers use.
As per recommendation, convert a few remaining __constant_cpu_to_le{16,32} instances in the qla2xxx, qla4xxx and cifs to just cpu_to_le{16,32}.
The later was apparently left over in f5307104e757 ("cifs: don't use __constant_cpu_to_le32()").
drivers/scsi/qla2xxx/qla_target.c +1 -1
@@ -3583,7 +3583,7 @@ static int __qlt_send_term_imm_notif(struct scsi_qla_host *vha,/* terminate */ nack->u.isp24.flags |= -__constant_cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE ); +cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE ); nack->u.isp24.srr_rx_id = ntfy->u.isp24.srr_rx_id; nack->u.isp24.status = ntfy->u.isp24.status;
drivers/scsi/qla2xxx/qla_tmpl.c +1 -1
@@ -912,7 +912,7 @@ qla27xx_driver_info(struct qla27xx_fwdt_template *tmp) tmp->driver_info[0 ] =cpu_to_le32 ( v[3 ] <<24 | v[2 ] <<16 | v[1 ] <<8 | v[0 ]); tmp->driver_info[1 ] =cpu_to_le32 (v[5 ] <<8 | v[4 ]); - tmp->driver_info[2 ] =__constant_cpu_to_le32 (0x12345678 ); + tmp->driver_info[2 ] =cpu_to_le32 (0x12345678 ); } static void
drivers/scsi/qla4xxx/ql4_init.c +2 -2
@@ -120,8 +120,8 @@ int qla4xxx_init_rings(struct scsi_qla_host *ha)* the interrupt_handler to think there are responses to be * processed when there aren't. */ - ha->shadow_regs->req_q_out =__constant_cpu_to_le32 (0 ); - ha->shadow_regs->rsp_q_in =__constant_cpu_to_le32 (0 ); + ha->shadow_regs->req_q_out =cpu_to_le32 (0 ); + ha->shadow_regs->rsp_q_in =cpu_to_le32 (0 );wmb ();writel (0 , &ha->reg->req_q_in);
drivers/scsi/qla4xxx/ql4_iocb.c +1 -1
@@ -161,7 +161,7 @@ static void qla4xxx_build_scsi_iocbs(struct srb *srb,if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) {/* No data being transferred */ - cmd_entry->ttlByteCnt =__constant_cpu_to_le32 (0 ); + cmd_entry->ttlByteCnt =cpu_to_le32 (0 );return ; }
drivers/scsi/qla4xxx/ql4_mbx.c +14 -14
@@ -646,8 +646,8 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)/* Fill in the request and response queue information. */ init_fw_cb->rqq_consumer_idx =cpu_to_le16 (ha->request_out); init_fw_cb->compq_producer_idx =cpu_to_le16 (ha->response_in); - init_fw_cb->rqq_len =__constant_cpu_to_le16 (REQUEST_QUEUE_DEPTH ); - init_fw_cb->compq_len =__constant_cpu_to_le16 (RESPONSE_QUEUE_DEPTH ); + init_fw_cb->rqq_len =cpu_to_le16 (REQUEST_QUEUE_DEPTH ); + init_fw_cb->compq_len =cpu_to_le16 (RESPONSE_QUEUE_DEPTH ); init_fw_cb->rqq_addr_lo =cpu_to_le32 (LSDW (ha->request_dma)); init_fw_cb->rqq_addr_hi =cpu_to_le32 (MSDW (ha->request_dma)); init_fw_cb->compq_addr_lo =cpu_to_le32 (LSDW (ha->response_dma));
@@ -657,20 +657,20 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)/* Set up required options. */ init_fw_cb->fw_options |= -__constant_cpu_to_le16 (FWOPT_SESSION_MODE | +cpu_to_le16 (FWOPT_SESSION_MODE |FWOPT_INITIATOR_MODE );if (is_qla80XX (ha)) init_fw_cb->fw_options |= -__constant_cpu_to_le16 (FWOPT_ENABLE_CRBDB ); +cpu_to_le16 (FWOPT_ENABLE_CRBDB ); - init_fw_cb->fw_options &=__constant_cpu_to_le16 (~FWOPT_TARGET_MODE ); + init_fw_cb->fw_options &=cpu_to_le16 (~FWOPT_TARGET_MODE ); init_fw_cb->add_fw_options =0 ; init_fw_cb->add_fw_options |= -__constant_cpu_to_le16 (ADFWOPT_SERIALIZE_TASK_MGMT ); +cpu_to_le16 (ADFWOPT_SERIALIZE_TASK_MGMT ); init_fw_cb->add_fw_options |= -__constant_cpu_to_le16 (ADFWOPT_AUTOCONN_DISABLE ); +cpu_to_le16 (ADFWOPT_AUTOCONN_DISABLE );if (qla4xxx_set_ifcb (ha, &mbox_cmd[0 ], &mbox_sts[0 ], init_fw_cb_dma) !=QLA_SUCCESS ) {
@@ -1614,7 +1614,7 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password,strlcpy (password, chap_table->secret,QL4_CHAP_MAX_SECRET_LEN );strlcpy (username, chap_table->name,QL4_CHAP_MAX_NAME_LEN ); - chap_table->cookie =__constant_cpu_to_le16 (CHAP_VALID_COOKIE ); + chap_table->cookie =cpu_to_le16 (CHAP_VALID_COOKIE ); exit_get_chap:dma_pool_free (ha->chap_dma_pool, chap_table, chap_dma);
@@ -1656,7 +1656,7 @@ int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password, chap_table->secret_len =strlen (password);strncpy (chap_table->secret, password,MAX_CHAP_SECRET_LEN -1 );strncpy (chap_table->name, username,MAX_CHAP_NAME_LEN -1 ); - chap_table->cookie =__constant_cpu_to_le16 (CHAP_VALID_COOKIE ); + chap_table->cookie =cpu_to_le16 (CHAP_VALID_COOKIE );if (is_qla40XX (ha)) { chap_size =MAX_CHAP_ENTRIES_40XX *sizeof (*chap_table);
@@ -1722,7 +1722,7 @@ int qla4xxx_get_uni_chap_at_index(struct scsi_qla_host *ha, char *username,mutex_lock (&ha->chap_sem); chap_table = (struct ql4_chap_table *)ha->chap_list + chap_index; -if (chap_table->cookie !=__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +if (chap_table->cookie !=cpu_to_le16 (CHAP_VALID_COOKIE )) { rval =QLA_ERROR ; goto exit_unlock_uni_chap; }
@@ -1785,7 +1785,7 @@ int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username,for (i =0 ; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) {if (i >MAX_RESRV_CHAP_IDX && free_index ==-1 ) free_index = i;continue ;
@@ -2106,18 +2106,18 @@ int qla4xxx_set_param_ddbentry(struct scsi_qla_host *ha,if (conn->max_recv_dlength) fw_ddb_entry->iscsi_max_rcv_data_seg_len = -__constant_cpu_to_le16 ((conn->max_recv_dlength /BYTE_UNITS )); +cpu_to_le16 ((conn->max_recv_dlength /BYTE_UNITS ));if (sess->max_r2t) fw_ddb_entry->iscsi_max_outsnd_r2t =cpu_to_le16 (sess->max_r2t);if (sess->first_burst) fw_ddb_entry->iscsi_first_burst_len = -__constant_cpu_to_le16 ((sess->first_burst /BYTE_UNITS )); +cpu_to_le16 ((sess->first_burst /BYTE_UNITS ));if (sess->max_burst) fw_ddb_entry->iscsi_max_burst_len = -__constant_cpu_to_le16 ((sess->max_burst /BYTE_UNITS )); +cpu_to_le16 ((sess->max_burst /BYTE_UNITS ));if (sess->time2wait) fw_ddb_entry->iscsi_def_time2wait =
drivers/scsi/qla4xxx/ql4_nx.c +5 -5
@@ -3678,7 +3678,7 @@ qla4_82xx_read_flash_data(struct scsi_qla_host *ha, uint32_t *dwptr, "Do ROM fast read failed\n"); goto done_read; } - dwptr[i] =__constant_cpu_to_le32 (val); + dwptr[i] =cpu_to_le32 (val); } done_read:
@@ -3741,9 +3741,9 @@ qla4_8xxx_get_flt_info(struct scsi_qla_host *ha, uint32_t flt_addr) goto no_flash_data; } -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; -if (flt->version !=__constant_cpu_to_le16 (1 )) { +if (flt->version !=cpu_to_le16 (1 )) { DEBUG2(ql4_printk(KERN_INFO, ha, "Unsupported FLT detected: " "version=0x%x length=0x%x checksum=0x%x.\n", le16_to_cpu(flt->version), le16_to_cpu(flt->length),
@@ -3846,7 +3846,7 @@ qla4_82xx_get_fdt_info(struct scsi_qla_host *ha)qla4_82xx_read_optrom_data (ha, (uint8_t *)ha->request_ring, hw->flt_region_fdt <<2 ,OPTROM_BURST_SIZE ); -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; if (fdt->sig[0] != 'Q' || fdt->sig[1] != 'L' || fdt->sig[2] != 'I' ||
@@ -3903,7 +3903,7 @@ qla4_82xx_get_idc_param(struct scsi_qla_host *ha)qla4_82xx_read_optrom_data (ha, (uint8_t *)ha->request_ring,QLA82XX_IDC_PARAM_ADDR ,8 ); -if (*wptr ==__constant_cpu_to_le32 (0xffffffff )) { +if (*wptr ==cpu_to_le32 (0xffffffff )) { ha->nx_dev_init_timeout =ROM_DEV_INIT_TIMEOUT ; ha->nx_reset_timeout =ROM_DRV_RESET_ACK_TIMEOUT ; }else {
drivers/scsi/qla4xxx/ql4_os.c +5 -5
@@ -704,7 +704,7 @@ static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha, *chap_entry = (struct ql4_chap_table *)ha->chap_list + chap_index;if ((*chap_entry)->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) { rval =QLA_ERROR ; *chap_entry =NULL ; }else {
@@ -748,7 +748,7 @@ static int qla4xxx_find_free_chap_index(struct scsi_qla_host *ha, chap_table = (struct ql4_chap_table *)ha->chap_list + i;if ((chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) && +cpu_to_le16 (CHAP_VALID_COOKIE )) && (i >MAX_RESRV_CHAP_IDX )) { free_index = i;break ;
@@ -797,7 +797,7 @@ static int qla4xxx_get_chap_list(struct Scsi_Host *shost, uint16_t chap_tbl_idx,for (i = chap_tbl_idx; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) +cpu_to_le16 (CHAP_VALID_COOKIE ))continue ; chap_rec->chap_tbl_idx = i;
@@ -928,7 +928,7 @@ static int qla4xxx_delete_chap(struct Scsi_Host *shost, uint16_t chap_tbl_idx) goto exit_delete_chap; } - chap_table->cookie =__constant_cpu_to_le16 (0xFFFF ); + chap_table->cookie =cpu_to_le16 (0xFFFF ); offset =FLASH_CHAP_OFFSET | (chap_tbl_idx *sizeof (struct ql4_chap_table ));
@@ -6050,7 +6050,7 @@ static int qla4xxx_get_bidi_chap(struct scsi_qla_host *ha, char *username,for (i =0 ; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) {continue ; }
fs/cifs/smb2status.h +1 -1
@@ -29,7 +29,7 @@* C is set if "customer defined" error, N bit is reserved and MBZ */ -#define STATUS_SEVERITY_SUCCESS __constant_cpu_to_le32(0x0000) +#define STATUS_SEVERITY_SUCCESS cpu_to_le32(0x0000)#define STATUS_SEVERITY_INFORMATIONAL cpu_to_le32(0x0001)#define STATUS_SEVERITY_WARNING cpu_to_le32(0x0002)#define STATUS_SEVERITY_ERROR cpu_to_le32(0x0003)
Signature · 2 lines
René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin https://exactcode.com | https://t2sde.org | https://rene.rebe.de
Re: [PATCH v2] use cpu_to_le{16,32} instead of __constant_cpu_to_*
Quoted 2 lines · Rene Rebe
As per recommendation, convert a few remaining __constant_cpu_to_le{16,32} instances in the qla2xxx, qla4xxx and cifs to just cpu_to_le{16,32}.
[]
drivers/scsi/qla2xxx/qla_target.c
Quoted 1 line
drivers/scsi/qla2xxx/qla_target.c +0
-0
[]
drivers/scsi/qla2xxx/qla_target.c static int __qlt_send_term_imm_notif(struct scsi_qla_host *vha, · line 3586
Quoted 6 lines
drivers/scsi/qla2xxx/qla_target.c +1
-1@@ -3583,7 +3583,7 @@ static int __qlt_send_term_imm_notif(struct scsi_qla_host *vha,/* terminate */ nack->u.isp24.flags |= -__constant_cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE ); +cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE );
trivia: this now fits on a single line.
PATCH v3 1/1 use cpu_to_le{16,32} instead of __constant_cpu_to_*
In reply to a message not in the archiveQuoted 9 lines · Joe Perches
Review
Quoted 2 lines
(quoted diff) +1
-1- __constant_cpu_to_le16(NOTIFY_ACK_FLAGS_TERMINATE); + cpu_to_le16(NOTIFY_ACK_FLAGS_TERMINATE);trivia: this now fits on a single line.
Quoted 4 lines
Whether
__constant_cpu_to_le16()is used orcpu_to_le16(), the compiler generates exactly the same code. The name of thecpu_to_le16()function however is shorter. I recommendcpu_to_le16()because of its shorter name and because that's what other kernel drivers use.
As per recommendation, convert a few remaining __constant_cpu_to_le{16,32} instances in the qla2xxx, qla4xxx and cifs to just cpu_to_le{16,32}.
The later was apparently left over in f5307104e757 ("cifs: don't use __constant_cpu_to_le32()").
drivers/scsi/qla2xxx/qla_target.c +1 -1
@@ -3583,7 +3583,7 @@ static int __qlt_send_term_imm_notif(struct scsi_qla_host *vha,/* terminate */ nack->u.isp24.flags |= -__constant_cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE ); +cpu_to_le16 (NOTIFY_ACK_FLAGS_TERMINATE ); nack->u.isp24.srr_rx_id = ntfy->u.isp24.srr_rx_id; nack->u.isp24.status = ntfy->u.isp24.status;
drivers/scsi/qla2xxx/qla_tmpl.c +1 -1
@@ -912,7 +912,7 @@ qla27xx_driver_info(struct qla27xx_fwdt_template *tmp) tmp->driver_info[0 ] =cpu_to_le32 ( v[3 ] <<24 | v[2 ] <<16 | v[1 ] <<8 | v[0 ]); tmp->driver_info[1 ] =cpu_to_le32 (v[5 ] <<8 | v[4 ]); - tmp->driver_info[2 ] =__constant_cpu_to_le32 (0x12345678 ); + tmp->driver_info[2 ] =cpu_to_le32 (0x12345678 ); } static void
drivers/scsi/qla4xxx/ql4_init.c +2 -2
@@ -120,8 +120,8 @@ int qla4xxx_init_rings(struct scsi_qla_host *ha)* the interrupt_handler to think there are responses to be * processed when there aren't. */ - ha->shadow_regs->req_q_out =__constant_cpu_to_le32 (0 ); - ha->shadow_regs->rsp_q_in =__constant_cpu_to_le32 (0 ); + ha->shadow_regs->req_q_out =cpu_to_le32 (0 ); + ha->shadow_regs->rsp_q_in =cpu_to_le32 (0 );wmb ();writel (0 , &ha->reg->req_q_in);
drivers/scsi/qla4xxx/ql4_iocb.c +1 -1
@@ -161,7 +161,7 @@ static void qla4xxx_build_scsi_iocbs(struct srb *srb,if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) {/* No data being transferred */ - cmd_entry->ttlByteCnt =__constant_cpu_to_le32 (0 ); + cmd_entry->ttlByteCnt =cpu_to_le32 (0 );return ; }
drivers/scsi/qla4xxx/ql4_mbx.c +14 -14
@@ -646,8 +646,8 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)/* Fill in the request and response queue information. */ init_fw_cb->rqq_consumer_idx =cpu_to_le16 (ha->request_out); init_fw_cb->compq_producer_idx =cpu_to_le16 (ha->response_in); - init_fw_cb->rqq_len =__constant_cpu_to_le16 (REQUEST_QUEUE_DEPTH ); - init_fw_cb->compq_len =__constant_cpu_to_le16 (RESPONSE_QUEUE_DEPTH ); + init_fw_cb->rqq_len =cpu_to_le16 (REQUEST_QUEUE_DEPTH ); + init_fw_cb->compq_len =cpu_to_le16 (RESPONSE_QUEUE_DEPTH ); init_fw_cb->rqq_addr_lo =cpu_to_le32 (LSDW (ha->request_dma)); init_fw_cb->rqq_addr_hi =cpu_to_le32 (MSDW (ha->request_dma)); init_fw_cb->compq_addr_lo =cpu_to_le32 (LSDW (ha->response_dma));
@@ -657,20 +657,20 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)/* Set up required options. */ init_fw_cb->fw_options |= -__constant_cpu_to_le16 (FWOPT_SESSION_MODE | +cpu_to_le16 (FWOPT_SESSION_MODE |FWOPT_INITIATOR_MODE );if (is_qla80XX (ha)) init_fw_cb->fw_options |= -__constant_cpu_to_le16 (FWOPT_ENABLE_CRBDB ); +cpu_to_le16 (FWOPT_ENABLE_CRBDB ); - init_fw_cb->fw_options &=__constant_cpu_to_le16 (~FWOPT_TARGET_MODE ); + init_fw_cb->fw_options &=cpu_to_le16 (~FWOPT_TARGET_MODE ); init_fw_cb->add_fw_options =0 ; init_fw_cb->add_fw_options |= -__constant_cpu_to_le16 (ADFWOPT_SERIALIZE_TASK_MGMT ); +cpu_to_le16 (ADFWOPT_SERIALIZE_TASK_MGMT ); init_fw_cb->add_fw_options |= -__constant_cpu_to_le16 (ADFWOPT_AUTOCONN_DISABLE ); +cpu_to_le16 (ADFWOPT_AUTOCONN_DISABLE );if (qla4xxx_set_ifcb (ha, &mbox_cmd[0 ], &mbox_sts[0 ], init_fw_cb_dma) !=QLA_SUCCESS ) {
@@ -1614,7 +1614,7 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password,strlcpy (password, chap_table->secret,QL4_CHAP_MAX_SECRET_LEN );strlcpy (username, chap_table->name,QL4_CHAP_MAX_NAME_LEN ); - chap_table->cookie =__constant_cpu_to_le16 (CHAP_VALID_COOKIE ); + chap_table->cookie =cpu_to_le16 (CHAP_VALID_COOKIE ); exit_get_chap:dma_pool_free (ha->chap_dma_pool, chap_table, chap_dma);
@@ -1656,7 +1656,7 @@ int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password, chap_table->secret_len =strlen (password);strncpy (chap_table->secret, password,MAX_CHAP_SECRET_LEN -1 );strncpy (chap_table->name, username,MAX_CHAP_NAME_LEN -1 ); - chap_table->cookie =__constant_cpu_to_le16 (CHAP_VALID_COOKIE ); + chap_table->cookie =cpu_to_le16 (CHAP_VALID_COOKIE );if (is_qla40XX (ha)) { chap_size =MAX_CHAP_ENTRIES_40XX *sizeof (*chap_table);
@@ -1722,7 +1722,7 @@ int qla4xxx_get_uni_chap_at_index(struct scsi_qla_host *ha, char *username,mutex_lock (&ha->chap_sem); chap_table = (struct ql4_chap_table *)ha->chap_list + chap_index; -if (chap_table->cookie !=__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +if (chap_table->cookie !=cpu_to_le16 (CHAP_VALID_COOKIE )) { rval =QLA_ERROR ; goto exit_unlock_uni_chap; }
@@ -1785,7 +1785,7 @@ int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username,for (i =0 ; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) {if (i >MAX_RESRV_CHAP_IDX && free_index ==-1 ) free_index = i;continue ;
@@ -2106,18 +2106,18 @@ int qla4xxx_set_param_ddbentry(struct scsi_qla_host *ha,if (conn->max_recv_dlength) fw_ddb_entry->iscsi_max_rcv_data_seg_len = -__constant_cpu_to_le16 ((conn->max_recv_dlength /BYTE_UNITS )); +cpu_to_le16 ((conn->max_recv_dlength /BYTE_UNITS ));if (sess->max_r2t) fw_ddb_entry->iscsi_max_outsnd_r2t =cpu_to_le16 (sess->max_r2t);if (sess->first_burst) fw_ddb_entry->iscsi_first_burst_len = -__constant_cpu_to_le16 ((sess->first_burst /BYTE_UNITS )); +cpu_to_le16 ((sess->first_burst /BYTE_UNITS ));if (sess->max_burst) fw_ddb_entry->iscsi_max_burst_len = -__constant_cpu_to_le16 ((sess->max_burst /BYTE_UNITS )); +cpu_to_le16 ((sess->max_burst /BYTE_UNITS ));if (sess->time2wait) fw_ddb_entry->iscsi_def_time2wait =
drivers/scsi/qla4xxx/ql4_nx.c +5 -5
@@ -3678,7 +3678,7 @@ qla4_82xx_read_flash_data(struct scsi_qla_host *ha, uint32_t *dwptr, "Do ROM fast read failed\n"); goto done_read; } - dwptr[i] =__constant_cpu_to_le32 (val); + dwptr[i] =cpu_to_le32 (val); } done_read:
@@ -3741,9 +3741,9 @@ qla4_8xxx_get_flt_info(struct scsi_qla_host *ha, uint32_t flt_addr) goto no_flash_data; } -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; -if (flt->version !=__constant_cpu_to_le16 (1 )) { +if (flt->version !=cpu_to_le16 (1 )) { DEBUG2(ql4_printk(KERN_INFO, ha, "Unsupported FLT detected: " "version=0x%x length=0x%x checksum=0x%x.\n", le16_to_cpu(flt->version), le16_to_cpu(flt->length),
@@ -3846,7 +3846,7 @@ qla4_82xx_get_fdt_info(struct scsi_qla_host *ha)qla4_82xx_read_optrom_data (ha, (uint8_t *)ha->request_ring, hw->flt_region_fdt <<2 ,OPTROM_BURST_SIZE ); -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; if (fdt->sig[0] != 'Q' || fdt->sig[1] != 'L' || fdt->sig[2] != 'I' ||
@@ -3903,7 +3903,7 @@ qla4_82xx_get_idc_param(struct scsi_qla_host *ha)qla4_82xx_read_optrom_data (ha, (uint8_t *)ha->request_ring,QLA82XX_IDC_PARAM_ADDR ,8 ); -if (*wptr ==__constant_cpu_to_le32 (0xffffffff )) { +if (*wptr ==cpu_to_le32 (0xffffffff )) { ha->nx_dev_init_timeout =ROM_DEV_INIT_TIMEOUT ; ha->nx_reset_timeout =ROM_DRV_RESET_ACK_TIMEOUT ; }else {
drivers/scsi/qla4xxx/ql4_os.c +5 -8
@@ -703,8 +703,7 @@ static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha, } *chap_entry = (struct ql4_chap_table *)ha->chap_list + chap_index; -if ((*chap_entry)->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +if ((*chap_entry)->cookie !=cpu_to_le16 (CHAP_VALID_COOKIE )) { rval =QLA_ERROR ; *chap_entry =NULL ; }else {
@@ -747,8 +746,7 @@ static int qla4xxx_find_free_chap_index(struct scsi_qla_host *ha,for (i =0 ; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i; -if ((chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) && +if ((chap_table->cookie !=cpu_to_le16 (CHAP_VALID_COOKIE )) && (i >MAX_RESRV_CHAP_IDX )) { free_index = i;break ;
@@ -796,8 +794,7 @@ static int qla4xxx_get_chap_list(struct Scsi_Host *shost, uint16_t chap_tbl_idx,mutex_lock (&ha->chap_sem);for (i = chap_tbl_idx; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i; -if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) +if (chap_table->cookie !=cpu_to_le16 (CHAP_VALID_COOKIE ))continue ; chap_rec->chap_tbl_idx = i;
@@ -928,7 +925,7 @@ static int qla4xxx_delete_chap(struct Scsi_Host *shost, uint16_t chap_tbl_idx) goto exit_delete_chap; } - chap_table->cookie =__constant_cpu_to_le16 (0xFFFF ); + chap_table->cookie =cpu_to_le16 (0xFFFF ); offset =FLASH_CHAP_OFFSET | (chap_tbl_idx *sizeof (struct ql4_chap_table ));
@@ -6050,7 +6047,7 @@ static int qla4xxx_get_bidi_chap(struct scsi_qla_host *ha, char *username,for (i =0 ; i < max_chap_entries; i++) { chap_table = (struct ql4_chap_table *)ha->chap_list + i;if (chap_table->cookie != -__constant_cpu_to_le16 (CHAP_VALID_COOKIE )) { +cpu_to_le16 (CHAP_VALID_COOKIE )) {continue ; }
fs/cifs/smb2status.h +1 -1
@@ -29,7 +29,7 @@* C is set if "customer defined" error, N bit is reserved and MBZ */ -#define STATUS_SEVERITY_SUCCESS __constant_cpu_to_le32(0x0000) +#define STATUS_SEVERITY_SUCCESS cpu_to_le32(0x0000)#define STATUS_SEVERITY_INFORMATIONAL cpu_to_le32(0x0001)#define STATUS_SEVERITY_WARNING cpu_to_le32(0x0002)#define STATUS_SEVERITY_ERROR cpu_to_le32(0x0003)
Signature · 2 lines
René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin https://exactcode.com | https://t2sde.org | https://rene.rebe.de