Skip to content

Commit ca2770c

Browse files
mgurtovoyjgunthorpe
authored andcommitted
IB/iser: Align coding style across driver
The following changes were made: 1. Align function signatures to 80 characters per line. 2. Remove tabs for variable assignment and use 1 space instead. 3. Don't compare to NULL in "if" clause. 4. Remove strange indentations. This will ease on the maintenance of the driver for the future. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Max Gurtovoy <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 48886a8 commit ca2770c

File tree

4 files changed

+87
-126
lines changed

4 files changed

+87
-126
lines changed

drivers/infiniband/ulp/iser/iscsi_iser.c

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,8 @@ static int iscsi_iser_set(const char *val, const struct kernel_param *kp)
135135
* Notes: In case of data length errors or iscsi PDU completion failures
136136
* this routine will signal iscsi layer of connection failure.
137137
*/
138-
void
139-
iscsi_iser_recv(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
140-
char *rx_data, int rx_data_len)
138+
void iscsi_iser_recv(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
139+
char *rx_data, int rx_data_len)
141140
{
142141
int rc = 0;
143142
int datalen;
@@ -172,8 +171,7 @@ iscsi_iser_recv(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
172171
* Netes: This routine can't fail, just assign iscsi task
173172
* hdr and max hdr size.
174173
*/
175-
static int
176-
iscsi_iser_pdu_alloc(struct iscsi_task *task, uint8_t opcode)
174+
static int iscsi_iser_pdu_alloc(struct iscsi_task *task, uint8_t opcode)
177175
{
178176
struct iscsi_iser_task *iser_task = task->dd_data;
179177

@@ -194,9 +192,8 @@ iscsi_iser_pdu_alloc(struct iscsi_task *task, uint8_t opcode)
194192
* state mutex to avoid dereferencing the IB device which
195193
* may have already been terminated.
196194
*/
197-
int
198-
iser_initialize_task_headers(struct iscsi_task *task,
199-
struct iser_tx_desc *tx_desc)
195+
int iser_initialize_task_headers(struct iscsi_task *task,
196+
struct iser_tx_desc *tx_desc)
200197
{
201198
struct iser_conn *iser_conn = task->conn->dd_data;
202199
struct iser_device *device = iser_conn->ib_conn.device;
@@ -233,8 +230,7 @@ iser_initialize_task_headers(struct iscsi_task *task,
233230
* Return: Returns zero on success or -ENOMEM when failing
234231
* to init task headers (dma mapping error).
235232
*/
236-
static int
237-
iscsi_iser_task_init(struct iscsi_task *task)
233+
static int iscsi_iser_task_init(struct iscsi_task *task)
238234
{
239235
struct iscsi_iser_task *iser_task = task->dd_data;
240236
int ret;
@@ -268,8 +264,8 @@ iscsi_iser_task_init(struct iscsi_task *task)
268264
* xmit.
269265
*
270266
**/
271-
static int
272-
iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task)
267+
static int iscsi_iser_mtask_xmit(struct iscsi_conn *conn,
268+
struct iscsi_task *task)
273269
{
274270
int error = 0;
275271

@@ -286,9 +282,8 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task)
286282
return error;
287283
}
288284

289-
static int
290-
iscsi_iser_task_xmit_unsol_data(struct iscsi_conn *conn,
291-
struct iscsi_task *task)
285+
static int iscsi_iser_task_xmit_unsol_data(struct iscsi_conn *conn,
286+
struct iscsi_task *task)
292287
{
293288
struct iscsi_r2t_info *r2t = &task->unsol_r2t;
294289
struct iscsi_data hdr;
@@ -322,8 +317,7 @@ iscsi_iser_task_xmit_unsol_data(struct iscsi_conn *conn,
322317
*
323318
* Return: zero on success or escalates $error on failure.
324319
*/
325-
static int
326-
iscsi_iser_task_xmit(struct iscsi_task *task)
320+
static int iscsi_iser_task_xmit(struct iscsi_task *task)
327321
{
328322
struct iscsi_conn *conn = task->conn;
329323
struct iscsi_iser_task *iser_task = task->dd_data;
@@ -406,8 +400,7 @@ static void iscsi_iser_cleanup_task(struct iscsi_task *task)
406400
*
407401
* In addition the error sector is marked.
408402
*/
409-
static u8
410-
iscsi_iser_check_protection(struct iscsi_task *task, sector_t *sector)
403+
static u8 iscsi_iser_check_protection(struct iscsi_task *task, sector_t *sector)
411404
{
412405
struct iscsi_iser_task *iser_task = task->dd_data;
413406
enum iser_data_dir dir = iser_task->dir[ISER_DIR_IN] ?
@@ -456,11 +449,9 @@ iscsi_iser_conn_create(struct iscsi_cls_session *cls_session,
456449
* -EINVAL in case end-point doesn't exsits anymore or iser connection
457450
* state is not UP (teardown already started).
458451
*/
459-
static int
460-
iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
461-
struct iscsi_cls_conn *cls_conn,
462-
uint64_t transport_eph,
463-
int is_leading)
452+
static int iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
453+
struct iscsi_cls_conn *cls_conn,
454+
uint64_t transport_eph, int is_leading)
464455
{
465456
struct iscsi_conn *conn = cls_conn->dd_data;
466457
struct iser_conn *iser_conn;
@@ -515,8 +506,7 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
515506
* from this point iscsi must call conn_stop in session/connection
516507
* teardown so iser transport must wait for it.
517508
*/
518-
static int
519-
iscsi_iser_conn_start(struct iscsi_cls_conn *cls_conn)
509+
static int iscsi_iser_conn_start(struct iscsi_cls_conn *cls_conn)
520510
{
521511
struct iscsi_conn *iscsi_conn;
522512
struct iser_conn *iser_conn;
@@ -538,8 +528,7 @@ iscsi_iser_conn_start(struct iscsi_cls_conn *cls_conn)
538528
* handle, so we call it under iser the state lock to protect against
539529
* this kind of race.
540530
*/
541-
static void
542-
iscsi_iser_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
531+
static void iscsi_iser_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
543532
{
544533
struct iscsi_conn *conn = cls_conn->dd_data;
545534
struct iser_conn *iser_conn = conn->dd_data;
@@ -574,8 +563,7 @@ iscsi_iser_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
574563
*
575564
* Removes and free iscsi host.
576565
*/
577-
static void
578-
iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session)
566+
static void iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session)
579567
{
580568
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
581569

@@ -584,8 +572,7 @@ iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session)
584572
iscsi_host_free(shost);
585573
}
586574

587-
static inline unsigned int
588-
iser_dif_prot_caps(int prot_caps)
575+
static inline unsigned int iser_dif_prot_caps(int prot_caps)
589576
{
590577
int ret = 0;
591578

@@ -704,9 +691,8 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
704691
return NULL;
705692
}
706693

707-
static int
708-
iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
709-
enum iscsi_param param, char *buf, int buflen)
694+
static int iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
695+
enum iscsi_param param, char *buf, int buflen)
710696
{
711697
int value;
712698

@@ -756,8 +742,8 @@ iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
756742
*
757743
* Output connection statistics.
758744
*/
759-
static void
760-
iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
745+
static void iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn,
746+
struct iscsi_stats *stats)
761747
{
762748
struct iscsi_conn *conn = cls_conn->dd_data;
763749

@@ -808,9 +794,9 @@ static int iscsi_iser_get_ep_param(struct iscsi_endpoint *ep,
808794
* Return: iscsi_endpoint created by iscsi layer or ERR_PTR(error)
809795
* if fails.
810796
*/
811-
static struct iscsi_endpoint *
812-
iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
813-
int non_blocking)
797+
static struct iscsi_endpoint *iscsi_iser_ep_connect(struct Scsi_Host *shost,
798+
struct sockaddr *dst_addr,
799+
int non_blocking)
814800
{
815801
int err;
816802
struct iser_conn *iser_conn;
@@ -853,8 +839,7 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
853839
* or more likely iser connection state transitioned to TEMINATING or
854840
* DOWN during the wait period.
855841
*/
856-
static int
857-
iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
842+
static int iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
858843
{
859844
struct iser_conn *iser_conn = ep->dd_data;
860845
int rc;
@@ -889,8 +874,7 @@ iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
889874
* and cleanup or actually call it immediately in case we didn't pass
890875
* iscsi conn bind/start stage, thus it is safe.
891876
*/
892-
static void
893-
iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep)
877+
static void iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep)
894878
{
895879
struct iser_conn *iser_conn = ep->dd_data;
896880

drivers/infiniband/ulp/iser/iser_initiator.c

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,8 @@ static int iser_prepare_read_cmd(struct iscsi_task *task)
9595
* task->data[ISER_DIR_OUT].data_len, Protection size
9696
* is stored at task->prot[ISER_DIR_OUT].data_len
9797
*/
98-
static int
99-
iser_prepare_write_cmd(struct iscsi_task *task,
100-
unsigned int imm_sz,
101-
unsigned int unsol_sz,
102-
unsigned int edtl)
98+
static int iser_prepare_write_cmd(struct iscsi_task *task, unsigned int imm_sz,
99+
unsigned int unsol_sz, unsigned int edtl)
103100
{
104101
struct iscsi_iser_task *iser_task = task->dd_data;
105102
struct iser_mem_reg *mem_reg;
@@ -160,8 +157,8 @@ iser_prepare_write_cmd(struct iscsi_task *task,
160157
}
161158

162159
/* creates a new tx descriptor and adds header regd buffer */
163-
static void iser_create_send_desc(struct iser_conn *iser_conn,
164-
struct iser_tx_desc *tx_desc)
160+
static void iser_create_send_desc(struct iser_conn *iser_conn,
161+
struct iser_tx_desc *tx_desc)
165162
{
166163
struct iser_device *device = iser_conn->ib_conn.device;
167164

@@ -355,8 +352,7 @@ static int iser_post_rx_bufs(struct iscsi_conn *conn, struct iscsi_hdr *req)
355352
* @conn: link to matching iscsi connection
356353
* @task: SCSI command task
357354
*/
358-
int iser_send_command(struct iscsi_conn *conn,
359-
struct iscsi_task *task)
355+
int iser_send_command(struct iscsi_conn *conn, struct iscsi_task *task)
360356
{
361357
struct iser_conn *iser_conn = conn->dd_data;
362358
struct iscsi_iser_task *iser_task = task->dd_data;
@@ -427,8 +423,7 @@ int iser_send_command(struct iscsi_conn *conn,
427423
* @task: SCSI command task
428424
* @hdr: pointer to the LLD's iSCSI message header
429425
*/
430-
int iser_send_data_out(struct iscsi_conn *conn,
431-
struct iscsi_task *task,
426+
int iser_send_data_out(struct iscsi_conn *conn, struct iscsi_task *task,
432427
struct iscsi_data *hdr)
433428
{
434429
struct iser_conn *iser_conn = conn->dd_data;
@@ -490,8 +485,7 @@ int iser_send_data_out(struct iscsi_conn *conn,
490485
return err;
491486
}
492487

493-
int iser_send_control(struct iscsi_conn *conn,
494-
struct iscsi_task *task)
488+
int iser_send_control(struct iscsi_conn *conn, struct iscsi_task *task)
495489
{
496490
struct iser_conn *iser_conn = conn->dd_data;
497491
struct iscsi_iser_task *iser_task = task->dd_data;
@@ -590,8 +584,7 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc)
590584
iser_post_recvm(iser_conn, iser_conn->rx_descs);
591585
}
592586

593-
static inline int
594-
iser_inv_desc(struct iser_fr_desc *desc, u32 rkey)
587+
static inline int iser_inv_desc(struct iser_fr_desc *desc, u32 rkey)
595588
{
596589
if (unlikely((!desc->sig_protected && rkey != desc->rsc.mr->rkey) ||
597590
(desc->sig_protected && rkey != desc->rsc.sig_mr->rkey))) {
@@ -604,10 +597,8 @@ iser_inv_desc(struct iser_fr_desc *desc, u32 rkey)
604597
return 0;
605598
}
606599

607-
static int
608-
iser_check_remote_inv(struct iser_conn *iser_conn,
609-
struct ib_wc *wc,
610-
struct iscsi_hdr *hdr)
600+
static int iser_check_remote_inv(struct iser_conn *iser_conn, struct ib_wc *wc,
601+
struct iscsi_hdr *hdr)
611602
{
612603
if (wc->wc_flags & IB_WC_WITH_INVALIDATE) {
613604
struct iscsi_task *task;

0 commit comments

Comments
 (0)