All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Maxime Ripard <mripard@kernel.org>,
	Sean Paul <seanpaul@chromium.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>
Cc: "Hans de Goede" <hdegoede@redhat.com>,
	"Derek Basehore" <dbasehore@chromium.org>,
	"Mathieu Alexandre-Tétreault" <alexandretm@amotus.ca>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH v2 02/13] drm/modes: parse_cmdline: Make various char pointers const
Date: Wed, 13 Nov 2019 17:44:23 +0100	[thread overview]
Message-ID: <20191113164434.254159-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20191113164434.254159-1-hdegoede@redhat.com>

We are not supposed to modify the passed in string, make char pointers
used in drm_mode_parse_cmdline_options() const char * where possible.

Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/drm_modes.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 3c3c7435225f..654d4b6fecb3 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1591,15 +1591,15 @@ static int drm_mode_parse_cmdline_int(const char *delim, unsigned int *int_ret)
 	return 0;
 }
 
-static int drm_mode_parse_cmdline_options(char *str, size_t len,
+static int drm_mode_parse_cmdline_options(const char *str, size_t len,
 					  const struct drm_connector *connector,
 					  struct drm_cmdline_mode *mode)
 {
 	unsigned int deg, margin, rotation = 0;
-	char *sep = str;
+	const char *sep = str;
 
 	while ((sep = strchr(sep, ','))) {
-		char *delim, *option;
+		const char *delim, *option;
 
 		option = sep + 1;
 		delim = strchr(option, '=');
@@ -1718,8 +1718,8 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
 	bool named_mode = false, parse_extras = false;
 	unsigned int bpp_off = 0, refresh_off = 0, options_off = 0;
 	unsigned int mode_end = 0;
-	char *bpp_ptr = NULL, *refresh_ptr = NULL, *extra_ptr = NULL;
-	char *options_ptr = NULL;
+	const char *bpp_ptr = NULL, *refresh_ptr = NULL, *extra_ptr = NULL;
+	const char *options_ptr = NULL;
 	char *bpp_end_ptr = NULL, *refresh_end_ptr = NULL;
 	int ret;
 
-- 
2.23.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-11-13 16:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13 16:44 [PATCH v2 01/13] drm/modes: parse_cmdline: Fix possible reference past end of string Hans de Goede
2019-11-13 16:44 ` Hans de Goede [this message]
2019-11-13 16:44 ` [PATCH v2 03/13] drm/modes: parse_cmdline: Stop parsing extras after bpp / refresh at ', ' Hans de Goede
2019-11-13 16:44 ` [PATCH v2 04/13] drm/modes: parse_cmdline: Accept extras directly after mode combined with options Hans de Goede
2019-11-13 16:44 ` [PATCH v2 05/13] drm/modes: parse_cmdline: Rework drm_mode_parse_cmdline_options() Hans de Goede
2019-11-13 16:44 ` [PATCH v2 06/13] drm/modes: parse_cmdline: Add freestanding argument to drm_mode_parse_cmdline_options() Hans de Goede
2019-11-13 16:44 ` [PATCH v2 07/13] drm/modes: parse_cmdline: Set bpp/refresh_specified after successful parsing Hans de Goede
2019-11-13 16:44 ` [PATCH v2 08/13] drm/modes: parse_cmdline: Allow specifying stand-alone options Hans de Goede
2019-11-13 16:44 ` [PATCH v2 09/13] drm/modes: parse_cmdline: Add support for specifying panel_orientation (v2) Hans de Goede
2019-11-18 12:25   ` Maxime Ripard
2019-11-13 16:44 ` [PATCH v2 10/13] drm/modes: parse_cmdline: Remove some unnecessary code (v2) Hans de Goede
2019-11-18 12:25   ` Maxime Ripard
2019-11-13 16:44 ` [PATCH v2 11/13] drm/modes: parse_cmdline: Explicitly memset the passed in drm_cmdline_mode struct Hans de Goede
2019-11-18  8:28   ` [drm/modes] 1ea4d22f11: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2019-11-18  8:28     ` [drm/modes] 1ea4d22f11: BUG:kernel_NULL_pointer_dereference, address kernel test robot
2019-11-18  8:28     ` [drm/modes] 1ea4d22f11: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2019-11-18 12:28   ` [PATCH v2 11/13] drm/modes: parse_cmdline: Explicitly memset the passed in drm_cmdline_mode struct Maxime Ripard
2019-11-18 12:33     ` Hans de Goede
2019-11-18 12:58       ` Maxime Ripard
2019-11-18 14:26     ` Hans de Goede
2019-11-13 16:44 ` [PATCH v2 12/13] drm/connector: Split out orientation quirk detection (v2) Hans de Goede
2019-11-13 16:44 ` [PATCH v2 13/13] drm/connector: Hookup the new drm_cmdline_mode panel_orientation member Hans de Goede
2019-11-18 12:25   ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191113164434.254159-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=airlied@linux.ie \
    --cc=alexandretm@amotus.ca \
    --cc=daniel.vetter@intel.com \
    --cc=dbasehore@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mripard@kernel.org \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.