From patchwork Sun Apr 25 08:43:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 427338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F57EC433B4 for ; Sun, 25 Apr 2021 08:43:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67CE5611BF for ; Sun, 25 Apr 2021 08:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbhDYIoK (ORCPT ); Sun, 25 Apr 2021 04:44:10 -0400 Received: from msg-2.mailo.com ([213.182.54.12]:46538 "EHLO msg-2.mailo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbhDYIoG (ORCPT ); Sun, 25 Apr 2021 04:44:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1619340201; bh=IfYpw+Ry1fGetkSVGFJGQbGFEKxP9hRXY5rKMEsvTH4=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=N40XJ2M2AzwKSOiuJcIzWuZat3i141kWQLeYGuXQKHEEU/3i2IbrmwrlphIvXvJM6 w54gyE6aDBOFgXIy6QART1uNgoVs0ywqyJL+a7ACCWwZGPvwL7kzD4cEZXgNtFIZ2h MxLuz7FlAVoJUlZpQ/AiQGHh7yD87nYVW/czAR/o= Received: by 192.168.90.14 [192.168.90.14] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 25 Apr 2021 10:43:20 +0200 (CEST) X-EA-Auth: +6RQOLJuBIDK1XGWm3V6ZattEF2K/txpnI/apZzi39Vrr57UGOf9+ccLgx0TkaDu7jNpRmhdjQ3cHoZCZCZtCmaoxOo3S7Hd Date: Sun, 25 Apr 2021 14:13:15 +0530 From: Deepak R Varma To: Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, drv@mailo.com Subject: [PATCH RESEND v3 3/6] staging: media: atomisp: use __func__ over function names Message-ID: <2cb42846abb7cab5e64bc29d5e496766f5df169b.1619199344.git.drv@mailo.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Replace hard coded function names from the debug print strings by standard __func__ predefined identifier. This resolves following checkpatch script WARNING: Prefer using '"%s...", __func__' to using function's name, in a string. Signed-off-by: Deepak R Varma --- Changes since v2: - None. Changes since v1: - None. .../staging/media/atomisp/i2c/atomisp-gc0310.c | 2 +- .../staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +- .../staging/media/atomisp/i2c/atomisp-lm3554.c | 2 +- .../staging/media/atomisp/i2c/atomisp-ov2680.c | 16 ++++++++-------- .../staging/media/atomisp/i2c/atomisp-ov2722.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c index d68a2bcc9ae1..b572551f1a0d 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c @@ -1292,7 +1292,7 @@ static int gc0310_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); struct gc0310_device *dev = to_gc0310_sensor(sd); - dev_dbg(&client->dev, "gc0310_remove...\n"); + dev_dbg(&client->dev, "%s...\n", __func__); dev->platform_data->csi_cfg(sd, 0); diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c index e722c639b60d..548c572d3b57 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c @@ -1034,7 +1034,7 @@ static int gc2235_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); struct gc2235_device *dev = to_gc2235_sensor(sd); - dev_dbg(&client->dev, "gc2235_remove...\n"); + dev_dbg(&client->dev, "%s...\n", __func__); dev->platform_data->csi_cfg(sd, 0); diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c index 7ca7378b1859..ab10fd98dbc0 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c @@ -680,7 +680,7 @@ static int lm3554_detect(struct v4l2_subdev *sd) int ret; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { - dev_err(&client->dev, "lm3554_detect i2c error\n"); + dev_err(&client->dev, "%s i2c error\n", __func__); return -ENODEV; } diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 92c52431bd8f..c17615149f46 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -146,7 +146,7 @@ static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val) struct ov2680_device *dev = to_ov2680_sensor(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - dev_dbg(&client->dev, "++++ov2680_g_bin_factor_x\n"); + dev_dbg(&client->dev, "++++%s\n", __func__); *val = ov2680_res[dev->fmt_idx].bin_factor_x; return 0; @@ -158,7 +158,7 @@ static int ov2680_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val) struct i2c_client *client = v4l2_get_subdevdata(sd); *val = ov2680_res[dev->fmt_idx].bin_factor_y; - dev_dbg(&client->dev, "++++ov2680_g_bin_factor_y\n"); + dev_dbg(&client->dev, "++++%s\n", __func__); return 0; } @@ -173,7 +173,7 @@ static int ov2680_get_intg_factor(struct i2c_client *client, u16 reg_val; int ret; - dev_dbg(&client->dev, "++++ov2680_get_intg_factor\n"); + dev_dbg(&client->dev, "++++%s\n", __func__); if (!info) return -EINVAL; @@ -251,8 +251,8 @@ static long __ov2680_set_exposure(struct v4l2_subdev *sd, int coarse_itg, int ret, exp_val; dev_dbg(&client->dev, - "+++++++__ov2680_set_exposure coarse_itg %d, gain %d, digitgain %d++\n", - coarse_itg, gain, digitgain); + "+++++++%s coarse_itg %d, gain %d, digitgain %d++\n", + __func__, coarse_itg, gain, digitgain); vts = ov2680_res[dev->fmt_idx].lines_per_frame; @@ -1061,9 +1061,9 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&dev->input_lock); if (enable) - dev_dbg(&client->dev, "ov2680_s_stream one\n"); + dev_dbg(&client->dev, "%s one\n", __func__); else - dev_dbg(&client->dev, "ov2680_s_stream off\n"); + dev_dbg(&client->dev, "%s off\n", __func__); ret = ov2680_write_reg(client, 1, OV2680_SW_STREAM, enable ? OV2680_START_STREAMING : @@ -1227,7 +1227,7 @@ static int ov2680_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); struct ov2680_device *dev = to_ov2680_sensor(sd); - dev_dbg(&client->dev, "ov2680_remove...\n"); + dev_dbg(&client->dev, "%s...\n", __func__); dev->platform_data->csi_cfg(sd, 0); diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index d046a9804f63..69409f8447b5 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -1175,7 +1175,7 @@ static int ov2722_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); struct ov2722_device *dev = to_ov2722_sensor(sd); - dev_dbg(&client->dev, "ov2722_remove...\n"); + dev_dbg(&client->dev, "%s...\n", __func__); dev->platform_data->csi_cfg(sd, 0); v4l2_ctrl_handler_free(&dev->ctrl_handler); From patchwork Sun Apr 25 08:45:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 427337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1309BC433ED for ; Sun, 25 Apr 2021 08:45:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCB70611BF for ; Sun, 25 Apr 2021 08:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbhDYIqe (ORCPT ); Sun, 25 Apr 2021 04:46:34 -0400 Received: from msg-2.mailo.com ([213.182.54.12]:46796 "EHLO msg-2.mailo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbhDYIqd (ORCPT ); Sun, 25 Apr 2021 04:46:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1619340348; bh=Q4IlbjxP7EcuQDsZ4PbW2Y+tHtW0IMzq0ljfK0cSi4I=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=EDJHVygrSib2uiJ8ZM8T7MXP6Y0+doLZ8tN11i4/C+xSPZ1R84w2gSrLsf1Gt0DCD IQd742vCDZzXXKxl2iehvG7/mYLq63I7yRxiZXXb170QeAbli3MSPBY4ZLEDRGtcnM V+AIrwVeu5nAXVogEqn5cryV2gWubAQoAvFwkFQA= Received: by 192.168.90.12 [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 25 Apr 2021 10:45:48 +0200 (CEST) X-EA-Auth: gQi61+D56tG938ONLKy+qUPkc84jUD7mFigWtjOhC0HNpiIW6k5lqnoD5G2q/Opk8jn76nAfjT/FJFSSTDWG107TAq7mNAEJ Date: Sun, 25 Apr 2021 14:15:44 +0530 From: Deepak R Varma To: Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, drv@mailo.com Subject: [PATCH RESEND v3 5/6] staging: media: atomisp: fix CamelCase variable naming Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Mixed case variable names are discouraged and they result in checkpatch script "Avoid CamelCase" warnings. Replace such CamelCase variable names by lower case strings according to the coding style guidelines. Signed-off-by: Deepak R Varma --- Changes since v2: - None. Changes since v1: - None. .../media/atomisp/i2c/atomisp-mt9m114.c | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index f314e5fed9cb..6de2cee4363e 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -1000,10 +1000,10 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd, struct mt9m114_device *dev = to_mt9m114_sensor(sd); int ret = 0; unsigned int coarse_integration = 0; - unsigned int FLines = 0; - unsigned int FrameLengthLines = 0; /* ExposureTime.FrameLengthLines; */ - unsigned int AnalogGain, DigitalGain; - u32 AnalogGainToWrite = 0; + unsigned int f_lines = 0; + unsigned int frame_len_lines = 0; /* ExposureTime.FrameLengthLines; */ + unsigned int analog_gain, digital_gain; + u32 analog_gain_to_write = 0; dev_dbg(&client->dev, "%s(0x%X 0x%X 0x%X)\n", __func__, exposure->integration_time[0], exposure->gain[0], @@ -1011,27 +1011,27 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd, coarse_integration = exposure->integration_time[0]; /* fine_integration = ExposureTime.FineIntegrationTime; */ - /* FrameLengthLines = ExposureTime.FrameLengthLines; */ - FLines = mt9m114_res[dev->res].lines_per_frame; - AnalogGain = exposure->gain[0]; - DigitalGain = exposure->gain[1]; + /* frame_len_lines = ExposureTime.FrameLengthLines; */ + f_lines = mt9m114_res[dev->res].lines_per_frame; + analog_gain = exposure->gain[0]; + digital_gain = exposure->gain[1]; if (!dev->streamon) { /* Save the first exposure values while stream is off */ dev->first_exp = coarse_integration; - dev->first_gain = AnalogGain; - dev->first_diggain = DigitalGain; + dev->first_gain = analog_gain; + dev->first_diggain = digital_gain; } - /* DigitalGain = 0x400 * (((u16) DigitalGain) >> 8) + */ - /* ((unsigned int)(0x400 * (((u16) DigitalGain) & 0xFF)) >>8); */ + /* digital_gain = 0x400 * (((u16) digital_gain) >> 8) + */ + /* ((unsigned int)(0x400 * (((u16) digital_gain) & 0xFF)) >>8); */ /* set frame length */ - if (FLines < coarse_integration + 6) - FLines = coarse_integration + 6; - if (FLines < FrameLengthLines) - FLines = FrameLengthLines; - ret = mt9m114_write_reg(client, MISENSOR_16BIT, 0x300A, FLines); + if (f_lines < coarse_integration + 6) + f_lines = coarse_integration + 6; + if (f_lines < frame_len_lines) + f_lines = frame_len_lines; + ret = mt9m114_write_reg(client, MISENSOR_16BIT, 0x300A, f_lines); if (ret) { - v4l2_err(client, "%s: fail to set FLines\n", __func__); + v4l2_err(client, "%s: fail to set f_lines\n", __func__); return -EINVAL; } @@ -1049,39 +1049,39 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd, /* * set analog/digital gain - switch(AnalogGain) + switch(analog_gain) { case 0: - AnalogGainToWrite = 0x0; + analog_gain_to_write = 0x0; break; case 1: - AnalogGainToWrite = 0x20; + analog_gain_to_write = 0x20; break; case 2: - AnalogGainToWrite = 0x60; + analog_gain_to_write = 0x60; break; case 4: - AnalogGainToWrite = 0xA0; + analog_gain_to_write = 0xA0; break; case 8: - AnalogGainToWrite = 0xE0; + analog_gain_to_write = 0xE0; break; default: - AnalogGainToWrite = 0x20; + analog_gain_to_write = 0x20; break; } */ - if (DigitalGain >= 16 || DigitalGain <= 1) - DigitalGain = 1; + if (digital_gain >= 16 || digital_gain <= 1) + digital_gain = 1; /* * AnalogGainToWrite = (u16)((DigitalGain << 12) | AnalogGainToWrite); */ - AnalogGainToWrite = (u16)((DigitalGain << 12) | (u16)AnalogGain); + analog_gain_to_write = (u16)((digital_gain << 12) | (u16)analog_gain); ret = mt9m114_write_reg(client, MISENSOR_16BIT, - REG_GAIN, AnalogGainToWrite); + REG_GAIN, analog_gain_to_write); if (ret) { - v4l2_err(client, "%s: fail to set AnalogGainToWrite\n", + v4l2_err(client, "%s: fail to set analog_gain_to_write\n", __func__); return -EINVAL; }