From 442cfeca3ee0cf0bbec707c5249a542ef583d63e Mon Sep 17 00:00:00 2001 From: James Ball Date: Wed, 18 Dec 2024 12:34:48 -0800 Subject: [PATCH] Manually fixing linter failures --- arch/csr/menvcfg.yaml | 2 +- lib/arch_obj_models/extension.rb | 12 ++++++------ lib/arch_obj_models/profile.rb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/csr/menvcfg.yaml b/arch/csr/menvcfg.yaml index ae41ca1a2..8feafff95 100644 --- a/arch/csr/menvcfg.yaml +++ b/arch/csr/menvcfg.yaml @@ -6,7 +6,7 @@ name: menvcfg address: 0x30A long_name: Machine Environment Configuration description: | - Contains fields that control certain characteristics of the execution environment + Contains fields that control certain characteristics of the execution environment for modes less privileged than M-mode. The `menvcfg` CSR controls diff --git a/lib/arch_obj_models/extension.rb b/lib/arch_obj_models/extension.rb index 742a08ad6..358bfea08 100644 --- a/lib/arch_obj_models/extension.rb +++ b/lib/arch_obj_models/extension.rb @@ -558,7 +558,7 @@ def initialize(data) end end - def mandatory? = (@presence == "mandatory") + def mandatory? = (@presence == "mandatory") def optional? = (@presence == "optional") # Class methods @@ -648,7 +648,7 @@ def <=>(other) # @overload >(other) # @param other [ExtensionPresence] An extension presence object # @return [Boolean] Whether or not this ExtensionPresence is greater-than the other - def >(other) + def >(other) raise ArgumentError, "ExtensionPresence is only comparable to other ExtensionPresence classes" unless other.is_a?(ExtensionPresence) (self.mandatory? && other.optional?) end @@ -659,12 +659,12 @@ def >(other) def >=(other) raise ArgumentError, "ExtensionPresence is only comparable to other ExtensionPresence classes" unless other.is_a?(ExtensionPresence) (self > other) || (self == other) - end + end # @overload <(other) # @param other [ExtensionPresence] An extension presence object # @return [Boolean] Whether or not this ExtensionPresence is less-than the other - def <(other) + def <(other) raise ArgumentError, "ExtensionPresence is only comparable to other ExtensionPresence classes" unless other.is_a?(ExtensionPresence) (self.optional? && other.mandatory?) end @@ -672,7 +672,7 @@ def <(other) # @overload <=(other) # @param other [ExtensionPresence] An extension presence object # @return [Boolean] Whether or not this ExtensionPresence is less-than or equal to the other - def <=(other) + def <=(other) raise ArgumentError, "ExtensionPresence is only comparable to other ExtensionPresence classes" unless other.is_a?(ExtensionPresence) (self < other) || (self == other) end @@ -795,4 +795,4 @@ def <=>(other) @name <=> other.name end -end \ No newline at end of file +end diff --git a/lib/arch_obj_models/profile.rb b/lib/arch_obj_models/profile.rb index 2ad406e06..9a6ed4652 100644 --- a/lib/arch_obj_models/profile.rb +++ b/lib/arch_obj_models/profile.rb @@ -121,7 +121,7 @@ def extension_presence(ext_name) profiles.each do |profile| presence = profile.extension_presence_obj(ext_name) - unless presence.nil? + unless presence.nil? if greatest_presence.nil? greatest_presence = presence elsif presence > greatest_presence