Skip to content

Commit

Permalink
staging: csr: remove CsrInt16 typedef
Browse files Browse the repository at this point in the history
Use the in-kernel s16 type instead.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2012
1 parent 8c87f69 commit ab2b8c7
Show file tree
Hide file tree
Showing 22 changed files with 136 additions and 137 deletions.
1 change: 0 additions & 1 deletion drivers/staging/csr/csr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ typedef ptrdiff_t CsrIntptr; /* intptr_t is not defined in kernel. Use the eq
typedef uint32_t CsrUint32;

/* Signed fixed width types */
typedef int16_t CsrInt16;
typedef int32_t CsrInt32;

/* Boolean */
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/csr/csr_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ CsrCharString *CsrStrNCpyZero(CsrCharString *dest,
/* Convert string with base 10 to integer */
CsrUint32 CsrStrToInt(const CsrCharString *str)
{
CsrInt16 i;
s16 i;
CsrUint32 res;
CsrUint32 digit;

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/csr/csr_wifi_hip_card.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ CsrResult CardWriteBulkData(card_t *card, card_signal_t *csptr, unifi_TrafficQue
/*****************************************************************************
* CardClearFromHostDataSlot -
*/
void CardClearFromHostDataSlot(card_t *card, const CsrInt16 aSlotNum);
void CardClearFromHostDataSlot(card_t *card, const s16 aSlotNum);

#ifdef CSR_WIFI_REQUEUE_PACKET_TO_HAL
/*****************************************************************************
* CardClearFromHostDataSlotWithoutFreeingBulkData - Clear the data stot
* without freeing the bulk data
*/

void CardClearFromHostDataSlotWithoutFreeingBulkData(card_t *card, const CsrInt16 aSlotNum);
void CardClearFromHostDataSlotWithoutFreeingBulkData(card_t *card, const s16 aSlotNum);
#endif

/*****************************************************************************
Expand Down
38 changes: 19 additions & 19 deletions drivers/staging/csr/csr_wifi_hip_card_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static CsrResult unifi_hip_init(card_t *card)
static void _build_sdio_config_data(sdio_config_data_t *cfg_data,
const u8 *cfg_data_buf)
{
CsrInt16 offset = 0;
s16 offset = 0;

cfg_data->version = CSR_GET_UINT16_FROM_LITTLE_ENDIAN(cfg_data_buf + offset);
offset += SIZEOF_UINT16;
Expand Down Expand Up @@ -606,8 +606,8 @@ static CsrResult card_hw_init(card_t *card)
u8 cfg_data_buf[SDIO_CONFIG_DATA_SIZE];
CsrResult r;
void *dlpriv;
CsrInt16 major, minor;
CsrInt16 search_4slut_again;
s16 major, minor;
s16 search_4slut_again;
CsrResult csrResult;

func_enter();
Expand Down Expand Up @@ -1000,7 +1000,7 @@ static CsrResult card_hw_init(card_t *card)
*/
static CsrResult card_wait_for_unifi_to_reset(card_t *card)
{
CsrInt16 i;
s16 i;
CsrResult r;
u8 io_enable;
CsrResult csrResult;
Expand Down Expand Up @@ -1052,7 +1052,7 @@ static CsrResult card_wait_for_unifi_to_reset(card_t *card)
if (r == CSR_RESULT_SUCCESS)
{
u16 mbox2;
CsrInt16 enabled = io_enable & (1 << card->function);
s16 enabled = io_enable & (1 << card->function);

if (!enabled)
{
Expand Down Expand Up @@ -1132,7 +1132,7 @@ static CsrResult card_wait_for_unifi_to_reset(card_t *card)
*/
static CsrResult card_wait_for_unifi_to_disable(card_t *card)
{
CsrInt16 i;
s16 i;
CsrResult r;
u8 io_enable;
CsrResult csrResult;
Expand Down Expand Up @@ -1178,7 +1178,7 @@ static CsrResult card_wait_for_unifi_to_disable(card_t *card)
}
if (csrResult == CSR_RESULT_SUCCESS)
{
CsrInt16 enabled = io_enable & (1 << card->function);
s16 enabled = io_enable & (1 << card->function);
r = CSR_RESULT_SUCCESS;
if (!enabled)
{
Expand Down Expand Up @@ -1605,7 +1605,7 @@ void unifi_read_panic(card_t *card)
*/
static CsrResult card_allocate_memory_resources(card_t *card)
{
CsrInt16 n, i, k, r;
s16 n, i, k, r;
sdio_config_data_t *cfg_data;

func_enter();
Expand Down Expand Up @@ -1837,7 +1837,7 @@ static void card_free_memory_resources(card_t *card)

static void card_init_soft_queues(card_t *card)
{
CsrInt16 i;
s16 i;

func_enter();

Expand Down Expand Up @@ -1876,7 +1876,7 @@ static void card_init_soft_queues(card_t *card)
*/
void unifi_cancel_pending_signals(card_t *card)
{
CsrInt16 i, n, r;
s16 i, n, r;
func_enter();

unifi_trace(card->ospriv, UDBG1, "Canceling pending signals.\n");
Expand Down Expand Up @@ -2059,7 +2059,7 @@ static CsrResult card_init_slots(card_t *card)
func_exit_r(r);
return r;
}
card->from_host_signals_w = (CsrInt16)s;
card->from_host_signals_w = (s16)s;

/* Get the to-host-signals-written count */
r = unifi_card_read16(card, card->sdio_ctrl_addr + 6, &s);
Expand All @@ -2073,7 +2073,7 @@ static CsrResult card_init_slots(card_t *card)
func_exit_r(r);
return r;
}
card->to_host_signals_r = (CsrInt16)s;
card->to_host_signals_r = (s16)s;
}

/* Set Initialised flag. */
Expand Down Expand Up @@ -2350,7 +2350,7 @@ static void CardCheckDynamicReservation(card_t *card, unifi_TrafficQueue queue)
* None.
* ---------------------------------------------------------------------------
*/
void CardClearFromHostDataSlot(card_t *card, const CsrInt16 slot)
void CardClearFromHostDataSlot(card_t *card, const s16 slot)
{
u8 queue = card->from_host_data[slot].queue;
const void *os_data_ptr = card->from_host_data[slot].bd.os_data_ptr;
Expand Down Expand Up @@ -2417,7 +2417,7 @@ void CardClearFromHostDataSlot(card_t *card, const CsrInt16 slot)
* None.
* ---------------------------------------------------------------------------
*/
void CardClearFromHostDataSlotWithoutFreeingBulkData(card_t *card, const CsrInt16 slot)
void CardClearFromHostDataSlotWithoutFreeingBulkData(card_t *card, const s16 slot)
{
u8 queue = card->from_host_data[slot].queue;

Expand Down Expand Up @@ -3405,7 +3405,7 @@ CsrResult CardWriteBulkData(card_t *card, card_signal_t *csptr, unifi_TrafficQue
u16 i, slots[UNIFI_MAX_DATA_REFERENCES], j = 0;
u8 *packed_sigptr, num_slots_required = 0;
bulk_data_desc_t *bulkdata = csptr->bulkdata;
CsrInt16 h, nslots;
s16 h, nslots;

func_enter();

Expand Down Expand Up @@ -3562,9 +3562,9 @@ CsrResult CardWriteBulkData(card_t *card, card_signal_t *csptr, unifi_TrafficQue
* Pointer to entry in bulk_data_slot array.
* ---------------------------------------------------------------------------
*/
bulk_data_desc_t* card_find_data_slot(card_t *card, CsrInt16 slot)
bulk_data_desc_t* card_find_data_slot(card_t *card, s16 slot)
{
CsrInt16 sn;
s16 sn;
bulk_data_desc_t *bd;

sn = slot & 0x7FFF;
Expand Down Expand Up @@ -3705,7 +3705,7 @@ CsrResult unifi_card_stop_processor(card_t *card, enum unifi_dbg_processors_sele
{
CsrResult r = CSR_RESULT_SUCCESS;
u8 status;
CsrInt16 retry = 100;
s16 retry = 100;

while (retry--)
{
Expand Down Expand Up @@ -4103,7 +4103,7 @@ CsrResult unifi_check_io_status(card_t *card, CsrInt32 *status)
void unifi_get_hip_qos_info(card_t *card, unifi_HipQosInfo *hipqosinfo)
{
CsrInt32 count_fhr;
CsrInt16 t;
s16 t;
CsrUint32 occupied_fh;

q_t *sigq;
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/csr/csr_wifi_hip_card_sdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ struct card
* This is an optimisation that starts searching at a more likely point
* than the beginning.
*/
CsrInt16 from_host_data_head;
s16 from_host_data_head;

/* Dynamic slot allocation for queues */
card_dynamic_slot_t dynamic_slot_data;
Expand Down Expand Up @@ -577,7 +577,7 @@ struct card
#endif

/* Auto-coredump */
CsrInt16 request_coredump_on_reset; /* request coredump on next reset */
s16 request_coredump_on_reset; /* request coredump on next reset */
struct coredump_buf *dump_buf; /* root node */
struct coredump_buf *dump_next_write; /* node to fill at next dump */
struct coredump_buf *dump_cur_read; /* valid node to read, or NULL */
Expand Down Expand Up @@ -654,7 +654,7 @@ CsrResult unifi_set_host_state(card_t *card, enum unifi_host_state state);

CsrResult unifi_set_proc_select(card_t *card, enum unifi_dbg_processors_select select);
CsrInt32 card_read_signal_counts(card_t *card);
bulk_data_desc_t* card_find_data_slot(card_t *card, CsrInt16 slot);
bulk_data_desc_t* card_find_data_slot(card_t *card, s16 slot);


CsrResult unifi_read32(card_t *card, CsrUint32 unifi_addr, CsrUint32 *pdata);
Expand All @@ -665,9 +665,9 @@ CsrInt32 unifi_read_shared_count(card_t *card, CsrUint32 addr);
CsrResult unifi_writen(card_t *card, CsrUint32 unifi_addr, void *pdata, u16 len);

CsrResult unifi_bulk_rw(card_t *card, CsrUint32 handle,
void *pdata, CsrUint32 len, CsrInt16 direction);
void *pdata, CsrUint32 len, s16 direction);
CsrResult unifi_bulk_rw_noretry(card_t *card, CsrUint32 handle,
void *pdata, CsrUint32 len, CsrInt16 direction);
void *pdata, CsrUint32 len, s16 direction);
#define UNIFI_SDIO_READ 0
#define UNIFI_SDIO_WRITE 1

Expand Down
36 changes: 18 additions & 18 deletions drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed);

static CsrResult process_bulk_data_command(card_t *card,
const u8 *cmdptr,
CsrInt16 cmd, u16 len);
s16 cmd, u16 len);
static CsrResult process_clear_slot_command(card_t *card,
const u8 *cmdptr);
static CsrResult process_fh_cmd_queue(card_t *card, CsrInt32 *processed);
Expand All @@ -63,7 +63,7 @@ static void restart_packet_flow(card_t *card);
static CsrResult process_clock_request(card_t *card);

#ifdef CSR_WIFI_HIP_NOISY
CsrInt16 dump_fh_buf = 0;
s16 dump_fh_buf = 0;
#endif /* CSR_WIFI_HIP_NOISY */

#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
Expand Down Expand Up @@ -1054,7 +1054,7 @@ static CsrResult read_to_host_signals(card_t *card, CsrInt32 *processed)
* CSR_RESULT_SUCCESS on success or CSR error code
* ---------------------------------------------------------------------------
*/
static CsrResult update_to_host_signals_r(card_t *card, CsrInt16 pending)
static CsrResult update_to_host_signals_r(card_t *card, s16 pending)
{
CsrResult r;

Expand Down Expand Up @@ -1100,7 +1100,7 @@ static CsrResult update_to_host_signals_r(card_t *card, CsrInt16 pending)
*/
static void read_unpack_cmd(const u8 *ptr, bulk_data_cmd_t *bulk_data_cmd)
{
CsrInt16 index = 0;
s16 index = 0;
bulk_data_cmd->cmd_and_len = CSR_GET_UINT16_FROM_LITTLE_ENDIAN(ptr + index);
index += SIZEOF_UINT16;
bulk_data_cmd->data_slot = CSR_GET_UINT16_FROM_LITTLE_ENDIAN(ptr + index);
Expand Down Expand Up @@ -1145,13 +1145,13 @@ static void read_unpack_cmd(const u8 *ptr, bulk_data_cmd_t *bulk_data_cmd)
*/
static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed)
{
CsrInt16 pending;
CsrInt16 remaining;
s16 pending;
s16 remaining;
u8 *bufptr;
bulk_data_param_t data_ptrs;
CsrInt16 cmd;
s16 cmd;
u16 sig_len;
CsrInt16 i;
s16 i;
u16 chunks_in_buf;
u16 bytes_transferred = 0;
CsrResult r = CSR_RESULT_SUCCESS;
Expand All @@ -1177,7 +1177,7 @@ static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed)

while (pending > 0)
{
CsrInt16 f_flush_count = 0;
s16 f_flush_count = 0;

/*
* Command and length are common to signal and bulk data msgs.
Expand Down Expand Up @@ -1257,7 +1257,7 @@ static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed)
if (data_len != 0)
{
/* Retrieve dataRefs[i].SlotNumber */
CsrInt16 slot = GET_PACKED_DATAREF_SLOT(bufptr + 2, i);
s16 slot = GET_PACKED_DATAREF_SLOT(bufptr + 2, i);

if (slot >= card->config_data.num_tohost_data_slots)
{
Expand Down Expand Up @@ -1372,7 +1372,7 @@ static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed)
/* The slot is only valid if the length is non-zero. */
if (GET_PACKED_DATAREF_LEN(bufptr + 2, i) != 0)
{
CsrInt16 slot = GET_PACKED_DATAREF_SLOT(bufptr + 2, i);
s16 slot = GET_PACKED_DATAREF_SLOT(bufptr + 2, i);
if (slot < card->config_data.num_tohost_data_slots)
{
UNIFI_INIT_BULK_DATA(&card->to_host_data[slot]);
Expand Down Expand Up @@ -1546,7 +1546,7 @@ static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed)
static CsrResult process_clear_slot_command(card_t *card, const u8 *cmdptr)
{
u16 data_slot;
CsrInt16 slot;
s16 slot;

data_slot = CSR_GET_UINT16_FROM_LITTLE_ENDIAN(cmdptr + SIZEOF_UINT16);

Expand Down Expand Up @@ -1619,16 +1619,16 @@ static CsrResult process_clear_slot_command(card_t *card, const u8 *cmdptr)
* ---------------------------------------------------------------------------
*/
static CsrResult process_bulk_data_command(card_t *card, const u8 *cmdptr,
CsrInt16 cmd, u16 len)
s16 cmd, u16 len)
{
bulk_data_desc_t *bdslot;
#ifdef CSR_WIFI_ALIGNMENT_WORKAROUND
u8 *host_bulk_data_slot;
#endif
bulk_data_cmd_t bdcmd;
CsrInt16 offset;
CsrInt16 slot;
CsrInt16 dir;
s16 offset;
s16 slot;
s16 dir;
CsrResult r;

read_unpack_cmd(cmdptr, &bdcmd);
Expand Down Expand Up @@ -2029,7 +2029,7 @@ static CsrResult process_fh_cmd_queue(card_t *card, CsrInt32 *processed)
while (pending_sigs-- && pending_chunks > 0)
{
card_signal_t *csptr;
CsrInt16 i;
s16 i;
u16 sig_chunks, total_length, free_chunks_in_fh_buffer;
bulk_data_param_t bulkdata;
u8 *packed_sigptr;
Expand Down Expand Up @@ -2173,7 +2173,7 @@ static CsrResult process_fh_traffic_queue(card_t *card, CsrInt32 *processed)
q_t *sigq = card->fh_traffic_queue;

CsrResult r;
CsrInt16 n = 0;
s16 n = 0;
CsrInt32 q_no;
u16 pending_sigs = 0;
u16 pending_chunks = 0;
Expand Down
Loading

0 comments on commit ab2b8c7

Please sign in to comment.