From nobody Thu Sep 18 07:19:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8FC7C4708E for ; Thu, 8 Dec 2022 03:40:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbiLHDkX (ORCPT ); Wed, 7 Dec 2022 22:40:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiLHDkV (ORCPT ); Wed, 7 Dec 2022 22:40:21 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9766460364; Wed, 7 Dec 2022 19:40:18 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NSKfn0Kxwz501R0; Thu, 8 Dec 2022 11:40:17 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2B83e50l084393; Thu, 8 Dec 2022 11:40:05 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 8 Dec 2022 11:40:06 +0800 (CST) Date: Thu, 8 Dec 2022 11:40:06 +0800 (CST) X-Zmail-TransId: 2af963915c9664a92d29 X-Mailer: Zmail v1.0 Message-ID: <202212081140062735330@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , Subject: =?UTF-8?B?W1BBVENIXSBtZWRpYTogc2lhbm86IENvbnZlcnQgdG8gdXNlIHN5c2ZzX2VtaXRfYXQoKSBBUEk=?= X-MAIL: mse-fl2.zte.com.cn 2B83e50l084393 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 63915CA1.000 by FangMail milter! X-FangMail-Envelope: 1670470817/4NSKfn0Kxwz501R0/63915CA1.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63915CA1.000/4NSKfn0Kxwz501R0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: ye xingchen Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen --- drivers/media/common/siano/smsdvb-debugfs.c | 334 +++++++------------- 1 file changed, 117 insertions(+), 217 deletions(-) diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/co= mmon/siano/smsdvb-debugfs.c index 8916bb644756..e0beefd80d7b 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -45,89 +45,48 @@ static void smsdvb_print_dvb_stats(struct smsdvb_debugf= s *debug_data, buf =3D debug_data->stats_data; - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_rf_locked =3D %d\n", p->is_rf_locked); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_demod_locked =3D %d\n", p->is_demod_locked); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_external_lna_on =3D %d\n", p->is_external_lna_on); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "SNR =3D %d\n", p->SNR); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "ber =3D %d\n", p->ber); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "FIB_CRC =3D %d\n", p->FIB_CRC); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "ts_per =3D %d\n", p->ts_per); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "MFER =3D %d\n", p->MFER); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "RSSI =3D %d\n", p->RSSI); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "in_band_pwr =3D %d\n", p->in_band_pwr); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "carrier_offset =3D %d\n", p->carrier_offset); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "modem_state =3D %d\n", p->modem_state); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "frequency =3D %d\n", p->frequency); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "bandwidth =3D %d\n", p->bandwidth); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "transmission_mode =3D %d\n", p->transmission_mode); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "modem_state =3D %d\n", p->modem_state); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "guard_interval =3D %d\n", p->guard_interval); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "code_rate =3D %d\n", p->code_rate); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "lp_code_rate =3D %d\n", p->lp_code_rate); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "hierarchy =3D %d\n", p->hierarchy); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "constellation =3D %d\n", p->constellation); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "burst_size =3D %d\n", p->burst_size); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "burst_duration =3D %d\n", p->burst_duration); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "burst_cycle_time =3D %d\n", p->burst_cycle_time); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "calc_burst_cycle_time =3D %d\n", - p->calc_burst_cycle_time); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_rows =3D %d\n", p->num_of_rows); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_padd_cols =3D %d\n", p->num_of_padd_cols); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_punct_cols =3D %d\n", p->num_of_punct_cols); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "error_ts_packets =3D %d\n", p->error_ts_packets); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "total_ts_packets =3D %d\n", p->total_ts_packets); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_valid_mpe_tlbs =3D %d\n", p->num_of_valid_mpe_tlbs); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_invalid_mpe_tlbs =3D %d\n", p->num_of_invalid_mpe_tlbs); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_corrected_mpe_tlbs =3D %d\n", p->num_of_corrected_mpe_tlbs= ); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "ber_error_count =3D %d\n", p->ber_error_count); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "ber_bit_count =3D %d\n", p->ber_bit_count); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "sms_to_host_tx_errors =3D %d\n", p->sms_to_host_tx_errors); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "pre_ber =3D %d\n", p->pre_ber); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "cell_id =3D %d\n", p->cell_id); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "dvbh_srv_ind_hp =3D %d\n", p->dvbh_srv_ind_hp); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "dvbh_srv_ind_lp =3D %d\n", p->dvbh_srv_ind_lp); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_mpe_received =3D %d\n", p->num_mpe_received); + n +=3D sysfs_emit_at(buf, n, "is_rf_locked =3D %d\n", p->is_rf_locked); + n +=3D sysfs_emit_at(buf, n, "is_demod_locked =3D %d\n", p->is_demod_lock= ed); + n +=3D sysfs_emit_at(buf, n, "is_external_lna_on =3D %d\n", p->is_externa= l_lna_on); + n +=3D sysfs_emit_at(buf, n, "SNR =3D %d\n", p->SNR); + n +=3D sysfs_emit_at(buf, n, "ber =3D %d\n", p->ber); + n +=3D sysfs_emit_at(buf, n, "FIB_CRC =3D %d\n", p->FIB_CRC); + n +=3D sysfs_emit_at(buf, n, "ts_per =3D %d\n", p->ts_per); + n +=3D sysfs_emit_at(buf, n, "MFER =3D %d\n", p->MFER); + n +=3D sysfs_emit_at(buf, n, "RSSI =3D %d\n", p->RSSI); + n +=3D sysfs_emit_at(buf, n, "in_band_pwr =3D %d\n", p->in_band_pwr); + n +=3D sysfs_emit_at(buf, n, "carrier_offset =3D %d\n", p->carrier_offset= ); + n +=3D sysfs_emit_at(buf, n, "modem_state =3D %d\n", p->modem_state); + n +=3D sysfs_emit_at(buf, n, "frequency =3D %d\n", p->frequency); + n +=3D sysfs_emit_at(buf, n, "bandwidth =3D %d\n", p->bandwidth); + n +=3D sysfs_emit_at(buf, n, "transmission_mode =3D %d\n", p->transmissio= n_mode); + n +=3D sysfs_emit_at(buf, n, "modem_state =3D %d\n", p->modem_state); + n +=3D sysfs_emit_at(buf, n, "guard_interval =3D %d\n", p->guard_interval= ); + n +=3D sysfs_emit_at(buf, n, "code_rate =3D %d\n", p->code_rate); + n +=3D sysfs_emit_at(buf, n, "lp_code_rate =3D %d\n", p->lp_code_rate); + n +=3D sysfs_emit_at(buf, n, "hierarchy =3D %d\n", p->hierarchy); + n +=3D sysfs_emit_at(buf, n, "constellation =3D %d\n", p->constellation); + n +=3D sysfs_emit_at(buf, n, "burst_size =3D %d\n", p->burst_size); + n +=3D sysfs_emit_at(buf, n, "burst_duration =3D %d\n", p->burst_duration= ); + n +=3D sysfs_emit_at(buf, n, "burst_cycle_time =3D %d\n", p->burst_cycle_= time); + n +=3D sysfs_emit_at(buf, n, "calc_burst_cycle_time =3D %d\n", p->calc_bu= rst_cycle_time); + n +=3D sysfs_emit_at(buf, n, "num_of_rows =3D %d\n", p->num_of_rows); + n +=3D sysfs_emit_at(buf, n, "num_of_padd_cols =3D %d\n", p->num_of_padd_= cols); + n +=3D sysfs_emit_at(buf, n, "num_of_punct_cols =3D %d\n", p->num_of_punc= t_cols); + n +=3D sysfs_emit_at(buf, n, "error_ts_packets =3D %d\n", p->error_ts_pac= kets); + n +=3D sysfs_emit_at(buf, n, "total_ts_packets =3D %d\n", p->total_ts_pac= kets); + n +=3D sysfs_emit_at(buf, n, "num_of_valid_mpe_tlbs =3D %d\n", p->num_of_= valid_mpe_tlbs); + n +=3D sysfs_emit_at(buf, n, "num_of_invalid_mpe_tlbs =3D %d\n", p->num_o= f_invalid_mpe_tlbs); + n +=3D sysfs_emit_at(buf, n, "num_of_corrected_mpe_tlbs =3D %d\n", + p->num_of_corrected_mpe_tlbs); + n +=3D sysfs_emit_at(buf, n, "ber_error_count =3D %d\n", p->ber_error_cou= nt); + n +=3D sysfs_emit_at(buf, n, "ber_bit_count =3D %d\n", p->ber_bit_count); + n +=3D sysfs_emit_at(buf, n, "sms_to_host_tx_errors =3D %d\n", p->sms_to_= host_tx_errors); + n +=3D sysfs_emit_at(buf, n, "pre_ber =3D %d\n", p->pre_ber); + n +=3D sysfs_emit_at(buf, n, "cell_id =3D %d\n", p->cell_id); + n +=3D sysfs_emit_at(buf, n, "dvbh_srv_ind_hp =3D %d\n", p->dvbh_srv_ind_= hp); + n +=3D sysfs_emit_at(buf, n, "dvbh_srv_ind_lp =3D %d\n", p->dvbh_srv_ind_= lp); + n +=3D sysfs_emit_at(buf, n, "num_mpe_received =3D %d\n", p->num_mpe_rece= ived); debug_data->stats_count =3D n; spin_unlock(&debug_data->lock); @@ -148,78 +107,49 @@ static void smsdvb_print_isdb_stats(struct smsdvb_deb= ugfs *debug_data, buf =3D debug_data->stats_data; - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "statistics_type =3D %d\t", p->statistics_type); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "full_size =3D %d\n", p->full_size); - - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_rf_locked =3D %d\t\t", p->is_rf_locked); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_demod_locked =3D %d\t", p->is_demod_locked); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_external_lna_on =3D %d\n", p->is_external_lna_on); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "SNR =3D %d dB\t\t", p->SNR); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "RSSI =3D %d dBm\t\t", p->RSSI); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "in_band_pwr =3D %d dBm\n", p->in_band_pwr); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "carrier_offset =3D %d\t", p->carrier_offset); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "bandwidth =3D %d\t\t", p->bandwidth); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "frequency =3D %d Hz\n", p->frequency); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "transmission_mode =3D %d\t", p->transmission_mode); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "modem_state =3D %d\t\t", p->modem_state); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "guard_interval =3D %d\n", p->guard_interval); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "system_type =3D %d\t\t", p->system_type); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "partial_reception =3D %d\t", p->partial_reception); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_layers =3D %d\n", p->num_of_layers); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "sms_to_host_tx_errors =3D %d\n", p->sms_to_host_tx_errors); + n +=3D sysfs_emit_at(buf, n, "statistics_type =3D %d\t", p->statistics_ty= pe); + n +=3D sysfs_emit_at(buf, n, "full_size =3D %d\n", p->full_size); + + n +=3D sysfs_emit_at(buf, n, "is_rf_locked =3D %d\t\t", p->is_rf_locked); + n +=3D sysfs_emit_at(buf, n, "is_demod_locked =3D %d\t", p->is_demod_lock= ed); + n +=3D sysfs_emit_at(buf, n, "is_external_lna_on =3D %d\n", p->is_externa= l_lna_on); + n +=3D sysfs_emit_at(buf, n, "SNR =3D %d dB\t\t", p->SNR); + n +=3D sysfs_emit_at(buf, n, "RSSI =3D %d dBm\t\t", p->RSSI); + n +=3D sysfs_emit_at(buf, n, "in_band_pwr =3D %d dBm\n", p->in_band_pwr); + n +=3D sysfs_emit_at(buf, n, "carrier_offset =3D %d\t", p->carrier_offset= ); + n +=3D sysfs_emit_at(buf, n, "bandwidth =3D %d\t\t", p->bandwidth); + n +=3D sysfs_emit_at(buf, n, "frequency =3D %d Hz\n", p->frequency); + n +=3D sysfs_emit_at(buf, n, "transmission_mode =3D %d\t", p->transmissio= n_mode); + n +=3D sysfs_emit_at(buf, n, "modem_state =3D %d\t\t", p->modem_state); + n +=3D sysfs_emit_at(buf, n, "guard_interval =3D %d\n", p->guard_interval= ); + n +=3D sysfs_emit_at(buf, n, "system_type =3D %d\t\t", p->system_type); + n +=3D sysfs_emit_at(buf, n, "partial_reception =3D %d\t", p->partial_rec= eption); + n +=3D sysfs_emit_at(buf, n, "num_of_layers =3D %d\n", p->num_of_layers); + n +=3D sysfs_emit_at(buf, n, "sms_to_host_tx_errors =3D %d\n", p->sms_to_= host_tx_errors); for (i =3D 0; i < 3; i++) { if (p->layer_info[i].number_of_segments < 1 || p->layer_info[i].number_of_segments > 13) continue; - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate =3D %d\t", - p->layer_info[i].code_rate); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "constellation =3D %d\n", - p->layer_info[i].constellation); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tber =3D %-5d\t", - p->layer_info[i].ber); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "\tber_error_count =3D %-5d\t", - p->layer_info[i].ber_error_count); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count =3D %-5d\n", - p->layer_info[i].ber_bit_count); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber =3D %-5d\t", - p->layer_info[i].pre_ber); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tts_per =3D %-5d\n", - p->layer_info[i].ts_per); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "\terror_ts_packets =3D %-5d\t", - p->layer_info[i].error_ts_packets); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "total_ts_packets =3D %-5d\t", - p->layer_info[i].total_ts_packets); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i =3D %d\n", - p->layer_info[i].ti_ldepth_i); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "\tnumber_of_segments =3D %d\t", - p->layer_info[i].number_of_segments); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors =3D %d\n", - p->layer_info[i].tmcc_errors); + n +=3D sysfs_emit_at(buf, n, "\nLayer %d\n", i); + n +=3D sysfs_emit_at(buf, n, "\tcode_rate =3D %d\t", p->layer_info[i].co= de_rate); + n +=3D sysfs_emit_at(buf, n, "constellation =3D %d\n", p->layer_info[i].= constellation); + n +=3D sysfs_emit_at(buf, n, "\tber =3D %-5d\t", p->layer_info[i].ber); + n +=3D sysfs_emit_at(buf, n, "\tber_error_count =3D %-5d\t", + p->layer_info[i].ber_error_count); + n +=3D sysfs_emit_at(buf, n, "ber_bit_count =3D %-5d\n", + p->layer_info[i].ber_bit_count); + n +=3D sysfs_emit_at(buf, n, "\tpre_ber =3D %-5d\t", p->layer_info[i].pr= e_ber); + n +=3D sysfs_emit_at(buf, n, "\tts_per =3D %-5d\n", p->layer_info[i].ts_= per); + n +=3D sysfs_emit_at(buf, n, "\terror_ts_packets =3D %-5d\t", + p->layer_info[i].error_ts_packets); + n +=3D sysfs_emit_at(buf, n, "total_ts_packets =3D %-5d\t", + p->layer_info[i].total_ts_packets); + n +=3D sysfs_emit_at(buf, n, "ti_ldepth_i =3D %d\n", p->layer_info[i].ti= _ldepth_i); + n +=3D sysfs_emit_at(buf, n, "\tnumber_of_segments =3D %d\t", + p->layer_info[i].number_of_segments); + n +=3D sysfs_emit_at(buf, n, "tmcc_errors =3D %d\n", p->layer_info[i].tm= cc_errors); } debug_data->stats_count =3D n; @@ -241,80 +171,50 @@ static void smsdvb_print_isdb_stats_ex(struct smsdvb_= debugfs *debug_data, buf =3D debug_data->stats_data; - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "statistics_type =3D %d\t", p->statistics_type); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "full_size =3D %d\n", p->full_size); - - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_rf_locked =3D %d\t\t", p->is_rf_locked); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_demod_locked =3D %d\t", p->is_demod_locked); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "is_external_lna_on =3D %d\n", p->is_external_lna_on); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "SNR =3D %d dB\t\t", p->SNR); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "RSSI =3D %d dBm\t\t", p->RSSI); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "in_band_pwr =3D %d dBm\n", p->in_band_pwr); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "carrier_offset =3D %d\t", p->carrier_offset); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "bandwidth =3D %d\t\t", p->bandwidth); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "frequency =3D %d Hz\n", p->frequency); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "transmission_mode =3D %d\t", p->transmission_mode); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "modem_state =3D %d\t\t", p->modem_state); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "guard_interval =3D %d\n", p->guard_interval); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "system_type =3D %d\t\t", p->system_type); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "partial_reception =3D %d\t", p->partial_reception); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "num_of_layers =3D %d\n", p->num_of_layers); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "segment_number =3D %d\t", - p->segment_number); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "tune_bw =3D %d\n", - p->tune_bw); + n +=3D sysfs_emit_at(buf, n, "statistics_type =3D %d\t", p->statistics_ty= pe); + n +=3D sysfs_emit_at(buf, n, "full_size =3D %d\n", p->full_size); + + n +=3D sysfs_emit_at(buf, n, "is_rf_locked =3D %d\t\t", p->is_rf_locked); + n +=3D sysfs_emit_at(buf, n, "is_demod_locked =3D %d\t", p->is_demod_lock= ed); + n +=3D sysfs_emit_at(buf, n, "is_external_lna_on =3D %d\n", p->is_externa= l_lna_on); + n +=3D sysfs_emit_at(buf, n, "SNR =3D %d dB\t\t", p->SNR); + n +=3D sysfs_emit_at(buf, n, "RSSI =3D %d dBm\t\t", p->RSSI); + n +=3D sysfs_emit_at(buf, n, "in_band_pwr =3D %d dBm\n", p->in_band_pwr); + n +=3D sysfs_emit_at(buf, n, "carrier_offset =3D %d\t", p->carrier_offset= ); + n +=3D sysfs_emit_at(buf, n, "bandwidth =3D %d\t\t", p->bandwidth); + n +=3D sysfs_emit_at(buf, n, "frequency =3D %d Hz\n", p->frequency); + n +=3D sysfs_emit_at(buf, n, "transmission_mode =3D %d\t", p->transmissio= n_mode); + n +=3D sysfs_emit_at(buf, n, "modem_state =3D %d\t\t", p->modem_state); + n +=3D sysfs_emit_at(buf, n, "guard_interval =3D %d\n", p->guard_interval= ); + n +=3D sysfs_emit_at(buf, n, "system_type =3D %d\t\t", p->system_type); + n +=3D sysfs_emit_at(buf, n, "partial_reception =3D %d\t", p->partial_rec= eption); + n +=3D sysfs_emit_at(buf, n, "num_of_layers =3D %d\n", p->num_of_layers); + n +=3D sysfs_emit_at(buf, n, "segment_number =3D %d\t", p->segment_number= ); + n +=3D sysfs_emit_at(buf, n, "tune_bw =3D %d\n", p->tune_bw); for (i =3D 0; i < 3; i++) { if (p->layer_info[i].number_of_segments < 1 || p->layer_info[i].number_of_segments > 13) continue; - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate =3D %d\t", - p->layer_info[i].code_rate); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "constellation =3D %d\n", - p->layer_info[i].constellation); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tber =3D %-5d\t", - p->layer_info[i].ber); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "\tber_error_count =3D %-5d\t", - p->layer_info[i].ber_error_count); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count =3D %-5d\n", - p->layer_info[i].ber_bit_count); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber =3D %-5d\t", - p->layer_info[i].pre_ber); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "\tts_per =3D %-5d\n", - p->layer_info[i].ts_per); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "\terror_ts_packets =3D %-5d\t", - p->layer_info[i].error_ts_packets); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "total_ts_packets =3D %-5d\t", - p->layer_info[i].total_ts_packets); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i =3D %d\n", - p->layer_info[i].ti_ldepth_i); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, - "\tnumber_of_segments =3D %d\t", - p->layer_info[i].number_of_segments); - n +=3D scnprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors =3D %d\n", - p->layer_info[i].tmcc_errors); + n +=3D sysfs_emit_at(buf, n, "\nLayer %d\n", i); + n +=3D sysfs_emit_at(buf, n, "\tcode_rate =3D %d\t", p->layer_info[i].co= de_rate); + n +=3D sysfs_emit_at(buf, n, "constellation =3D %d\n", p->layer_info[i].= constellation); + n +=3D sysfs_emit_at(buf, n, "\tber =3D %-5d\t", p->layer_info[i].ber); + n +=3D sysfs_emit_at(buf, n, "\tber_error_count =3D %-5d\t", + p->layer_info[i].ber_error_count); + n +=3D sysfs_emit_at(buf, n, "ber_bit_count =3D %-5d\n", + p->layer_info[i].ber_bit_count); + n +=3D sysfs_emit_at(buf, n, "\tpre_ber =3D %-5d\t", p->layer_info[i].pr= e_ber); + n +=3D sysfs_emit_at(buf, n, "\tts_per =3D %-5d\n", p->layer_info[i].ts_= per); + n +=3D sysfs_emit_at(buf, n, "\terror_ts_packets =3D %-5d\t", + p->layer_info[i].error_ts_packets); + n +=3D sysfs_emit_at(buf, n, "total_ts_packets =3D %-5d\t", + p->layer_info[i].total_ts_packets); + n +=3D sysfs_emit_at(buf, n, "ti_ldepth_i =3D %d\n", p->layer_info[i].ti= _ldepth_i); + n +=3D sysfs_emit_at(buf, n, "\tnumber_of_segments =3D %d\t", + p->layer_info[i].number_of_segments); + n +=3D sysfs_emit_at(buf, n, "tmcc_errors =3D %d\n", p->layer_info[i].tm= cc_errors); } --=20 2.25.1