treewide: Various style fixups

- Mostly problems with whitespace:
	- Use of spaces instead of tabs
	- Stray spaces before closing ')
	- Missing spaces

- Missing 'void' from function declarations & definitions that
  take no arguments.

- Wrong indentation level
This commit is contained in:
Denis Kenzior 2022-01-11 10:51:11 -06:00
parent 967c95829f
commit fe95cbe077
29 changed files with 71 additions and 65 deletions

View File

@ -668,7 +668,7 @@ static void sta_append(void *data, void *user_data)
{
struct sta_state *sta = data;
struct l_dbus_message_builder *builder = user_data;
const char* macstr;
const char *macstr;
if (!sta->authenticated)
return;

View File

@ -162,7 +162,7 @@ static void signal_handler(int signo)
exit(EXIT_FAILURE);
}
void __iwd_backtrace_init()
void __iwd_backtrace_init(void)
{
static char path[PATH_MAX];
static char cwd[PATH_MAX];
@ -174,6 +174,7 @@ void __iwd_backtrace_init()
len = readlink("/proc/self/exe", path, sizeof(path) - 1);
if (len > 0) {
int i;
path[len] = '\0';
for (i = len - 1; i >= 0; i--) {

View File

@ -20,6 +20,6 @@
*
*/
#ifdef HAVE_BACKTRACE
void __iwd_backtrace_init();
void __iwd_backtrace_init(void);
void __iwd_backtrace_print(unsigned int offset);
#endif

View File

@ -73,7 +73,8 @@ size_t crypto_dh5_generator_size = sizeof(crypto_dh5_generator);
static bool hmac_common(enum l_checksum_type type,
const void *key, size_t key_len,
const void *data, size_t data_len, void *output, size_t size)
const void *data, size_t data_len,
void *output, size_t size)
{
struct l_checksum *hmac;
@ -438,9 +439,9 @@ free_ctr:
return false;
}
#define SWAP(a,b) do { int _t = a; a = b; b = _t; } while (0)
#define SWAP(a, b) do { int _t = a; a = b; b = _t; } while (0)
static void arc4_set_key(struct arc4_ctx *ctx, unsigned length,
static void arc4_set_key(struct arc4_ctx *ctx, unsigned int length,
const uint8_t *key)
{
unsigned int i, j, k;
@ -458,8 +459,8 @@ static void arc4_set_key(struct arc4_ctx *ctx, unsigned length,
ctx->i = ctx->j = 0;
}
static void arc4_crypt(struct arc4_ctx *ctx, unsigned length, uint8_t *dst,
const uint8_t *src)
static void arc4_crypt(struct arc4_ctx *ctx, unsigned int length,
uint8_t *dst, const uint8_t *src)
{
uint8_t i, j;
@ -470,7 +471,7 @@ static void arc4_crypt(struct arc4_ctx *ctx, unsigned length, uint8_t *dst,
SWAP(ctx->S[i], ctx->S[j]);
if (!dst || !src)
continue;
*dst++ = *src++ ^ ctx->S[ (ctx->S[i] + ctx->S[j]) & 0xff ];
*dst++ = *src++ ^ ctx->S[(ctx->S[i] + ctx->S[j]) & 0xff];
}
ctx->i = i; ctx->j = j;
}

View File

@ -155,7 +155,7 @@ struct dpp_configuration *dpp_parse_configuration_object(const char *json,
JSON_UNDEFINED))
goto free_contents;
if (!ssid || !util_ssid_is_utf8(strlen(ssid),(const uint8_t *)ssid))
if (!ssid || !util_ssid_is_utf8(strlen(ssid), (const uint8_t *) ssid))
goto free_contents;
if (!json_iter_parse(&cred,

View File

@ -475,8 +475,8 @@ static bool eap_peap_tunnel_ready(struct eap_state *eap,
/*
* PEAPv1: draft-josefsson-pppext-eap-tls-eap-05, Section 2.1.1
*
* Cleartext Success/Failure packets MUST be silently discarded once TLS
* tunnel has been brought up.
* Cleartext Success/Failure packets MUST be silently discarded once
* TLS tunnel has been brought up.
*/
eap_discard_success_and_failure(eap, true);

View File

@ -223,7 +223,7 @@ static uint8_t *encrypted_settings_decrypt(struct eap_wsc_state *wsc,
*
* Account for the IV being in the beginning 16 bytes
*/
if (len < 16 )
if (len < 16)
return NULL;
encrypted_len = len - 16;

View File

@ -726,10 +726,10 @@ static bool frame_watch_remove_by_handler(uint64_t wdev_id, uint32_t group_id,
frame_watch_cb_t handler,
void *user_data)
{
struct watch_group_match_info group_info =
{ group_id == 0 ? 0 : wdev_id, group_id };
struct frame_watch_handler_check_info handler_info =
{ wdev_id, handler, user_data };
struct watch_group_match_info group_info = {
group_id == 0 ? 0 : wdev_id, group_id };
struct frame_watch_handler_check_info handler_info = {
wdev_id, handler, user_data };
struct watch_group *group = l_queue_find(watch_groups,
frame_watch_group_match,
&group_info);

View File

@ -640,7 +640,8 @@ static int ft_rx_authenticate(struct auth_proto *ap, const uint8_t *frame,
* FT Protocol.
*/
if (!ft_parse_authentication_resp_frame(frame, frame_len, ft->hs->spa,
ft->hs->aa, ft->hs->aa, 2, &status_code,
ft->hs->aa, ft->hs->aa,
2, &status_code,
&ies, &ies_len))
goto auth_error;

View File

@ -44,7 +44,7 @@
#include "src/erp.h"
#include "src/band.h"
static inline unsigned int n_ecc_groups()
static inline unsigned int n_ecc_groups(void)
{
const unsigned int *groups = l_ecc_supported_ike_groups();
unsigned int j = 0;

View File

@ -923,7 +923,7 @@ static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui,
memcpy((data), (oui), 3); \
(data)[3] = (id); \
return true; \
} while(0)
} while (0)
/* 802.11-2016, Section 9.4.2.25.3 */
static bool ie_build_rsn_akm_suite(uint8_t *data, enum ie_rsn_akm_suite suite)

View File

@ -302,7 +302,7 @@ bool json_iter_get_int(struct json_iter *iter, int *i)
{
void *ptr;
size_t len;
long int r;
long r;
int t;
char *endp;
@ -328,7 +328,7 @@ bool json_iter_get_uint(struct json_iter *iter, unsigned int *i)
{
void *ptr;
size_t len;
unsigned long int r;
unsigned long r;
unsigned int t;
char *endp;

View File

@ -265,7 +265,7 @@ static void print_koption(const void *key, void *value, void *user_data)
#define ADD_OPTIONAL(opt) \
l_hashmap_replace(optional, opt, &r, NULL)
static int check_crypto()
static int check_crypto(void)
{
int r = 0;
struct l_hashmap *options = l_hashmap_string_new();

View File

@ -196,7 +196,7 @@ static void manager_create_interfaces(struct wiphy_setup_state *state)
struct l_genl_msg *msg;
char ifname[10];
uint32_t iftype;
unsigned cmd_id;
unsigned int cmd_id;
if (state->aborted)
return;
@ -341,7 +341,7 @@ static void manager_get_interface_cb(struct l_genl_msg *msg, void *user_data)
uint64_t wdev;
const char *ifname;
struct l_genl_msg *del_msg;
unsigned cmd_id;
unsigned int cmd_id;
char *pattern;
unsigned int i;
bool whitelisted = false, blacklisted = false;
@ -703,7 +703,7 @@ static void manager_config_notify(struct l_genl_msg *msg, void *user_data)
case NL80211_CMD_NEW_INTERFACE:
/*
* Interfaces are normally dumped on the NEW_WIPHY events and
* and we have nothing to do here. But check if by any chance
* we have nothing to do here. But check if by any chance
* we've queried this wiphy and it was still busy initialising,
* in that case retry the setup now that an interface, likely
* the initial default one, has been added.

View File

@ -364,6 +364,7 @@ static bool validate_mgmt_ies(const uint8_t *ies, size_t ies_len,
while (ie_tlv_iter_next(&iter)) {
int i = 0;
tag = ie_tlv_iter_get_tag(&iter);
/* Check that the tag is part of the valid set */

View File

@ -2912,7 +2912,6 @@ process_resp_ies:
HANDSHAKE_EVENT_SETTING_KEYS);
netdev_connect_ok(netdev);
return;
error:

View File

@ -562,6 +562,7 @@ static int scan_request_send_trigger(struct scan_context *sc,
struct scan_request *sr)
{
struct l_genl_msg *cmd = l_queue_peek_head(sr->cmds);
if (!cmd)
return -ENOMSG;
@ -2087,7 +2088,7 @@ static int scan_init(void)
return 0;
}
static void scan_exit()
static void scan_exit(void)
{
l_queue_destroy(scan_contexts,
(l_queue_destroy_func_t) scan_context_free);

View File

@ -1105,7 +1105,7 @@ build_ie:
* any offload features are detected (since IWD prefers to use offload).
*/
info.ocvc = !disable_ocv && bss_info.ocvc && info.mfpc &&
!wiphy_can_offload(wiphy);;
!wiphy_can_offload(wiphy);
/*
* IEEE 802.11-2020 9.4.2.24.4 states extended key IDs can only be used
@ -1887,8 +1887,8 @@ static void station_ft_ds_action_start(struct station *station)
continue;
/*
* Fire and forget. Netdev will maintain a cache of responses and
* when the time comes these can be referenced for a roam
* Fire and forget. Netdev will maintain a cache of responses
* and when the time comes these can be referenced for a roam
*/
netdev_fast_transition_over_ds_action(station->netdev, bss);
}
@ -2601,7 +2601,7 @@ static void station_ap_directed_roam(struct station *station,
pos += 12;
}
if (req_mode & WNM_REQUEST_MODE_ESS_DISASSOCIATION_IMMINENT ) {
if (req_mode & WNM_REQUEST_MODE_ESS_DISASSOCIATION_IMMINENT) {
uint8_t url_len;
if (pos + 1 > body_len)
@ -2625,7 +2625,7 @@ static void station_ap_directed_roam(struct station *station,
if (req_mode & WNM_REQUEST_MODE_PREFERRED_CANDIDATE_LIST) {
l_debug("roam: AP sent a preferred candidate list");
station_neighbor_report_cb(station->netdev, 0, body + pos,
body_len - pos,station);
body_len - pos, station);
} else {
l_debug("roam: AP did not include a preferred candidate list");
if (station_roam_scan(station, NULL) < 0)

View File

@ -39,7 +39,7 @@
const char *util_ssid_to_utf8(size_t len, const uint8_t *ssid)
{
static char buf[3* 32 + 1];
static char buf[3 * 32 + 1];
size_t i = 0, pos = 0;
const uint8_t *start = ssid, *end;

View File

@ -918,6 +918,7 @@ static void wiphy_print_band_info(struct band *band, const char *name)
if (band->ht_supported) {
uint8_t max_nss = bit_field(band->ht_mcs_set[12], 2, 2) + 1;
l_info("\t\tHT Capabilities:");
if (test_bit(band->ht_capabilities, 1))

View File

@ -1751,6 +1751,7 @@ static uint8_t *wsc_attr_builder_free(struct wsc_attr_builder *builder,
if (builder->curlen > 0) {
uint8_t *bytes = builder->buf + builder->offset;
l_put_be16(builder->curlen - 4, bytes + 2);
builder->offset += builder->curlen;
builder->curlen = 0;