Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049AbdHCKU1 (ORCPT ); Thu, 3 Aug 2017 06:20:27 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37388 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbdHCKUZ (ORCPT ); Thu, 3 Aug 2017 06:20:25 -0400 Date: Thu, 3 Aug 2017 12:20:18 +0200 From: Daniel Vetter To: Bhumika Goyal Cc: julia.lawall@lip6.fr, daniel.vetter@intel.com, jani.nikula@linux.intel.com, airlied@linux.ie, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915: add const to bin_attribute Message-ID: <20170803102017.kcdiojt6wmjwvlkd@phenom.ffwll.local> Mail-Followup-To: Bhumika Goyal , julia.lawall@lip6.fr, daniel.vetter@intel.com, jani.nikula@linux.intel.com, airlied@linux.ie, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <1501694447-14356-1-git-send-email-bhumirks@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1501694447-14356-1-git-send-email-bhumirks@gmail.com> X-Operating-System: Linux phenom 4.11.0-2-amd64 User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1965 Lines: 57 On Wed, Aug 02, 2017 at 10:50:47PM +0530, Bhumika Goyal wrote: > Add const to bin_attribute structures as they are only passed to the > functions sysfs_{remove/create}_bin_file or > device_{remove/create}_bin_file. The corresponding arguments are of > type const, so declare the structures to be const. > > Signed-off-by: Bhumika Goyal Applied, thanks. -Daniel > --- > drivers/gpu/drm/i915/i915_sysfs.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c > index 7fcf006..d61c872 100644 > --- a/drivers/gpu/drm/i915/i915_sysfs.c > +++ b/drivers/gpu/drm/i915/i915_sysfs.c > @@ -220,7 +220,7 @@ static int l3_access_valid(struct drm_i915_private *dev_priv, loff_t offset) > return ret; > } > > -static struct bin_attribute dpf_attrs = { > +static const struct bin_attribute dpf_attrs = { > .attr = {.name = "l3_parity", .mode = (S_IRUSR | S_IWUSR)}, > .size = GEN7_L3LOG_SIZE, > .read = i915_l3_read, > @@ -229,7 +229,7 @@ static int l3_access_valid(struct drm_i915_private *dev_priv, loff_t offset) > .private = (void *)0 > }; > > -static struct bin_attribute dpf_attrs_1 = { > +static const struct bin_attribute dpf_attrs_1 = { > .attr = {.name = "l3_parity_slice_1", .mode = (S_IRUSR | S_IWUSR)}, > .size = GEN7_L3LOG_SIZE, > .read = i915_l3_read, > @@ -532,7 +532,7 @@ static ssize_t error_state_write(struct file *file, struct kobject *kobj, > return count; > } > > -static struct bin_attribute error_state_attr = { > +static const struct bin_attribute error_state_attr = { > .attr.name = "error", > .attr.mode = S_IRUSR | S_IWUSR, > .size = 0, > -- > 1.9.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch