1. 29 Mar, 2023 2 commits
    • Greg Kroah-Hartman's avatar
      driver core: class: implement class_get/put without the private pointer. · 884f8ce4
      Greg Kroah-Hartman authored
      Much like what was done in commit 273afac6 ("driver core: bus:
      implement bus_get/put() without the private pointer"), it is time to
      move the driver core away from using the internal private pointer in
      struct class in order to enable it to be always a constant and be placed
      in read-only memory in the future.
      
      First step in doing this is to create a helper function that turns a
      'struct class' into 'struct subsys_private' called class_to_subsys().
      
      class_to_subsys() walks the list of registered busses in the system and
      finds the matching one based on the pointer to the class itself.  As
      this is a short list, and this function is not on any fast path, it
      should not be noticable.
      
      Implement class_get() and class_put() using this new helper function.
      
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Link: https://lore.kernel.org/r/20230325194234.46588-1-gregkh@linuxfoundation.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      884f8ce4
    • Greg Kroah-Hartman's avatar
      driver core: class: mark the struct class for sysfs callbacks as constant · 75a2d422
      Greg Kroah-Hartman authored
      struct class should never be modified in a sysfs callback as there is
      nothing in the structure to modify, and frankly, the structure is almost
      never used in a sysfs callback, so mark it as constant to allow struct
      class to be moved to read-only memory.
      
      While we are touching all class sysfs callbacks also mark the attribute
      as constant as it can not be modified.  The bonding code still uses this
      structure so it can not be removed from the function callbacks.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Bartosz Golaszewski <brgl@bgdev.pl>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Namjae Jeon <linkinjeon@kernel.org>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Russ Weight <russell.h.weight@intel.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Steve French <sfrench@samba.org>
      Cc: Vignesh Raghavendra <vigneshr@ti.com>
      Cc: linux-cifs@vger.kernel.org
      Cc: linux-gpio@vger.kernel.org
      Cc: linux-mtd@lists.infradead.org
      Cc: linux-rdma@vger.kernel.org
      Cc: linux-s390@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: netdev@vger.kernel.org
      Reviewed-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Link: https://lore.kernel.org/r/20230325084537.3622280-1-gregkh@linuxfoundation.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      75a2d422
  2. 28 Mar, 2023 4 commits
  3. 27 Mar, 2023 4 commits
  4. 25 Mar, 2023 1 commit
  5. 24 Mar, 2023 11 commits
  6. 23 Mar, 2023 15 commits
  7. 22 Mar, 2023 3 commits