Skip to contentSkip to conversation

siano: get rid of CammelCase from smscoreapi.h

PATCH In review Mauro Carvalho Chehab 2 participants 10 messages Mar 21, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 siano: get rid of CammelCase from smscoreapi.h

It is almost impossible to see a compliant with checkpatch.pl on those Siano drivers, as there are simply too much violations on it. So, now that a big change was done, the better is to cleanup the checkpatch compliants.

Let's first replace all CammelCase symbols found at smscoreapi.h using camel_case namespace. That removed 144 checkpatch.pl compliants on this file. Of course, the other files need to be fixed accordingly.

---
 drivers/media/common/siano/sms-cards.c      |  12 +-
 drivers/media/common/siano/smscoreapi.c     | 336 +++++++++++-----------
 drivers/media/common/siano/smscoreapi.h     | 420 ++++++++++++++--------------
 drivers/media/common/siano/smsdvb-debugfs.c | 230 +++++++--------
 drivers/media/common/siano/smsdvb-main.c    | 250 ++++++++---------
 drivers/media/common/siano/smsdvb.h         |  32 +--
 drivers/media/common/siano/smsendian.c      |  30 +-
 drivers/media/mmc/siano/smssdio.c           |  18 +-
 drivers/media/usb/siano/smsusb.c            |  40 +--
 9 files changed, 684 insertions(+), 684 deletions(-)
drivers/media/common/siano/sms-cards.c +6 -6
index 6680134..9bd7aa1 100644
@@ -167,13 +167,13 @@ struct sms_board *sms_get_board(unsigned id)
 }
 EXPORT_SYMBOL_GPL(sms_get_board);
 static inline void sms_gpio_assign_11xx_default_led_config(
-		struct smscore_config_gpio *pGpioConfig) {
-	pGpioConfig->direction = SMS_GPIO_DIRECTION_OUTPUT;
-	pGpioConfig->inputcharacteristics =
+		struct smscore_config_gpio *p_gpio_config) {
+	p_gpio_config->direction = SMS_GPIO_DIRECTION_OUTPUT;
+	p_gpio_config->inputcharacteristics =
 		SMS_GPIO_INPUTCHARACTERISTICS_NORMAL;
-	pGpioConfig->outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA;
-	pGpioConfig->outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS;
-	pGpioConfig->pullupdown = SMS_GPIO_PULLUPDOWN_NONE;
+	p_gpio_config->outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA;
+	p_gpio_config->outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS;
+	p_gpio_config->pullupdown = SMS_GPIO_PULLUPDOWN_NONE;
 }
 
 int sms_board_event(struct smscore_device_t *coredev,
drivers/media/common/siano/smscoreapi.c +168 -168

673 lines not on this page · raw message

drivers/media/common/siano/smscoreapi.h +210 -210

657 lines not on this page · raw message

drivers/media/common/siano/smsdvb-debugfs.c +115 -115

346 lines not on this page · raw message

drivers/media/common/siano/smsdvb-main.c +125 -125

491 lines not on this page · raw message

drivers/media/common/siano/smsdvb.h +16 -16
index 63cdd75..e1ff07c 100644
@@ -57,7 +57,7 @@ struct smsdvb_client_t {
 	int			feed_users;
 	bool			has_tuned;
 
-	/* Stats debugfs data */
+	/* stats debugfs data */
 	struct dentry		*debugfs;
 
 	struct smsdvb_debugfs	*debug_data;
@@ -74,30 +74,30 @@ struct smsdvb_client_t {
 struct RECEPTION_STATISTICS_PER_SLICES_S {
 	u32 result;
 	u32 snr;
-	s32 inBandPower;
-	u32 tsPackets;
-	u32 etsPackets;
+	s32 in_band_power;
+	u32 ts_packets;
+	u32 ets_packets;
 	u32 constellation;
-	u32 hpCode;
-	u32 tpsSrvIndLP;
-	u32 tpsSrvIndHP;
-	u32 cellId;
+	u32 hp_code;
+	u32 tps_srv_ind_lp;
+	u32 tps_srv_ind_hp;
+	u32 cell_id;
 	u32 reason;
-	u32 requestId;
-	u32 ModemState;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
+	u32 request_id;
+	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
 
 	u32 BER;		/* Post Viterbi BER [1E-5] */
 	s32 RSSI;		/* dBm */
-	s32 CarrierOffset;	/* Carrier Offset in bin/1024 */
+	s32 carrier_offset;	/* Carrier Offset in bin/1024 */
 
-	u32 IsRfLocked;		/* 0 - not locked, 1 - locked */
-	u32 IsDemodLocked;	/* 0 - not locked, 1 - locked */
+	u32 is_rf_locked;		/* 0 - not locked, 1 - locked */
+	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
 
-	u32 BERBitCount;	/* Total number of SYNC bits. */
-	u32 BERErrorCount;	/* Number of erronous SYNC bits. */
+	u32 ber_bit_count;	/* Total number of SYNC bits. */
+	u32 ber_error_count;	/* Number of erronous SYNC bits. */
 
 	s32 MRC_SNR;		/* dB */
-	s32 MRC_InBandPwr;	/* In band power in dBM */
+	s32 mrc_in_band_pwr;	/* In band power in dBM */
 	s32 MRC_RSSI;		/* dBm */
 };
 
drivers/media/common/siano/smsendian.c +15 -15
index e2657c2..32a7b28 100644
@@ -28,11 +28,11 @@
 void smsendian_handle_tx_message(void *buffer)
 {
 #ifdef __BIG_ENDIAN
-	struct SmsMsgData_ST *msg = (struct SmsMsgData_ST *)buffer;
+	struct sms_msg_data *msg = (struct sms_msg_data *)buffer;
 	int i;
 	int msgWords;
 
-	switch (msg->xMsgHeader.msgType) {
+	switch (msg->x_msg_header.msg_type) {
 	case MSG_SMS_DATA_DOWNLOAD_REQ:
 	{
 		msg->msgData[0] = le32_to_cpu(msg->msgData[0]);
@@ -40,8 +40,8 @@ void smsendian_handle_tx_message(void *buffer)
 	}
 
 	default:
-		msgWords = (msg->xMsgHeader.msgLength -
-				sizeof(struct SmsMsgHdr_ST))/4;
+		msgWords = (msg->x_msg_header.msg_length -
+				sizeof(struct sms_msg_hdr))/4;
 
 		for (i = 0; i < msgWords; i++)
 			msg->msgData[i] = le32_to_cpu(msg->msgData[i]);
@@ -55,16 +55,16 @@ EXPORT_SYMBOL_GPL(smsendian_handle_tx_message);
 void smsendian_handle_rx_message(void *buffer)
 {
 #ifdef __BIG_ENDIAN
-	struct SmsMsgData_ST *msg = (struct SmsMsgData_ST *)buffer;
+	struct sms_msg_data *msg = (struct sms_msg_data *)buffer;
 	int i;
 	int msgWords;
 
-	switch (msg->xMsgHeader.msgType) {
+	switch (msg->x_msg_header.msg_type) {
 	case MSG_SMS_GET_VERSION_EX_RES:
 	{
-		struct SmsVersionRes_ST *ver =
-			(struct SmsVersionRes_ST *) msg;
-		ver->ChipModel = le16_to_cpu(ver->ChipModel);
+		struct sms_version_res *ver =
+			(struct sms_version_res *) msg;
+		ver->chip_model = le16_to_cpu(ver->chip_model);
 		break;
 	}
 
@@ -77,8 +77,8 @@ void smsendian_handle_rx_message(void *buffer)
 
 	default:
 	{
-		msgWords = (msg->xMsgHeader.msgLength -
-				sizeof(struct SmsMsgHdr_ST))/4;
+		msgWords = (msg->x_msg_header.msg_length -
+				sizeof(struct sms_msg_hdr))/4;
 
 		for (i = 0; i < msgWords; i++)
 			msg->msgData[i] = le32_to_cpu(msg->msgData[i]);
@@ -93,11 +93,11 @@ EXPORT_SYMBOL_GPL(smsendian_handle_rx_message);
 void smsendian_handle_message_header(void *msg)
 {
 #ifdef __BIG_ENDIAN
-	struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *)msg;
+	struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg;
 
-	phdr->msgType = le16_to_cpu(phdr->msgType);
-	phdr->msgLength = le16_to_cpu(phdr->msgLength);
-	phdr->msgFlags = le16_to_cpu(phdr->msgFlags);
+	phdr->msg_type = le16_to_cpu(phdr->msg_type);
+	phdr->msg_length = le16_to_cpu(phdr->msg_length);
+	phdr->msg_flags = le16_to_cpu(phdr->msg_flags);
 #endif /* __BIG_ENDIAN */
 }
 EXPORT_SYMBOL_GPL(smsendian_handle_message_header);
drivers/media/mmc/siano/smssdio.c +9 -9
index 8834c43..912c281 100644
@@ -98,7 +98,7 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size)
 
 	sdio_claim_host(smsdev->func);
 
-	smsendian_handle_tx_message((struct SmsMsgData_ST *) buffer);
+	smsendian_handle_tx_message((struct sms_msg_data *) buffer);
 	while (size >= smsdev->func->cur_blksize) {
 		ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA,
 					buffer, smsdev->func->cur_blksize);
@@ -130,7 +130,7 @@ static void smssdio_interrupt(struct sdio_func *func)
 
 	struct smssdio_device *smsdev;
 	struct smscore_buffer_t *cb;
-	struct SmsMsgHdr_ST *hdr;
+	struct sms_msg_hdr *hdr;
 	size_t size;
 
 	smsdev = sdio_get_drvdata(func);
@@ -163,20 +163,20 @@ static void smssdio_interrupt(struct sdio_func *func)
 
 		hdr = cb->p;
 
-		if (hdr->msgFlags & MSG_HDR_FLAG_SPLIT_MSG) {
+		if (hdr->msg_flags & MSG_HDR_FLAG_SPLIT_MSG) {
 			smsdev->split_cb = cb;
 			return;
 		}
 
-		if (hdr->msgLength > smsdev->func->cur_blksize)
-			size = hdr->msgLength - smsdev->func->cur_blksize;
+		if (hdr->msg_length > smsdev->func->cur_blksize)
+			size = hdr->msg_length - smsdev->func->cur_blksize;
 		else
 			size = 0;
 	} else {
 		cb = smsdev->split_cb;
 		hdr = cb->p;
 
-		size = hdr->msgLength - sizeof(struct SmsMsgHdr_ST);
+		size = hdr->msg_length - sizeof(struct sms_msg_hdr);
 
 		smsdev->split_cb = NULL;
 	}
@@ -184,7 +184,7 @@ static void smssdio_interrupt(struct sdio_func *func)
 	if (size) {
 		void *buffer;
 
-		buffer = cb->p + (hdr->msgLength - size);
+		buffer = cb->p + (hdr->msg_length - size);
 		size = ALIGN(size, SMSSDIO_BLOCK_SIZE);
 
 		BUG_ON(smsdev->func->cur_blksize != SMSSDIO_BLOCK_SIZE);
@@ -230,10 +230,10 @@ static void smssdio_interrupt(struct sdio_func *func)
 		}
 	}
 
-	cb->size = hdr->msgLength;
+	cb->size = hdr->msg_length;
 	cb->offset = 0;
 
-	smsendian_handle_rx_message((struct SmsMsgData_ST *) cb->p);
+	smsendian_handle_rx_message((struct sms_msg_data *) cb->p);
 	smscore_onresponse(smsdev->coredev, cb);
 }
 
drivers/media/usb/siano/smsusb.c +20 -20
index 01a0f39..3a290f1 100644
@@ -93,26 +93,26 @@ static void smsusb_onresponse(struct urb *urb)
 	}
 
 	if ((urb->actual_length > 0) && (urb->status == 0)) {
-		struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *)surb->cb->p;
+		struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)surb->cb->p;
 
 		smsendian_handle_message_header(phdr);
-		if (urb->actual_length >= phdr->msgLength) {
-			surb->cb->size = phdr->msgLength;
+		if (urb->actual_length >= phdr->msg_length) {
+			surb->cb->size = phdr->msg_length;
 
 			if (dev->response_alignment &&
-			    (phdr->msgFlags & MSG_HDR_FLAG_SPLIT_MSG)) {
+			    (phdr->msg_flags & MSG_HDR_FLAG_SPLIT_MSG)) {
 
 				surb->cb->offset =
 					dev->response_alignment +
-					((phdr->msgFlags >> 8) & 3);
+					((phdr->msg_flags >> 8) & 3);
 
 				/* sanity check */
-				if (((int) phdr->msgLength +
+				if (((int) phdr->msg_length +
 				     surb->cb->offset) > urb->actual_length) {
 					sms_err("invalid response "
 						"msglen %d offset %d "
 						"size %d",
-						phdr->msgLength,
+						phdr->msg_length,
 						surb->cb->offset,
 						urb->actual_length);
 					goto exit_and_resubmit;
@@ -121,22 +121,22 @@ static void smsusb_onresponse(struct urb *urb)
 				/* move buffer pointer and
 				 * copy header to its new location */
 				memcpy((char *) phdr + surb->cb->offset,
-				       phdr, sizeof(struct SmsMsgHdr_ST));
+				       phdr, sizeof(struct sms_msg_hdr));
 			} else
 				surb->cb->offset = 0;
 
 			sms_debug("received %s(%d) size: %d",
-				  smscore_translate_msg(phdr->msgType),
-				  phdr->msgType, phdr->msgLength);
+				  smscore_translate_msg(phdr->msg_type),
+				  phdr->msg_type, phdr->msg_length);
 
-			smsendian_handle_rx_message((struct SmsMsgData_ST *) phdr);
+			smsendian_handle_rx_message((struct sms_msg_data *) phdr);
 
 			smscore_onresponse(dev->coredev, surb->cb);
 			surb->cb = NULL;
 		} else {
 			sms_err("invalid response "
 				"msglen %d actual %d",
-				phdr->msgLength, urb->actual_length);
+				phdr->msg_length, urb->actual_length);
 		}
 	} else
 		sms_err("error, urb status %d, %d bytes",
@@ -206,18 +206,18 @@ static int smsusb_start_streaming(struct smsusb_device_t *dev)
 static int smsusb_sendrequest(void *context, void *buffer, size_t size)
 {
 	struct smsusb_device_t *dev = (struct smsusb_device_t *) context;
-	struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) buffer;
+	struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer;
 	int dummy;
 
 	if (dev->state != SMSUSB_ACTIVE)
 		return -ENOENT;
 
 	sms_debug("sending %s(%d) size: %d",
-		  smscore_translate_msg(phdr->msgType), phdr->msgType,
-		  phdr->msgLength);
+		  smscore_translate_msg(phdr->msg_type), phdr->msg_type,
+		  phdr->msg_length);
 
-	smsendian_handle_tx_message((struct SmsMsgData_ST *) phdr);
-	smsendian_handle_message_header((struct SmsMsgHdr_ST *)buffer);
+	smsendian_handle_tx_message((struct sms_msg_data *) phdr);
+	smsendian_handle_message_header((struct sms_msg_hdr *)buffer);
 	return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
 			    buffer, size, &dummy, 1000);
 }
@@ -310,8 +310,8 @@ static void smsusb1_detectmode(void *context, int *mode)
 
 static int smsusb1_setmode(void *context, int mode)
 {
-	struct SmsMsgHdr_ST Msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK,
-			     sizeof(struct SmsMsgHdr_ST), 0 };
+	struct sms_msg_hdr Msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK,
+			     sizeof(struct sms_msg_hdr), 0 };
 
 	if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
 		sms_err("invalid firmware id specified %d", mode);
@@ -375,7 +375,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
 		dev->buffer_size = USB2_BUFFER_SIZE;
 		dev->response_alignment =
 		    le16_to_cpu(dev->udev->ep_in[1]->desc.wMaxPacketSize) -
-		    sizeof(struct SmsMsgHdr_ST);
+		    sizeof(struct sms_msg_hdr);
 
 		params.flags |= SMS_DEVICE_FAMILY2;
 		break;
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 2/6 siano: convert structure names to lowercase

There are several structures defined in uppercase. Convert them to lowercase, and simplify their names, when possible.

---
 drivers/media/common/siano/smscoreapi.h     | 52 ++++++++++++++---------------
 drivers/media/common/siano/smsdvb-debugfs.c |  6 ++--
 drivers/media/common/siano/smsdvb-main.c    | 12 +++----
 drivers/media/common/siano/smsdvb.h         |  9 ++---
 4 files changed, 40 insertions(+), 39 deletions(-)
drivers/media/common/siano/smscoreapi.h +26 -26
index 4b0cd7d..b65232a 100644
@@ -676,7 +676,7 @@ struct sms_firmware {
 
 /* statistics information returned as response for
  * SmsHostApiGetstatistics_Req */
-struct SMSHOSTLIB_STATISTICS_ST {
+struct sms_stats {
 	u32 reserved;		/* reserved */
 
 	/* Common parameters */
@@ -764,7 +764,7 @@ struct SMSHOSTLIB_STATISTICS_ST {
 struct sms_msg_statistics_info {
 	u32 request_result;
 
-	struct SMSHOSTLIB_STATISTICS_ST stat;
+	struct sms_stats stat;
 
 	/* Split the calc of the SNR in DAB */
 	u32 signal; /* dB */
@@ -772,7 +772,7 @@ struct sms_msg_statistics_info {
 
 };
 
-struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST {
+struct sms_isdbt_layer_stats {
 	/* Per-layer information */
 	u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET,
 		       * 255 means layer does not exist */
@@ -792,7 +792,7 @@ struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST {
 	u32 tmcc_errors; /* TMCC errors */
 };
 
-struct SMSHOSTLIB_STATISTICS_ISDBT_ST {
+struct sms_isdbt_stats {
 	u32 statistics_type; /* Enumerator identifying the type of the
 				* structure.  Values are the same as
 				* SMSHOSTLIB_DEVICE_MODES_E
@@ -827,14 +827,14 @@ struct SMSHOSTLIB_STATISTICS_ISDBT_ST {
 
 	/* Per-layer information */
 	/* Layers A, B and C */
-	struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST	LayerInfo[3];
-	/* Per-layer statistics, see SMSHOSTLIB_ISDBT_LAYER_STAT_ST */
+	struct sms_isdbt_layer_stats	LayerInfo[3];
+	/* Per-layer statistics, see sms_isdbt_layer_stats */
 
 	/* Interface information */
 	u32 sms_to_host_tx_errors; /* Total number of transmission errors. */
 };
 
-struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST {
+struct sms_isdbt_stats_ex {
 	u32 statistics_type; /* Enumerator identifying the type of the
 				* structure.  Values are the same as
 				* SMSHOSTLIB_DEVICE_MODES_E
@@ -872,8 +872,8 @@ struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST {
 
 	/* Per-layer information */
 	/* Layers A, B and C */
-	struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST	LayerInfo[3];
-	/* Per-layer statistics, see SMSHOSTLIB_ISDBT_LAYER_STAT_ST */
+	struct sms_isdbt_layer_stats	LayerInfo[3];
+	/* Per-layer statistics, see sms_isdbt_layer_stats */
 
 	/* Interface information */
 	u32 reserved1;    /* Was sms_to_host_tx_errors - obsolete . */
@@ -894,7 +894,7 @@ struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST {
 };
 
 
-struct PID_STATISTICS_DATA_S {
+struct sms_pid_stats_data {
 	struct PID_BURST_S {
 		u32 size;
 		u32 padding_cols;
@@ -909,10 +909,10 @@ struct PID_STATISTICS_DATA_S {
 	u32 tot_cor_tbl;
 };
 
-struct PID_DATA_S {
+struct sms_pid_data {
 	u32 pid;
 	u32 num_rows;
-	struct PID_STATISTICS_DATA_S pid_statistics;
+	struct sms_pid_stats_data pid_statistics;
 };
 
 #define CORRECT_STAT_RSSI(_stat) ((_stat).RSSI *= -1)
@@ -925,7 +925,7 @@ struct PID_DATA_S {
 		else \
 			_stat.transmission_mode = 4;
 
-struct TRANSMISSION_STATISTICS_S {
+struct sms_tx_stats {
 	u32 frequency;		/* frequency in Hz */
 	u32 bandwidth;		/* bandwidth in MHz */
 	u32 transmission_mode;	/* FFT mode carriers in Kilos */
@@ -948,7 +948,7 @@ struct TRANSMISSION_STATISTICS_S {
 	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
 };
 
-struct RECEPTION_STATISTICS_S {
+struct sms_rx_stats {
 	u32 is_rf_locked;		/* 0 - not locked, 1 - locked */
 	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
 	u32 is_external_lna_on;	/* 0 - external LNA off, 1 - external LNA on */
@@ -974,7 +974,7 @@ struct RECEPTION_STATISTICS_S {
 	s32 mrc_in_band_pwr;	/* In band power in dBM */
 };
 
-struct RECEPTION_STATISTICS_EX_S {
+struct sms_rx_stats_ex {
 	u32 is_rf_locked;		/* 0 - not locked, 1 - locked */
 	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
 	u32 is_external_lna_on;	/* 0 - external LNA off, 1 - external LNA on */
@@ -1006,33 +1006,33 @@ struct RECEPTION_STATISTICS_EX_S {
 
 /* statistics information returned as response for
  * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */
-struct SMSHOSTLIB_STATISTICS_DVB_S {
+struct sms_stats_dvb {
 	/* Reception */
-	struct RECEPTION_STATISTICS_S reception_data;
+	struct sms_rx_stats reception_data;
 
 	/* Transmission parameters */
-	struct TRANSMISSION_STATISTICS_S transmission_data;
+	struct sms_tx_stats transmission_data;
 
 	/* Burst parameters, valid only for DVB-H */
 #define	SRVM_MAX_PID_FILTERS 8
-	struct PID_DATA_S pid_data[SRVM_MAX_PID_FILTERS];
+	struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS];
 };
 
 /* statistics information returned as response for
  * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */
-struct SMSHOSTLIB_STATISTICS_DVB_EX_S {
+struct sms_stats_dvb_ex {
 	/* Reception */
-	struct RECEPTION_STATISTICS_EX_S reception_data;
+	struct sms_rx_stats_ex reception_data;
 
 	/* Transmission parameters */
-	struct TRANSMISSION_STATISTICS_S transmission_data;
+	struct sms_tx_stats transmission_data;
 
 	/* Burst parameters, valid only for DVB-H */
 #define	SRVM_MAX_PID_FILTERS 8
-	struct PID_DATA_S pid_data[SRVM_MAX_PID_FILTERS];
+	struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS];
 };
 
-struct SRVM_SIGNAL_STATUS_S {
+struct sms_srvm_signal_status {
 	u32 result;
 	u32 snr;
 	u32 ts_packets;
@@ -1048,14 +1048,14 @@ struct SRVM_SIGNAL_STATUS_S {
 	u32 request_id;
 };
 
-struct SMSHOSTLIB_I2C_REQ_ST {
+struct sms_i2c_req {
 	u32	device_address; /* I2c device address */
 	u32	write_count; /* number of bytes to write */
 	u32	read_count; /* number of bytes to read */
 	u8	Data[1];
 };
 
-struct SMSHOSTLIB_I2C_RES_ST {
+struct sms_i2c_res {
 	u32	status; /* non-zero value in case of failure */
 	u32	read_count; /* number of bytes read */
 	u8	Data[1];
drivers/media/common/siano/smsdvb-debugfs.c +3 -3
index 5a28506..f63121c 100644
@@ -49,7 +49,7 @@ struct smsdvb_debugfs {
 };
 
 void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data,
-			    struct SMSHOSTLIB_STATISTICS_ST *p)
+			    struct sms_stats *p)
 {
 	int n = 0;
 	char *buf;
@@ -152,7 +152,7 @@ void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data,
 }
 
 void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data,
-			     struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p)
+			     struct sms_isdbt_stats *p)
 {
 	int i, n = 0;
 	char *buf;
@@ -242,7 +242,7 @@ void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data,
 }
 
 void smsdvb_print_isdb_stats_ex(struct smsdvb_debugfs *debug_data,
-				struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *p)
+				struct sms_isdbt_stats_ex *p)
 {
 	int i, n = 0;
 	char *buf;
drivers/media/common/siano/smsdvb-main.c +6 -6
index cec85fe..29d1c41 100644
@@ -223,7 +223,7 @@ static inline u32 sms_to_bw(u32 value)
 			   FEC_NONE);
 
 static void smsdvb_update_tx_params(struct smsdvb_client_t *client,
-				    struct TRANSMISSION_STATISTICS_S *p)
+				    struct sms_tx_stats *p)
 {
 	struct dvb_frontend *fe = &client->frontend;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -277,7 +277,7 @@ static void smsdvb_update_per_slices(struct smsdvb_client_t *client,
 }
 
 static void smsdvb_update_dvb_stats(struct smsdvb_client_t *client,
-				    struct SMSHOSTLIB_STATISTICS_ST *p)
+				    struct sms_stats *p)
 {
 	struct dvb_frontend *fe = &client->frontend;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -329,11 +329,11 @@ static void smsdvb_update_dvb_stats(struct smsdvb_client_t *client,
 };
 
 static void smsdvb_update_isdbt_stats(struct smsdvb_client_t *client,
-				      struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p)
+				      struct sms_isdbt_stats *p)
 {
 	struct dvb_frontend *fe = &client->frontend;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST *lr;
+	struct sms_isdbt_layer_stats *lr;
 	int i, n_layers;
 
 	if (client->prt_isdb_stats)
@@ -425,11 +425,11 @@ static void smsdvb_update_isdbt_stats(struct smsdvb_client_t *client,
 }
 
 static void smsdvb_update_isdbt_stats_ex(struct smsdvb_client_t *client,
-					 struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *p)
+					 struct sms_isdbt_stats_ex *p)
 {
 	struct dvb_frontend *fe = &client->frontend;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST *lr;
+	struct sms_isdbt_layer_stats *lr;
 	int i, n_layers;
 
 	if (client->prt_isdb_stats_ex)
drivers/media/common/siano/smsdvb.h +5 -4
index e1ff07c..513f853 100644
@@ -19,14 +19,14 @@ struct smsdvb_debugfs;
 struct smsdvb_client_t;
 
 typedef void (*sms_prt_dvb_stats_t)(struct smsdvb_debugfs *debug_data,
-				    struct SMSHOSTLIB_STATISTICS_ST *p);
+				    struct sms_stats *p);
 
 typedef void (*sms_prt_isdb_stats_t)(struct smsdvb_debugfs *debug_data,
-				     struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p);
+				     struct sms_isdbt_stats *p);
 
 typedef void (*sms_prt_isdb_stats_ex_t)
 			(struct smsdvb_debugfs *debug_data,
-			 struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *p);
+			 struct sms_isdbt_stats_ex *p);
 
 
 struct smsdvb_client_t {
@@ -68,7 +68,8 @@ struct smsdvb_client_t {
 };
 
 /*
- * This struct is a mix of RECEPTION_STATISTICS_EX_S and SRVM_SIGNAL_STATUS_S.
+ * This struct is a mix of struct sms_rx_stats_ex and
+ * struct sms_srvm_signal_status.
  * It was obtained by comparing the way it was filled by the original code
  */
 struct RECEPTION_STATISTICS_PER_SLICES_S {
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 3/6 fix checkpatch.pl compliants on smscoreapi.h

In reply to Mauro Carvalho Chehab

Fix the remaining checkpatch.pl compliants at smscoreapi.h, except by the "line over 80 characters" on comments. Fixing those would require more time, as the better is to convert them into the struct descriptions used inside the kernel, as described at:
Documentation/kernel-doc-nano-HOWTO.txt

---
 drivers/media/common/siano/smscoreapi.h | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/media/common/siano/smscoreapi.h +9 -5
index b65232a..b0253d2 100644
@@ -577,8 +577,11 @@ enum msg_types {
 };
 
 #define SMS_INIT_MSG_EX(ptr, type, src, dst, len) do { \
-	(ptr)->msg_type = type; (ptr)->msg_src_id = src; (ptr)->msg_dst_id = dst; \
-	(ptr)->msg_length = len; (ptr)->msg_flags = 0; \
+	(ptr)->msg_type = type; \
+	(ptr)->msg_src_id = src; \
+	(ptr)->msg_dst_id = dst; \
+	(ptr)->msg_length = len; \
+	(ptr)->msg_flags = 0; \
 } while (0)
 
 #define SMS_INIT_MSG(ptr, type, len) \
@@ -704,7 +707,7 @@ struct sms_stats {
 	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET,
 	valid only for DVB-T/H */
 	u32 guard_interval;	/* Guard Interval from
-	SMSHOSTLIB_GUARD_INTERVALS_ET, 	valid only for DVB-T/H */
+	SMSHOSTLIB_GUARD_INTERVALS_ET,	valid only for DVB-T/H */
 	u32 code_rate;		/* Code Rate from SMSHOSTLIB_CODE_RATE_ET,
 	valid only for DVB-T/H */
 	u32 lp_code_rate;		/* Low Priority Code Rate from
@@ -746,7 +749,7 @@ struct sms_stats {
 	u32 sms_to_host_tx_errors;	/* Total number of transmission errors. */
 
 	/* DAB/T-DMB */
-	u32 pre_ber; 		/* DAB/T-DMB only: Pre Viterbi BER [1E-5] */
+	u32 pre_ber;		/* DAB/T-DMB only: Pre Viterbi BER [1E-5] */
 
 	/* DVB-H TPS parameters */
 	u32 cell_id;		/* TPS Cell ID in bits 15..0, bits 31..16 zero;
@@ -1177,7 +1180,8 @@ int smscore_led_state(struct smscore_device_t *core, int led);
 
 #define dprintk(kern, lvl, fmt, arg...) do {\
 	if (sms_dbg & lvl) \
-		sms_printk(kern, fmt, ##arg); } while (0)
+		sms_printk(kern, fmt, ##arg); \
+} while (0)
 
 #define sms_log(fmt, arg...) sms_printk(KERN_INFO, fmt, ##arg)
 #define sms_err(fmt, arg...) \
Signature · 1 line
1.8.1.4
#3 lore raw

PATCH 4/6 siano: remove the remaining CamelCase compliants

In reply to Mauro Carvalho Chehab

Remove the remaining CamelCase checkpatch.pl compliants. There are still a few left, but those are due to USB and DVB APIs.

---
 drivers/media/common/siano/sms-cards.c      |   4 +-
 drivers/media/common/siano/smscoreapi.c     | 256 ++++++++++++++--------------
 drivers/media/common/siano/smscoreapi.h     |  30 ++--
 drivers/media/common/siano/smsdvb-debugfs.c |  68 ++++----
 drivers/media/common/siano/smsdvb-main.c    | 124 +++++++-------
 drivers/media/common/siano/smsdvb.h         |   2 +-
 drivers/media/common/siano/smsendian.c      |  18 +-
 drivers/media/usb/siano/smsusb.c            |   4 +-
 8 files changed, 253 insertions(+), 253 deletions(-)
drivers/media/common/siano/sms-cards.c +2 -2
index 9bd7aa1..8276999 100644
@@ -179,9 +179,9 @@ static inline void sms_gpio_assign_11xx_default_led_config(
 int sms_board_event(struct smscore_device_t *coredev,
 		    enum SMS_BOARD_EVENTS gevent)
 {
-	struct smscore_config_gpio MyGpioConfig;
+	struct smscore_config_gpio my_gpio_config;
 
-	sms_gpio_assign_11xx_default_led_config(&MyGpioConfig);
+	sms_gpio_assign_11xx_default_led_config(&my_gpio_config);
 
 	switch (gevent) {
 	case BOARD_EVENT_POWER_INIT: /* including hotplug */
drivers/media/common/siano/smscoreapi.c +128 -128

432 lines not on this page · raw message

drivers/media/common/siano/smscoreapi.h +15 -15
index b0253d2..d3e781f 100644
@@ -624,17 +624,17 @@ struct sms_msg_hdr {
 
 struct sms_msg_data {
 	struct sms_msg_hdr x_msg_header;
-	u32 msgData[1];
+	u32 msg_data[1];
 };
 
 struct sms_msg_data2 {
 	struct sms_msg_hdr x_msg_header;
-	u32 msgData[2];
+	u32 msg_data[2];
 };
 
 struct sms_msg_data4 {
 	struct sms_msg_hdr x_msg_header;
-	u32 msgData[4];
+	u32 msg_data[4];
 };
 
 struct sms_data_download {
@@ -689,9 +689,9 @@ struct sms_stats {
 
 	/* Reception quality */
 	s32 SNR;		/* dB */
-	u32 BER;		/* Post Viterbi BER [1E-5] */
+	u32 ber;		/* Post Viterbi ber [1E-5] */
 	u32 FIB_CRC;		/* CRC errors percentage, valid only for DAB */
-	u32 TS_PER;		/* Transport stream PER,
+	u32 ts_per;		/* Transport stream PER,
 	0xFFFFFFFF indicate N/A, valid only for DVB-T/H */
 	u32 MFER;		/* DVB-H frame error rate in percentage,
 	0xFFFFFFFF indicate N/A, valid only for DVB-H */
@@ -749,7 +749,7 @@ struct sms_stats {
 	u32 sms_to_host_tx_errors;	/* Total number of transmission errors. */
 
 	/* DAB/T-DMB */
-	u32 pre_ber;		/* DAB/T-DMB only: Pre Viterbi BER [1E-5] */
+	u32 pre_ber;		/* DAB/T-DMB only: Pre Viterbi ber [1E-5] */
 
 	/* DVB-H TPS parameters */
 	u32 cell_id;		/* TPS Cell ID in bits 15..0, bits 31..16 zero;
@@ -781,11 +781,11 @@ struct sms_isdbt_layer_stats {
 		       * 255 means layer does not exist */
 	u32 constellation; /* constellation from SMSHOSTLIB_CONSTELLATION_ET,
 			    * 255 means layer does not exist */
-	u32 BER; /* Post Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */
+	u32 ber; /* Post Viterbi ber [1E-5], 0xFFFFFFFF indicate N/A */
 	u32 ber_error_count; /* Post Viterbi Error Bits Count */
 	u32 ber_bit_count; /* Post Viterbi Total Bits Count */
-	u32 pre_ber; /* Pre Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */
-	u32 TS_PER; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */
+	u32 pre_ber; /* Pre Viterbi ber [1E-5], 0xFFFFFFFF indicate N/A */
+	u32 ts_per; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */
 	u32 error_ts_packets; /* Number of erroneous transport-stream packets */
 	u32 total_ts_packets; /* Total number of transport-stream packets */
 	u32 ti_ldepth_i; /* Time interleaver depth I parameter,
@@ -830,7 +830,7 @@ struct sms_isdbt_stats {
 
 	/* Per-layer information */
 	/* Layers A, B and C */
-	struct sms_isdbt_layer_stats	LayerInfo[3];
+	struct sms_isdbt_layer_stats	layer_info[3];
 	/* Per-layer statistics, see sms_isdbt_layer_stats */
 
 	/* Interface information */
@@ -875,7 +875,7 @@ struct sms_isdbt_stats_ex {
 
 	/* Per-layer information */
 	/* Layers A, B and C */
-	struct sms_isdbt_layer_stats	LayerInfo[3];
+	struct sms_isdbt_layer_stats	layer_info[3];
 	/* Per-layer statistics, see sms_isdbt_layer_stats */
 
 	/* Interface information */
@@ -958,10 +958,10 @@ struct sms_rx_stats {
 
 	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
 	s32 SNR;		/* dB */
-	u32 BER;		/* Post Viterbi BER [1E-5] */
+	u32 ber;		/* Post Viterbi ber [1E-5] */
 	u32 ber_error_count;	/* Number of erronous SYNC bits. */
 	u32 ber_bit_count;	/* Total number of SYNC bits. */
-	u32 TS_PER;		/* Transport stream PER,
+	u32 ts_per;		/* Transport stream PER,
 	0xFFFFFFFF indicate N/A */
 	u32 MFER;		/* DVB-H frame error rate in percentage,
 	0xFFFFFFFF indicate N/A, valid only for DVB-H */
@@ -984,10 +984,10 @@ struct sms_rx_stats_ex {
 
 	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
 	s32 SNR;		/* dB */
-	u32 BER;		/* Post Viterbi BER [1E-5] */
+	u32 ber;		/* Post Viterbi ber [1E-5] */
 	u32 ber_error_count;	/* Number of erronous SYNC bits. */
 	u32 ber_bit_count;	/* Total number of SYNC bits. */
-	u32 TS_PER;		/* Transport stream PER,
+	u32 ts_per;		/* Transport stream PER,
 	0xFFFFFFFF indicate N/A */
 	u32 MFER;		/* DVB-H frame error rate in percentage,
 	0xFFFFFFFF indicate N/A, valid only for DVB-H */
drivers/media/common/siano/smsdvb-debugfs.c +34 -34

117 lines not on this page · raw message

drivers/media/common/siano/smsdvb-main.c +62 -62

285 lines not on this page · raw message

drivers/media/common/siano/smsdvb.h +1 -1
index 513f853..92c413b 100644
@@ -87,7 +87,7 @@ struct RECEPTION_STATISTICS_PER_SLICES_S {
 	u32 request_id;
 	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
 
-	u32 BER;		/* Post Viterbi BER [1E-5] */
+	u32 ber;		/* Post Viterbi BER [1E-5] */
 	s32 RSSI;		/* dBm */
 	s32 carrier_offset;	/* Carrier Offset in bin/1024 */
 
drivers/media/common/siano/smsendian.c +9 -9
index 32a7b28..bfe831c 100644
@@ -30,21 +30,21 @@ void smsendian_handle_tx_message(void *buffer)
 #ifdef __BIG_ENDIAN
 	struct sms_msg_data *msg = (struct sms_msg_data *)buffer;
 	int i;
-	int msgWords;
+	int msg_words;
 
 	switch (msg->x_msg_header.msg_type) {
 	case MSG_SMS_DATA_DOWNLOAD_REQ:
 	{
-		msg->msgData[0] = le32_to_cpu(msg->msgData[0]);
+		msg->msg_data[0] = le32_to_cpu(msg->msg_data[0]);
 		break;
 	}
 
 	default:
-		msgWords = (msg->x_msg_header.msg_length -
+		msg_words = (msg->x_msg_header.msg_length -
 				sizeof(struct sms_msg_hdr))/4;
 
-		for (i = 0; i < msgWords; i++)
-			msg->msgData[i] = le32_to_cpu(msg->msgData[i]);
+		for (i = 0; i < msg_words; i++)
+			msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]);
 
 		break;
 	}
@@ -57,7 +57,7 @@ void smsendian_handle_rx_message(void *buffer)
 #ifdef __BIG_ENDIAN
 	struct sms_msg_data *msg = (struct sms_msg_data *)buffer;
 	int i;
-	int msgWords;
+	int msg_words;
 
 	switch (msg->x_msg_header.msg_type) {
 	case MSG_SMS_GET_VERSION_EX_RES:
@@ -77,11 +77,11 @@ void smsendian_handle_rx_message(void *buffer)
 
 	default:
 	{
-		msgWords = (msg->x_msg_header.msg_length -
+		msg_words = (msg->x_msg_header.msg_length -
 				sizeof(struct sms_msg_hdr))/4;
 
-		for (i = 0; i < msgWords; i++)
-			msg->msgData[i] = le32_to_cpu(msg->msgData[i]);
+		for (i = 0; i < msg_words; i++)
+			msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]);
 
 		break;
 	}
drivers/media/usb/siano/smsusb.c +2 -2
index 3a290f1..03761c6 100644
@@ -310,7 +310,7 @@ static void smsusb1_detectmode(void *context, int *mode)
 
 static int smsusb1_setmode(void *context, int mode)
 {
-	struct sms_msg_hdr Msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK,
+	struct sms_msg_hdr msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK,
 			     sizeof(struct sms_msg_hdr), 0 };
 
 	if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
@@ -318,7 +318,7 @@ static int smsusb1_setmode(void *context, int mode)
 		return -EINVAL;
 	}
 
-	return smsusb_sendrequest(context, &Msg, sizeof(Msg));
+	return smsusb_sendrequest(context, &msg, sizeof(msg));
 }
 
 static void smsusb_term_device(struct usb_interface *intf)
Signature · 1 line
1.8.1.4
#4 lore raw

Re: [PATCH 4/6] siano: remove the remaining CamelCase compliants

Quoted 3 lines · Mauro Carvalho Chehab

Remove the remaining CamelCase checkpatch.pl compliants. There are still a few left, but those are due to USB and DVB APIs.

[..]

Quoted 11 lines
drivers/media/common/siano/smscoreapi.c +1 -4
@@ -840,31 +840,31 @@ int smscore_configure_board(struct smscore_device_t *coredev)
 	}
 
 	if (board->mtu) {
-		struct sms_msg_data MtuMsg;
+		struct sms_msg_data mtu_msg;
 		sms_debug("set max transmit unit %d", board->mtu);
 
-		MtuMsg.x_msg_header.msg_src_id = 0;
-		MtuMsg.x_msg_header.msg_dst_id = HIF_TASK;
-		MtuMsg.x_msg_header.msg_flags = 0;

drivers/media/common/siano/smscoreapi.c int smscore_configure_board(struct smscore_device_t *coredev) · line 852

Quoted 10 lines
drivers/media/common/siano/smscoreapi.c +6 -3
-		MtuMsg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
-		MtuMsg.x_msg_header.msg_length = sizeof(MtuMsg);
-		MtuMsg.msgData[0] = board->mtu;
+		mtu_msg.x_msg_header.msg_src_id = 0;
+		mtu_msg.x_msg_header.msg_dst_id = HIF_TASK;
+		mtu_msg.x_msg_header.msg_flags = 0;
+		mtu_msg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
+		mtu_msg.x_msg_header.msg_length = sizeof(mtu_msg);
+		mtu_msg.msg_data[0] = board->mtu;
 

Ah, right. Why don't you just squash patch 1 and 4 together, reducing the set with about the size of patch 4, and making all this somewhat more meaningful?

Tounching the exact same lines twice in the same patchset, doing the exact same type of cleanup, does *not* help review.

Bjørn

#5 lore raw

Re: [PATCH 4/6] siano: remove the remaining CamelCase compliants

Em Thu, 21 Mar 2013 14:18:11 +0100
Bjørn Mork <[email protected]> escreveu:

Quoted 32 lines
Quoted 3 lines · Mauro Carvalho Chehab

Remove the remaining CamelCase checkpatch.pl compliants. There are still a few left, but those are due to USB and DVB APIs.

[..]

Quoted 11 lines
drivers/media/common/siano/smscoreapi.c +1 -4
@@ -840,31 +840,31 @@ int smscore_configure_board(struct smscore_device_t *coredev)
 	}
 
 	if (board->mtu) {
-		struct sms_msg_data MtuMsg;
+		struct sms_msg_data mtu_msg;
 		sms_debug("set max transmit unit %d", board->mtu);
 
-		MtuMsg.x_msg_header.msg_src_id = 0;
-		MtuMsg.x_msg_header.msg_dst_id = HIF_TASK;
-		MtuMsg.x_msg_header.msg_flags = 0;

drivers/media/common/siano/smscoreapi.c int smscore_configure_board(struct smscore_device_t *coredev) · line 852

Quoted 10 lines
drivers/media/common/siano/smscoreapi.c +6 -3
-		MtuMsg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
-		MtuMsg.x_msg_header.msg_length = sizeof(MtuMsg);
-		MtuMsg.msgData[0] = board->mtu;
+		mtu_msg.x_msg_header.msg_src_id = 0;
+		mtu_msg.x_msg_header.msg_dst_id = HIF_TASK;
+		mtu_msg.x_msg_header.msg_flags = 0;
+		mtu_msg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
+		mtu_msg.x_msg_header.msg_length = sizeof(mtu_msg);
+		mtu_msg.msg_data[0] = board->mtu;
 

Ah, right. Why don't you just squash patch 1 and 4 together, reducing the set with about the size of patch 4, and making all this somewhat more meaningful?

Quoted 2 lines

Tounching the exact same lines twice in the same patchset, doing the exact same type of cleanup, does *not* help review.

Yeah, but I was afraid that symbol conflicts would rise with those changes, as a core API namespace could be matching some locale namespace.

If this happens, by having it into two separate patches help to debug and fix.

Regards,
Mauro

#6 lore raw

PATCH 5/6 siano: Fix the remaining checkpatch.pl compliants

In reply to Mauro Carvalho Chehab

Fix all other remaining checkpatch.pl compliants on the Siano driver, except for the 80-cols (soft) limit. Those are harder to fix, and probably not worth to do right now.

---
 drivers/media/common/siano/smscoreapi.c     | 15 +++++++--------
 drivers/media/common/siano/smscoreapi.h     |  4 ----
 drivers/media/common/siano/smsdvb-debugfs.c |  7 ++-----
 3 files changed, 9 insertions(+), 17 deletions(-)
drivers/media/common/siano/smscoreapi.c +7 -8
index 19e7a5f..e7fc4de 100644
@@ -57,8 +57,8 @@ struct smscore_client_t {
 	struct list_head entry;
 	struct smscore_device_t *coredev;
 	void			*context;
-	struct list_head 	idlist;
-	onresponse_t	onresponse_handler;
+	struct list_head	idlist;
+	onresponse_t		onresponse_handler;
 	onremove_t		onremove_handler;
 };
 
@@ -874,7 +874,7 @@ int smscore_configure_board(struct smscore_device_t *coredev)
  * sets initial device mode and notifies client hotplugs that device is ready
  *
  * @param coredev pointer to a coredev object returned by
- * 		  smscore_register_device
+ *		  smscore_register_device
  *
  * @return 0 on success, <0 on error.
  */
@@ -961,7 +961,7 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
 	while (size && rc >= 0) {
 		struct sms_data_download *data_msg =
 			(struct sms_data_download *) msg;
-		int payload_size = min((int) size, SMS_MAX_PAYLOAD_SIZE);
+		int payload_size = min_t(int, size, SMS_MAX_PAYLOAD_SIZE);
 
 		SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_DOWNLOAD_REQ,
 			     (u16)(sizeof(struct sms_msg_hdr) +
@@ -1225,8 +1225,7 @@ void smscore_unregister_device(struct smscore_device_t *coredev)
 		if (num_buffers == coredev->num_buffers)
 			break;
 		if (++retry > 10) {
-			sms_info("exiting although "
-				 "not all buffers released.");
+			sms_info("exiting although not all buffers released.");
 			break;
 		}
 
@@ -1279,8 +1278,8 @@ static int smscore_detect_mode(struct smscore_device_t *coredev)
 				coredev, msg, msg->msg_length,
 				&coredev->version_ex_done);
 			if (rc < 0)
-				sms_err("MSG_SMS_GET_VERSION_EX_REQ failed "
-					"second try, rc %d", rc);
+				sms_err("MSG_SMS_GET_VERSION_EX_REQ failed second try, rc %d",
+					rc);
 		} else
 			rc = -ETIME;
 	}
drivers/media/common/siano/smscoreapi.h +0 -4
index d3e781f..d0799e3 100644
@@ -40,10 +40,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define kmutex_trylock(_p_) mutex_trylock(_p_)
 #define kmutex_unlock(_p_) mutex_unlock(_p_)
 
-#ifndef min
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
 /*
  * Define the firmware names used by the driver.
  * Those should match what's used at smscoreapi.c and sms-cards.c
drivers/media/common/siano/smsdvb-debugfs.c +2 -5
index a881da5..4c5691e 100644
@@ -112,7 +112,7 @@ void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data,
 		      "burst_cycle_time = %d\n", p->burst_cycle_time);
 	n += snprintf(&buf[n], PAGE_SIZE - n,
 		      "calc_burst_cycle_time = %d\n",
-	              p->calc_burst_cycle_time);
+		      p->calc_burst_cycle_time);
 	n += snprintf(&buf[n], PAGE_SIZE - n,
 		      "num_of_rows = %d\n", p->num_of_rows);
 	n += snprintf(&buf[n], PAGE_SIZE - n,
@@ -509,8 +509,6 @@ void smsdvb_debugfs_release(struct smsdvb_client_t *client)
 	if (!client->debugfs)
 		return;
 
-printk("%s\n", __func__);
-
 	client->prt_dvb_stats     = NULL;
 	client->prt_isdb_stats    = NULL;
 	client->prt_isdb_stats_ex = NULL;
@@ -548,7 +546,6 @@ int smsdvb_debugfs_register(void)
 
 void smsdvb_debugfs_unregister(void)
 {
-	if (smsdvb_debugfs_usb_root)
-		debugfs_remove_recursive(smsdvb_debugfs_usb_root);
+	debugfs_remove_recursive(smsdvb_debugfs_usb_root);
 	smsdvb_debugfs_usb_root = NULL;
 }
Signature · 1 line
1.8.1.4
#7 lore raw

PATCH 6/6 siano: make some functions static

In reply to Mauro Carvalho Chehab

drivers/media/common/siano/smsdvb-debugfs.c:51:6: warning: no previous prototype for 'smsdvb_print_dvb_stats' [-Wmissing-prototypes] drivers/media/common/siano/smsdvb-debugfs.c:154:6: warning: no previous prototype for 'smsdvb_print_isdb_stats' [-Wmissing-prototypes] drivers/media/common/siano/smsdvb-debugfs.c:244:6: warning: no previous prototype for 'smsdvb_print_isdb_stats_ex' [-Wmissing-prototypes] drivers/media/common/siano/smscoreapi.c:832:5: warning: no previous prototype for 'smscore_configure_board' [-Wmissing-prototypes] drivers/media/common/siano/smscoreapi.c:1301:5: warning: no previous prototype for 'smscore_init_device' [-Wmissing-prototypes]

---
 drivers/media/common/siano/smscoreapi.c     | 4 ++--
 drivers/media/common/siano/smsdvb-debugfs.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/media/common/siano/smscoreapi.c +2 -2
index e7fc4de..ebb9ece 100644
@@ -829,7 +829,7 @@ static int smscore_init_ir(struct smscore_device_t *coredev)
  *
  * @return 0 on success, <0 on error.
  */
-int smscore_configure_board(struct smscore_device_t *coredev)
+static int smscore_configure_board(struct smscore_device_t *coredev)
 {
 	struct sms_board *board;
 
@@ -1298,7 +1298,7 @@ static int smscore_detect_mode(struct smscore_device_t *coredev)
  *
  * @return 0 on success, <0 on error.
  */
-int smscore_init_device(struct smscore_device_t *coredev, int mode)
+static int smscore_init_device(struct smscore_device_t *coredev, int mode)
 {
 	void *buffer;
 	struct sms_msg_data *msg;
drivers/media/common/siano/smsdvb-debugfs.c +3 -3
index 4c5691e..0bb4430 100644
@@ -48,7 +48,7 @@ struct smsdvb_debugfs {
 	wait_queue_head_t	stats_queue;
 };
 
-void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data,
+static void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data,
 			    struct sms_stats *p)
 {
 	int n = 0;
@@ -151,7 +151,7 @@ void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data,
 	wake_up(&debug_data->stats_queue);
 }
 
-void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data,
+static void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data,
 			     struct sms_isdbt_stats *p)
 {
 	int i, n = 0;
@@ -241,7 +241,7 @@ void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data,
 	wake_up(&debug_data->stats_queue);
 }
 
-void smsdvb_print_isdb_stats_ex(struct smsdvb_debugfs *debug_data,
+static void smsdvb_print_isdb_stats_ex(struct smsdvb_debugfs *debug_data,
 				struct sms_isdbt_stats_ex *p)
 {
 	int i, n = 0;
Signature · 1 line
1.8.1.4
#8 lore raw
In reply to Mauro Carvalho Chehab
Quoted 9 lines · Mauro Carvalho Chehab

It is almost impossible to see a compliant with checkpatch.pl on those Siano drivers, as there are simply too much violations on it. So, now that a big change was done, the better is to cleanup the checkpatch compliants.

Let's first replace all CammelCase symbols found at smscoreapi.h using camel_case namespace. That removed 144 checkpatch.pl compliants on this file. Of course, the other files need to be fixed accordingly.

[..]

Quoted 11 lines
drivers/media/common/siano/smscoreapi.c +1 -4
@@ -840,14 +840,14 @@ int smscore_configure_board(struct smscore_device_t *coredev)
 	}
 
 	if (board->mtu) {
-		struct SmsMsgData_ST MtuMsg;
+		struct sms_msg_data MtuMsg;
 		sms_debug("set max transmit unit %d", board->mtu);
 
-		MtuMsg.xMsgHeader.msgSrcId = 0;
-		MtuMsg.xMsgHeader.msgDstId = HIF_TASK;
-		MtuMsg.xMsgHeader.msgFlags = 0;

drivers/media/common/siano/smscoreapi.c int smscore_configure_board(struct smscore_device_t *coredev) · line 853

Quoted 10 lines
drivers/media/common/siano/smscoreapi.c +5 -2
-		MtuMsg.xMsgHeader.msgType = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
-		MtuMsg.xMsgHeader.msgLength = sizeof(MtuMsg);
+		MtuMsg.x_msg_header.msg_src_id = 0;
+		MtuMsg.x_msg_header.msg_dst_id = HIF_TASK;
+		MtuMsg.x_msg_header.msg_flags = 0;
+		MtuMsg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
+		MtuMsg.x_msg_header.msg_length = sizeof(MtuMsg);
 		MtuMsg.msgData[0] = board->mtu;
 
 		coredev->sendrequest_handler(coredev->context, &MtuMsg,

etc. This didn't help one bit, did it? There are exacly the same number of CamelCased lines here as before your patch. Why is that?

Bjørn

#9 lore raw

Em Thu, 21 Mar 2013 14:10:33 +0100
Bjørn Mork <[email protected]> escreveu:

Quoted 32 lines
Quoted 9 lines · Mauro Carvalho Chehab

It is almost impossible to see a compliant with checkpatch.pl on those Siano drivers, as there are simply too much violations on it. So, now that a big change was done, the better is to cleanup the checkpatch compliants.

Let's first replace all CammelCase symbols found at smscoreapi.h using camel_case namespace. That removed 144 checkpatch.pl compliants on this file. Of course, the other files need to be fixed accordingly.

[..]

Quoted 20 lines
drivers/media/common/siano/smscoreapi.c +6 -6
@@ -840,14 +840,14 @@ int smscore_configure_board(struct smscore_device_t *coredev)
 	}
 
 	if (board->mtu) {
-		struct SmsMsgData_ST MtuMsg;
+		struct sms_msg_data MtuMsg;
 		sms_debug("set max transmit unit %d", board->mtu);
 
-		MtuMsg.xMsgHeader.msgSrcId = 0;
-		MtuMsg.xMsgHeader.msgDstId = HIF_TASK;
-		MtuMsg.xMsgHeader.msgFlags = 0;
-		MtuMsg.xMsgHeader.msgType = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
-		MtuMsg.xMsgHeader.msgLength = sizeof(MtuMsg);
+		MtuMsg.x_msg_header.msg_src_id = 0;
+		MtuMsg.x_msg_header.msg_dst_id = HIF_TASK;
+		MtuMsg.x_msg_header.msg_flags = 0;
+		MtuMsg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
+		MtuMsg.x_msg_header.msg_length = sizeof(MtuMsg);
 		MtuMsg.msgData[0] = board->mtu;
 
Quoted 6 lines

drivers/media/common/siano/smscoreapi.c int smscore_configure_board(struct smscore_device_t *coredev) · line 853

Quoted 1 line
drivers/media/common/siano/smscoreapi.c +0 -0
 		coredev->sendrequest_handler(coredev->context, &MtuMsg,

etc. This didn't help one bit, did it? There are exacly the same number of CamelCased lines here as before your patch. Why is that?

I did this change in parts. This first patch changes only the symbols at the structures defined in smscoreapi.h. Latter patches in this series fix the rest.

I decided to do this way as not all CamelCase issues can be solved: there are lots of CamelCase on Kernel's USB API (probably to match the USB standard?).

So, I can't simply blind run my CamelCase fix script when fixing the remaining issues.

Signature · 2 lines
Cheers,
Mauro