Skip to content

Commit 2a5a0b3

Browse files
committed
Enable -Wno-unused-parameter
Instead of adding __attribute__((unused)) to unused arguments, add the -Wno-unused-parameter compiler flag. Signed-off-by: Bart Van Assche <[email protected]>
1 parent ea6b228 commit 2a5a0b3

33 files changed

+71
-72
lines changed

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ endif
1212

1313
ACLOCAL_AMFLAGS =-I m4
1414
AUTOMAKE_OPTIONS = foreign subdir-objects
15-
AM_CPPFLAGS=-I. -I$(srcdir)/include "-D_U_=__attribute__((unused))"
15+
AM_CPPFLAGS=-I. -I$(srcdir)/include
1616
AM_CFLAGS=$(WARN_CFLAGS)
1717

1818
EXTRA_DIST = autogen.sh COPYING LICENCE-GPL-2.txt LICENCE-LGPL-2.1.txt \

aros/Makefile.AROS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AR=ar
22
CC=gcc
3-
CFLAGS=-g -O0 -DAROS=1 -D_U_=" " -DHAVE_SYS_TYPES_H -DHAVE_SOCKADDR_LEN -I. -Iinclude -Iaros
3+
CFLAGS=-g -O0 -DAROS=1 -DHAVE_SYS_TYPES_H -DHAVE_SOCKADDR_LEN -I. -Iinclude -Iaros
44

55
OBJS=lib/connect.o lib/crc32c.o lib/discovery.o lib/init.o lib/iscsi-command.o lib/logging.o lib/login.o lib/md5.o lib/nop.o lib/pdu.o lib/scsi-lowlevel.o lib/socket.o lib/sync.o lib/task_mgmt.o aros/aros_compat.o
66

aros/iscsi-ls.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void list_luns(struct client_state *clnt, const char *target, const char *portal
219219

220220

221221

222-
void discoverylogout_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
222+
void discoverylogout_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
223223
{
224224
struct client_state *state = (struct client_state *)private_data;
225225

@@ -259,7 +259,7 @@ void discovery_cb(struct iscsi_context *iscsi, int status, void *command_data, v
259259
}
260260

261261

262-
void discoverylogin_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
262+
void discoverylogin_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
263263
{
264264
if (status != 0) {
265265
fprintf(stderr, "Login failed. %s\n", iscsi_get_error(iscsi));
@@ -272,7 +272,7 @@ void discoverylogin_cb(struct iscsi_context *iscsi, int status, void *command_da
272272
}
273273
}
274274

275-
void discoveryconnect_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
275+
void discoveryconnect_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
276276
{
277277
if (status != 0) {
278278
fprintf(stderr, "discoveryconnect_cb: connection failed : %s\n", iscsi_get_error(iscsi));

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror],
3030
if test "$ac_cv_prog_gcc" = yes; then
3131
WARN_CFLAGS="-Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wno-strict-aliasing -Wvla"
3232
WARN_CFLAGS="$WARN_CFLAGS -Wno-unknown-warning-option -Wno-stringop-truncation"
33+
WARN_CFLAGS="$WARN_CFLAGS -Wno-unused-parameter"
3334
if test "x$enable_werror" != "xno"; then
3435
WARN_CFLAGS="$WARN_CFLAGS -Werror"
3536
fi

examples/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS=-I. -I${srcdir}/../include "-D_U_=__attribute__((unused))"
1+
AM_CPPFLAGS=-I. -I${srcdir}/../include
22
AM_CFLAGS=$(WARN_CFLAGS)
33
AM_LDFLAGS=-no-undefined
44
LIBS=../lib/libiscsi.la

examples/iscsi-dd.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void write_cb(struct iscsi_context *iscsi, int status, void *command_data, void
102102
free(wt);
103103
}
104104

105-
void read_cb(struct iscsi_context *iscsi _U_, int status, void *command_data, void *private_data)
105+
void read_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
106106
{
107107
struct client *client = (struct client *)private_data;
108108
struct scsi_task *task = command_data;
@@ -276,7 +276,7 @@ void populate_param_header(unsigned char *buf, int list_id, int str, int list_id
276276
buf[15] = inline_data_len & 0xFF;
277277
}
278278

279-
void xcopy_cb(struct iscsi_context *iscsi _U_, int status, void *command_data, void *private_data)
279+
void xcopy_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
280280
{
281281
struct client *client = (struct client *)private_data;
282282
struct scsi_task *task = command_data;

examples/iscsiclient.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct client_state {
6363

6464
unsigned char small_buffer[512];
6565

66-
void tm_at_cb(struct iscsi_context *iscsi _U_, int status _U_, void *command_data _U_, void *private_data)
66+
void tm_at_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
6767
{
6868
struct client_state *clnt = (struct client_state *)private_data;
6969

@@ -74,7 +74,7 @@ void tm_at_cb(struct iscsi_context *iscsi _U_, int status _U_, void *command_dat
7474
}
7575

7676

77-
void synccache10_cb(struct iscsi_context *iscsi _U_, int status, void *command_data _U_, void *private_data _U_)
77+
void synccache10_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
7878
{
7979
printf("SYNCCACHE10 status:%d\n", status);
8080
}
@@ -103,7 +103,7 @@ void nop_out_cb(struct iscsi_context *iscsi, int status, void *command_data, voi
103103
}
104104

105105

106-
void write10_1_cb(struct iscsi_context *iscsi _U_, int status, void *command_data, void *private_data _U_)
106+
void write10_1_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
107107
{
108108
struct scsi_task *task = command_data;
109109

@@ -123,7 +123,7 @@ void write10_1_cb(struct iscsi_context *iscsi _U_, int status, void *command_dat
123123
exit(10);
124124
}
125125

126-
void write10_cb(struct iscsi_context *iscsi _U_, int status, void *command_data, void *private_data _U_)
126+
void write10_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
127127
{
128128
struct client_state *clnt = (struct client_state *)private_data;
129129
struct scsi_task *task = command_data;
@@ -482,7 +482,7 @@ void reportluns_cb(struct iscsi_context *iscsi, int status, void *command_data,
482482
}
483483

484484

485-
void normallogin_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
485+
void normallogin_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
486486
{
487487
if (status != 0) {
488488
printf("Failed to log in to target : %s\n", iscsi_get_error(iscsi));
@@ -497,7 +497,7 @@ void normallogin_cb(struct iscsi_context *iscsi, int status, void *command_data
497497
}
498498

499499

500-
void normalconnect_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
500+
void normalconnect_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
501501
{
502502
printf("Connected to iscsi socket\n");
503503

@@ -517,7 +517,7 @@ void normalconnect_cb(struct iscsi_context *iscsi, int status, void *command_dat
517517

518518

519519

520-
void discoverylogout_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
520+
void discoverylogout_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
521521
{
522522
struct client_state *clnt = (struct client_state *)private_data;
523523

@@ -586,7 +586,7 @@ void discovery_cb(struct iscsi_context *iscsi, int status, void *command_data, v
586586
}
587587

588588

589-
void discoverylogin_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
589+
void discoverylogin_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
590590
{
591591
if (status != 0) {
592592
printf("Failed to log in to target. : %s\n", iscsi_get_error(iscsi));
@@ -601,7 +601,7 @@ void discoverylogin_cb(struct iscsi_context *iscsi, int status, void *command_da
601601

602602
}
603603

604-
void discoveryconnect_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
604+
void discoveryconnect_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data)
605605
{
606606
printf("Connected to iscsi socket status:0x%08x\n", status);
607607

@@ -619,7 +619,7 @@ void discoveryconnect_cb(struct iscsi_context *iscsi, int status, void *command_
619619
}
620620

621621

622-
int main(int argc _U_, char *argv[] _U_)
622+
int main(int argc, char *argv[])
623623
{
624624
struct iscsi_context *iscsi;
625625
struct pollfd pfd;

include/iscsi-private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ uint32_t iscsi_itt_post_increment(struct iscsi_context *iscsi);
371371

372372
void iscsi_timeout_scan(struct iscsi_context *iscsi);
373373

374-
void iscsi_reconnect_cb(struct iscsi_context *iscsi _U_, int status,
374+
void iscsi_reconnect_cb(struct iscsi_context *iscsi, int status,
375375
void *command_data, void *private_data);
376376

377377
struct iscsi_pdu *iscsi_tcp_new_pdu(struct iscsi_context *iscsi, size_t size);

lib/Makefile.am

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ endif
2222

2323
libiscsipriv_la_LDFLAGS = -no-undefined
2424

25-
libiscsipriv_la_CPPFLAGS = -I${srcdir}/../include -I$(srcdir)/include \
26-
"-D_U_=__attribute__((unused))"
25+
libiscsipriv_la_CPPFLAGS = -I${srcdir}/../include -I$(srcdir)/include
2726

2827
AM_CFLAGS=$(WARN_CFLAGS)
2928

lib/connect.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct connect_task {
4646
};
4747

4848
static void
49-
iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
49+
iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_data,
5050
void *private_data);
5151

5252

@@ -144,7 +144,7 @@ iscsi_testunitready_cb(struct iscsi_context *iscsi, int status,
144144
}
145145

146146
static void
147-
iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
147+
iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data,
148148
void *private_data)
149149
{
150150
struct connect_task *ct = private_data;
@@ -184,7 +184,7 @@ iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
184184
}
185185

186186
static void
187-
iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
187+
iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_data,
188188
void *private_data)
189189
{
190190
struct connect_task *ct = private_data;
@@ -276,8 +276,8 @@ void iscsi_defer_reconnect(struct iscsi_context *iscsi)
276276
iscsi_cancel_pdus(iscsi);
277277
}
278278

279-
void iscsi_reconnect_cb(struct iscsi_context *iscsi _U_, int status,
280-
void *command_data _U_, void *private_data _U_)
279+
void iscsi_reconnect_cb(struct iscsi_context *iscsi, int status,
280+
void *command_data, void *private_data)
281281
{
282282
struct iscsi_context *old_iscsi;
283283
int i;

lib/iscsi-command.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
static void
4242
iscsi_scsi_response_cb(struct iscsi_context *iscsi, int status,
43-
void *command_data _U_, void *private_data)
43+
void *command_data, void *private_data)
4444
{
4545
struct iscsi_scsi_cbdata *scsi_cbdata =
4646
(struct iscsi_scsi_cbdata *)private_data;
@@ -2433,7 +2433,7 @@ iscsi_get_scsi_task_iovector_in(struct iscsi_context *iscsi, struct iscsi_in_pdu
24332433
}
24342434

24352435
struct scsi_iovector *
2436-
iscsi_get_scsi_task_iovector_out(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu)
2436+
iscsi_get_scsi_task_iovector_out(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
24372437
{
24382438
if (pdu->scsi_cbdata.task->iovector_out.iov == NULL) {
24392439
return NULL;

lib/iser.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ iscsi_iser_get_fd(struct iscsi_context *iscsi)
8383
* Being used in QEMU iscsi block so we need compatability with TCP
8484
*/
8585
static int
86-
iscsi_iser_which_events(struct iscsi_context *iscsi _U_)
86+
iscsi_iser_which_events(struct iscsi_context *iscsi)
8787
{
8888
/* iSER is waiting to events from CQ that are always POLLIN */
8989
return 1;
@@ -1401,8 +1401,8 @@ iser_rcv_completion(struct iser_rx_desc *rx_desc,
14011401
*
14021402
*/
14031403
static int
1404-
iser_snd_completion(struct iser_tx_desc *tx_desc _U_,
1405-
struct iser_conn *iser_conn _U_)
1404+
iser_snd_completion(struct iser_tx_desc *tx_desc,
1405+
struct iser_conn *iser_conn)
14061406
{
14071407
return 0;
14081408
}

lib/login.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ iscsi_logout_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
14351435

14361436
int
14371437
iscsi_process_logout_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
1438-
struct iscsi_in_pdu *in _U_)
1438+
struct iscsi_in_pdu *in)
14391439
{
14401440
iscsi->is_loggedin = 0;
14411441
ISCSI_LOG(iscsi, 2, "logout successful");

lib/pdu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ int iscsi_process_target_nop_in(struct iscsi_context *iscsi,
330330
}
331331

332332
static void iscsi_reconnect_after_logout(struct iscsi_context *iscsi, int status,
333-
void *command_data _U_, void *opaque _U_)
333+
void *command_data, void *opaque)
334334
{
335335
if (status) {
336336
ISCSI_LOG(iscsi, 1, "logout failed: %s", iscsi_get_error(iscsi));

lib/scsi-lowlevel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ scsi_cdb_report_supported_opcodes(int rctd, int options, enum scsi_opcode opcode
12461246
* readcapacity10 datain structure
12471247
*/
12481248
static int
1249-
scsi_readcapacity10_datain_getfullsize(struct scsi_task *task _U_)
1249+
scsi_readcapacity10_datain_getfullsize(struct scsi_task *task)
12501250
{
12511251
return 8;
12521252
}

lib/socket.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ void iscsi_set_tcp_keepintvl(struct iscsi_context *iscsi, int value)
10691069
ISCSI_LOG(iscsi, 2, "TCP_KEEPINTVL will be set to %d on next socket creation",value);
10701070
}
10711071

1072-
int iscsi_set_tcp_keepalive(struct iscsi_context *iscsi, int idle _U_, int count _U_, int interval _U_)
1072+
int iscsi_set_tcp_keepalive(struct iscsi_context *iscsi, int idle, int count, int interval)
10731073
{
10741074
#ifdef SO_KEEPALIVE
10751075
int value = 1;
@@ -1104,7 +1104,7 @@ int iscsi_set_tcp_keepalive(struct iscsi_context *iscsi, int idle _U_, int count
11041104
return 0;
11051105
}
11061106

1107-
void iscsi_set_bind_interfaces(struct iscsi_context *iscsi, char * interfaces _U_)
1107+
void iscsi_set_bind_interfaces(struct iscsi_context *iscsi, char * interfaces)
11081108
{
11091109
#if __linux
11101110
strncpy(iscsi->bind_interfaces,interfaces,MAX_STRING_SIZE);

lib/sync.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ event_loop(struct iscsi_context *iscsi, struct iscsi_sync_state *state)
8282
* Synchronous iSCSI commands
8383
*/
8484
static void
85-
iscsi_sync_cb(struct iscsi_context *iscsi _U_, int status,
86-
void *command_data _U_, void *private_data)
85+
iscsi_sync_cb(struct iscsi_context *iscsi, int status,
86+
void *command_data, void *private_data)
8787
{
8888
struct iscsi_sync_state *state = private_data;
8989

@@ -340,7 +340,7 @@ iscsi_task_mgmt_target_cold_reset_sync(struct iscsi_context *iscsi)
340340
* Synchronous SCSI commands
341341
*/
342342
static void
343-
scsi_sync_cb(struct iscsi_context *iscsi _U_, int status, void *command_data,
343+
scsi_sync_cb(struct iscsi_context *iscsi, int status, void *command_data,
344344
void *private_data)
345345
{
346346
struct scsi_task *task = command_data;
@@ -1820,7 +1820,7 @@ iscsi_modesense10_sync(struct iscsi_context *iscsi, int lun, int llbaa, int dbd,
18201820
return state.task;
18211821
}
18221822

1823-
void iscsi_free_discovery_data(struct iscsi_context *iscsi _U_,
1823+
void iscsi_free_discovery_data(struct iscsi_context *iscsi,
18241824
struct iscsi_discovery_address *da)
18251825
{
18261826
while (da) {
@@ -1840,7 +1840,7 @@ void iscsi_free_discovery_data(struct iscsi_context *iscsi _U_,
18401840
}
18411841

18421842
static void
1843-
iscsi_discovery_cb(struct iscsi_context *iscsi _U_, int status,
1843+
iscsi_discovery_cb(struct iscsi_context *iscsi, int status,
18441844
void *command_data, void *private_data)
18451845
{
18461846
struct iscsi_sync_state *state = private_data;

test-tool/Makefile.am

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
AM_CPPFLAGS=-I. -I${srcdir}/../include \
2-
"-D_U_=__attribute__((unused)) "
1+
AM_CPPFLAGS=-I. -I${srcdir}/../include
32
AM_CFLAGS=$(WARN_CFLAGS)
43
AM_LDFLAGS=-no-undefined
54
LIBS = ../lib/libiscsipriv.la

test-tool/test_iscsi_nop_simple.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ test_iscsi_nop_txrx(struct test_iscsi_nop_state *state)
5757
}
5858

5959
static void
60-
test_iscsi_nop_cb(struct iscsi_context *iscsi _U_, int status,
60+
test_iscsi_nop_cb(struct iscsi_context *iscsi, int status,
6161
void *command_data, void *private_data)
6262
{
6363
struct test_iscsi_nop_state *state = private_data;

test-tool/test_iscsi_sendtargets.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ test_iscsi_sendtargets_txrx(struct test_iscsi_sendtargets_state *state)
5959
}
6060

6161
static void
62-
test_iscsi_sendtargets_cb(struct iscsi_context *iscsi _U_, int status,
63-
void *command_data _U_, void *private_data)
62+
test_iscsi_sendtargets_cb(struct iscsi_context *iscsi, int status,
63+
void *command_data, void *private_data)
6464
{
6565
struct test_iscsi_sendtargets_state *state = private_data;
6666

test-tool/test_sanitize_reset.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include "scsi-lowlevel.h"
2727
#include "iscsi-test-cu.h"
2828

29-
static void sanitize_cb(struct iscsi_context *iscsi _U_, int status _U_,
30-
void *command_data _U_, void *private_data _U_)
29+
static void sanitize_cb(struct iscsi_context *iscsi, int status,
30+
void *command_data, void *private_data)
3131
{
3232
}
3333

tests/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I${srcdir}/../include "-D_U_=__attribute__((unused))"
1+
AM_CPPFLAGS = -I${srcdir}/../include
22
AM_CFLAGS = $(WARN_CFLAGS)
33
AM_LDFLAGS = -no-undefined
44
LIBS = ../lib/libiscsi.la

tests/prog_header_digest.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ void event_loop(struct iscsi_context *iscsi, struct client_state *state,
8282
}
8383
}
8484

85-
void tur_cb(struct iscsi_context *iscsi _U_, int status,
86-
void *command_data _U_, void *private_data)
85+
void tur_cb(struct iscsi_context *iscsi, int status,
86+
void *command_data, void *private_data)
8787
{
8888
struct client_state *state = (struct client_state *)private_data;
8989

0 commit comments

Comments
 (0)