[PATCH 1/6] keucr: remove some unneccesary typedefs

From: Johannes Schilling
Date: Thu Jun 06 2013 - 12:11:56 EST


resolves checkpatch.pl warning "do not add new typedefs" and renames allcaps
structures.

Signed-off-by: Laura Lawniczak <laura.lawniczak@xxxxxxxxxxxxxx>
Signed-off-by: Johannes Schilling <of82ecuq@xxxxxxxxxxxxx>
---
drivers/staging/keucr/init.c | 2 +-
drivers/staging/keucr/smil.h | 28 ++++++----------------------
drivers/staging/keucr/smilsub.c | 6 +++---
drivers/staging/keucr/usb.c | 4 ++--
drivers/staging/keucr/usb.h | 18 +++++++++---------
5 files changed, 21 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/keucr/init.c b/drivers/staging/keucr/init.c
index cb50eb2..ce25405 100644
--- a/drivers/staging/keucr/init.c
+++ b/drivers/staging/keucr/init.c
@@ -89,7 +89,7 @@ int ENE_SMInit(struct us_data *us)
return USB_STOR_TRANSPORT_ERROR;
}

- us->SM_Status = *(PSM_STATUS)&buf[0];
+ us->SM_Status = *(struct keucr_sm_status *)&buf[0];

us->SM_DeviceID = buf[1];
us->SM_CardID = buf[2];
diff --git a/drivers/staging/keucr/smil.h b/drivers/staging/keucr/smil.h
index 24a636a..1538d7b 100644
--- a/drivers/staging/keucr/smil.h
+++ b/drivers/staging/keucr/smil.h
@@ -168,7 +168,7 @@ SmartMedia Model & Attribute
/***************************************************************************
Struct Definition
***************************************************************************/
-struct SSFDCTYPE {
+struct keucr_media_info {
BYTE Model;
BYTE Attribute;
BYTE MaxZones;
@@ -177,30 +177,14 @@ struct SSFDCTYPE {
WORD MaxLogBlocks;
};

-typedef struct SSFDCTYPE_T {
- BYTE Model;
- BYTE Attribute;
- BYTE MaxZones;
- BYTE MaxSectors;
- WORD MaxBlocks;
- WORD MaxLogBlocks;
-} *SSFDCTYPE_T;
-
-struct ADDRESS {
+struct keucr_media_address {
BYTE Zone; /* Zone Number */
BYTE Sector; /* Sector(512byte) Number on Block */
WORD PhyBlock; /* Physical Block Number on Zone */
WORD LogBlock; /* Logical Block Number of Zone */
};

-typedef struct ADDRESS_T {
- BYTE Zone; /* Zone Number */
- BYTE Sector; /* Sector(512byte) Number on Block */
- WORD PhyBlock; /* Physical Block Number on Zone */
- WORD LogBlock; /* Logical Block Number of Zone */
-} *ADDRESS_T;
-
-struct CIS_AREA {
+struct keucr_media_area {
BYTE Sector; /* Sector(512byte) Number on Block */
WORD PhyBlock; /* Physical Block Number on Zone 0 */
};
@@ -215,9 +199,9 @@ extern WORD ReadBlock;
extern WORD WriteBlock;
extern DWORD MediaChange;

-extern struct SSFDCTYPE Ssfdc;
-extern struct ADDRESS Media;
-extern struct CIS_AREA CisArea;
+extern struct keucr_media_info Ssfdc;
+extern struct keucr_media_address Media;
+extern struct keucr_media_area CisArea;

/*
* SMILMain.c
diff --git a/drivers/staging/keucr/smilsub.c b/drivers/staging/keucr/smilsub.c
index b10e8c2..815be93 100644
--- a/drivers/staging/keucr/smilsub.c
+++ b/drivers/staging/keucr/smilsub.c
@@ -33,9 +33,9 @@ void _Set_D_ECCdata(BYTE, BYTE *);
void _Calc_D_ECCdata(BYTE *);


-struct SSFDCTYPE Ssfdc;
-struct ADDRESS Media;
-struct CIS_AREA CisArea;
+struct keucr_media_info Ssfdc;
+struct keucr_media_address Media;
+struct keucr_media_area CisArea;

static BYTE EccBuf[6];
extern PBYTE SMHostAddr;
diff --git a/drivers/staging/keucr/usb.c b/drivers/staging/keucr/usb.c
index 0608a5c..f18b1c2 100644
--- a/drivers/staging/keucr/usb.c
+++ b/drivers/staging/keucr/usb.c
@@ -65,7 +65,7 @@ static int eucr_resume(struct usb_interface *iface)

us->Power_IsResum = true;

- us->SM_Status = *(PSM_STATUS)&tmp;
+ us->SM_Status = *(struct keucr_sm_status *)&tmp;

return 0;
}
@@ -87,7 +87,7 @@ static int eucr_reset_resume(struct usb_interface *iface)

us->Power_IsResum = true;

- us->SM_Status = *(PSM_STATUS)&tmp;
+ us->SM_Status = *(struct keucr_sm_status *)&tmp;

return 0;
}
diff --git a/drivers/staging/keucr/usb.h b/drivers/staging/keucr/usb.h
index 2dc75b0..c724cf7 100644
--- a/drivers/staging/keucr/usb.h
+++ b/drivers/staging/keucr/usb.h
@@ -51,7 +51,7 @@ struct us_unusual_dev {
#define FDIR_WRITE 0
#define FDIR_READ 1

-typedef struct _SD_STATUS {
+struct keucr_sd_status {
BYTE Insert:1;
BYTE Ready:1;
BYTE MediaChange:1;
@@ -60,9 +60,9 @@ typedef struct _SD_STATUS {
BYTE HiSpeed:1;
BYTE WtP:1;
BYTE Reserved:1;
-} SD_STATUS, *PSD_STATUS;
+};

-typedef struct _MS_STATUS {
+struct keucr_ms_status {
BYTE Insert:1;
BYTE Ready:1;
BYTE MediaChange:1;
@@ -71,16 +71,16 @@ typedef struct _MS_STATUS {
BYTE Reserved1:1;
BYTE WtP:1;
BYTE Reserved2:1;
-} MS_STATUS, *PMS_STATUS;
+};

-typedef struct _SM_STATUS {
+struct keucr_sm_status {
BYTE Insert:1;
BYTE Ready:1;
BYTE MediaChange:1;
BYTE Reserved:3;
BYTE WtP:1;
BYTE IsMS:1;
-} SM_STATUS, *PSM_STATUS;
+};

/* SD Block Length */
#define SD_BLOCK_LEN 9 /* 2^9 = 512 Bytes,
@@ -178,9 +178,9 @@ struct us_data {
pm_hook suspend_resume_hook;
#endif
/* for 6250 code */
- SD_STATUS SD_Status;
- MS_STATUS MS_Status;
- SM_STATUS SM_Status;
+ struct keucr_sd_status SD_Status;
+ struct keucr_ms_status MS_Status;
+ struct keucr_sm_status SM_Status;

/* ----- SD Control Data ---------------- */
/* SD_REGISTER SD_Regs; */
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/